multirobot_map_merge incorrect map merging with slam_karto

asked 2023-05-14 16:50:39 -0500

hunterlineage1 gravatar image

I am using multirobot_map_merge with 3 turtlebot3s running slam_karto to create an occupancy grid map. When I try to merge each robot's local maps, I get a merged map that has an origin set away from the map origin of the local maps and the merging is clearly incorrect.

When I run multirobot_map_merge with gmapping slam, the local maps merge perfectly and the origin of the merged map coincides with that of the local maps. I noticed that the navmsgs/OccupancyGrid messages of karto_slam and gmapping slam, for each robot, differ as I show below.

For gmapping slam: All 3 turtlebot3s have the same local map origin:

rostopic echo -n 1 tb3_0/map
header: 
  seq: 224
  stamp: 
    secs: 294
    nsecs: 554000000
  frame_id: "tb3_0/map"
info: 
  map_load_time: 
    secs: 0
    nsecs:         0
  resolution: 0.0750000029802
  width: 256
  height: 256
  origin: 
    position: 
      x: -9.975
      y: -9.975
      z: 0.0
    orientation: 
      x: 0.0
      y: 0.0
      z: 0.0
      w: 1.0

rostopic echo -n 1 tb3_1/map
header: 
  seq: 278
  stamp: 
    secs: 350
    nsecs: 641000000
  frame_id: "tb3_1/map"
info: 
  map_load_time: 
    secs: 0
    nsecs:         0
  resolution: 0.0750000029802
  width: 256
  height: 256
  origin: 
    position: 
      x: -9.975
      y: -9.975
      z: 0.0
    orientation: 
      x: 0.0
      y: 0.0
      z: 0.0
      w: 1.0

rostopic echo -n 1 tb3_2/map header: seq: 312 stamp: secs: 413 nsecs: 428000000 frame_id: "tb3_2/map" info: map_load_time: secs: 0 nsecs: 0 resolution: 0.0750000029802 width: 256 height: 256 origin: position: x: -9.975 y: -9.975 z: 0.0 orientation: x: 0.0 y: 0.0 z: 0.0 w: 1.0

But for kartoSLAM, the local map origins seem to be linked to the odom frame, and they are changing:

rostopic echo -n 1 tb3_0/map
header: 
  seq: 0
  stamp: 
    secs: 43
    nsecs: 830000000
  frame_id: "tb3_0/map"
info: 
  map_load_time: 
    secs: 0
    nsecs:         0
  resolution: 0.0500000007451
  width: 108
  height: 98
  origin: 
    position: 
      x: -0.21750697248
      y: 1.77349507736
      z: 0.0
    orientation: 
      x: 0.0
      y: 0.0
      z: 0.0
      w: 1.0

rostopic echo -n 1 tb3_1/map
header: 
  seq: 0
  stamp: 
    secs: 43
    nsecs: 833000000
  frame_id: "tb3_1/map"
info: 
  map_load_time: 
    secs: 0
    nsecs:         0
  resolution: 0.0500000007451
  width: 108
  height: 102
  origin: 
    position: 
      x: -0.21510239616
      y: -1.33190027392
      z: 0.0
    orientation: 
      x: 0.0
      y: 0.0
      z: 0.0
      w: 1.0

rostopic echo -n 1 tb3_2/map
header: 
  seq: 0
  stamp: 
    secs: 43
    nsecs: 830000000
  frame_id: "tb3_2/map"
info: 
  map_load_time: 
    secs: 0
    nsecs:         0
  resolution: 0.0500000007451
  width: 108
  height: 58
  origin: 
    position: 
      x: -0.220854254511
      y: 1.56606919118
      z: 0.0
    orientation: 
      x: 0.0
      y: 0.0
      z: 0.0
      w: 1.0

Due to this, I believe the map merging is incorrect and the origin of the merged map is not the same as that of the local maps. How can I fix this multirobot_map_merge issue with slam_karto?

edit retag flag offensive close merge delete

Comments

Good luck, looks very complicated.

Turuu gravatar image Turuu  ( 2023-05-15 00:05:58 -0500 )edit