| 328 | } |
| 329 | |
| 330 | void MultiMapManager::chunkCallback(const plan_env::ChunkDataConstPtr& msg) |
| 331 | { |
| 332 | // Receive chunks from other drones, store them in chunk buffer |
| 333 | // if (msg->from_drone_id == drone_id_) return; |
| 334 | // if (msg->from_drone_id != 1) return; |
| 335 | // if(msg->to_drone_id != drone_id_) return; |
| 336 | |
| 337 | // Ignore chunks that are in the insertion buffer |
| 338 | if (buffer_map_[msg->chunk_drone_id - 1].find(msg->idx) != |
| 339 | buffer_map_[msg->chunk_drone_id - 1].end()) |
| 340 | return; |
| 341 | |
| 342 | // ROS_ERROR("received msg idx: %d, from %d to %d", msg->idx, msg->from_drone_id, |
| 343 | // msg->to_drone_id); |
| 344 | chunk_buffer_[msg->chunk_drone_id - 1].push_back(*msg); |
| 345 | buffer_map_[msg->chunk_drone_id - 1][msg->idx] = 1; |
| 346 | |
| 347 | return; |
| 348 | } |
| 349 | |
| 350 | void MultiMapManager::chunkTimerCallback(const ros::TimerEvent& e) |
| 351 | { |