Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

As bvbdort already mentioned, you need to also publish the base_link -> odom transform. You can do it in your launch file like this:

<launch>
  <node pkg="tf" type="static_transform_publisher" name="odom_to_base_link" args="0 0 0 0 0 0 odom base_link 100" />
  <node pkg="tf" type="static_transform_publisher" name="US6" args="0 7 2 1.5708 0 0 base_link laser 100" />
</launch>

That way every transform gmapping expects to run is set up. Mind that gmapping won't really be able to extimate the position of the laser in the map, since you publish odometry information as a static transformation. But at least you should see a map built from your laser.

PS: If it still doesn't work that way, please provide info about what gmapping prints out.

As bvbdort already mentioned, you need to also publish the base_link -> odom transform. You If you don't have an odometry system, you can do it with a static transform publisher in your launch file like this:

<launch>
  <node pkg="tf" type="static_transform_publisher" name="odom_to_base_link" args="0 0 0 0 0 0 odom base_link 100" />
  <node pkg="tf" type="static_transform_publisher" name="US6" args="0 7 2 1.5708 0 0 base_link laser 100" />
</launch>

That way every transform gmapping expects to run is set up. Mind that gmapping won't really be able to extimate the position of the laser in the map, since you publish odometry information manually as a static transformation. But at least you should see a map built from your laser.

PS: If it still doesn't work that way, please provide info about what gmapping prints out.