hrnr / m-explore

ROS packages for multi robot exploration
Other
324 stars 210 forks source link

Shift in merged map origin even with static transforms #65

Open winwinashwin opened 2 years ago

winwinashwin commented 2 years ago

I have two turtlebots publishing maps at /tb3_0/map and /tb3_1/map, with known initial positions. The origin of the merged map seems to have an offset from the individual maps

Map 1 metadata

$ rostopic echo -n 1 /tb3_0/map | head -n 23
header: 
  seq: 14
  stamp: 
    secs: 34
    nsecs: 317000000
  frame_id: "tb3_0/map"
info: 
  map_load_time: 
    secs: 0
    nsecs:         0
  resolution: 0.05000000074505806
  width: 384
  height: 384
  origin: 
    position: 
      x: -10.0
      y: -10.0
      z: 0.0
    orientation: 
      x: 0.0
      y: 0.0
      z: 0.0
      w: 1.0

Map 2 metadata

$ rostopic echo -n 1 /tb3_1/map | head -n 23
header: 
  seq: 11
  stamp: 
    secs: 27
    nsecs:  58000000
  frame_id: "tb3_1/map"
info: 
  map_load_time: 
    secs: 0
    nsecs:         0
  resolution: 0.05000000074505806
  width: 384
  height: 384
  origin: 
    position: 
      x: -10.0
      y: -10.0
      z: 0.0
    orientation: 
      x: 0.0
      y: 0.0
      z: 0.0
      w: 1.0

Merged map metadata

$ rostopic echo -n 1 /map | head -n 23
header: 
  seq: 37
  stamp: 
    secs: 38
    nsecs:   2000000
  frame_id: "map"
info: 
  map_load_time: 
    secs: 38
    nsecs:   2000000
  resolution: 0.05000000074505806
  width: 384
  height: 388
  origin: 
    position: 
      x: -9.600000143051147
      y: -9.700000144541264
      z: 0.0
    orientation: 
      x: 0.0
      y: 0.0
      z: 0.0
      w: 1.0

TF info

Transforms between frames are set (for each robot) as

<node pkg="tf" type="static_transform_publisher" name="world_to_$(arg uid)_tf_broadcaster"
                  args="0 0 0 0 0 0 /map /$(arg uid)/map 100"/>
sandilyasg commented 1 year ago

@winwinashwin I am experiencing the same issue. Were you able to resolve this? Please let me know.