| 294 | } |
| 295 | |
| 296 | void MultiMapManager::chunkCallback(const plan_env::ChunkDataConstPtr& msg) { |
| 297 | // Receive chunks from other drones, store them in chunk buffer |
| 298 | if (msg->from_drone_id == drone_id_) return; |
| 299 | // if(msg->to_drone_id != drone_id_) return; |
| 300 | |
| 301 | // Ignore chunks that are in the insertion buffer |
| 302 | if (buffer_map_[msg->chunk_drone_id - 1].find(msg->idx) != |
| 303 | buffer_map_[msg->chunk_drone_id - 1].end()) |
| 304 | return; |
| 305 | |
| 306 | // ROS_ERROR("received msg idx: %d, from %d to %d", msg->idx, msg->from_drone_id, |
| 307 | // msg->to_drone_id); |
| 308 | chunk_buffer_[msg->chunk_drone_id - 1].push_back(*msg); |
| 309 | buffer_map_[msg->chunk_drone_id - 1][msg->idx] = 1; |
| 310 | |
| 311 | return; |
| 312 | } |
| 313 | |
| 314 | void MultiMapManager::chunkTimerCallback(const ros::TimerEvent& e) { |
| 315 | |