wrong map produced during multi-robot map merging

asked 2021-02-16 12:50:23 -0500

updated 2021-02-17 09:21:16 -0500

I am trying to map a Gazebo world (see image below) using two husky bots using the multirobot_map_package.

I have spawned two husky bots (namespaced husky_1 and husky_2) in the Gazebo world.

I using two ekf_localization nodes (husky_1/ekf_localization and husky_2/ekf_localization) to publish the husky_1/odom -> husky_1/base_link and husky_2/odom -> husky_2/base_link transforms.

I am using two move_base nodes (/husky_1/move_base and /husky_2/move_base). I have set static_map to false.

I am also using two slam_gmapping nodes (husky_1/slam_gmapping and husky_2/slam_gmapping) to achieve two things -

  • publish /map -> /husky_1/odom and /map -> /husky_2/odom transforms
  • publish /husky_1/map and /husky_2/map (which is needed by the multirobot_map_package)

Here's the thing though -

  • I have spawned husky_1 and husky_2 at (0,0,0) and (7,0,0) respectively. I assume these refer to the co- ordinates in the Gazebo world. We can see their initial poses in the Gazebo world in the image below.

image

  • I am running two exploration nodes (from the explore_lite package), namely husky_1/explore and husky_2/explore. This node performs frontier_based exploration of the world. As the bots are exploring the world, I see a significant mismatch between their positions in the Gazebo world and that in /map fixed frame in Rviz. (See image below)

image

  • multirobot_map_package takes the map published in /husky_1/map and /husky_2/map and publishes the merged_map at /merge_map/map. I have also set the known_init_poses to true. For each of the two bots, I set the values of map_merge/init_pose_x , pose_y, pose_z, pose_yaw to the same values used while spawing the bots in the Gazebo world.

Even though the maps published at /husky_1/map and /husky_2/map (by husky_1/slam_gmapping and husky_2/slam_gmapping respectively) appear to be correct, the map published at /map_merge/map seems to be wrong. (See images for /husky_1/map , /husky_2/map and /map_merge/map below).

image_1

image_2

image_3

Why is this happening?

EDIT ONE -

On setting the known_init_poses paramtere to false for multirobot_map_package, I am able to produce the correct merged_map. However, the positions of the bots in the merged_map seem to be wrong. I am attaching the images in the Fixed frame /map of /husky_1/map, /husky_2/map and /map_merge/map respectively.

image_1 image_2 image_3

edit retag flag offensive close merge delete