ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I would forget about gmapping for now and just make sure that the rest works fine. gmapping then usually works without problems. I suspect you have setup you TF chain wrong. You should have something like /odom -> /base_link -> /laser. For each transform in this chain there must be one and only one publisher.

First, don't start your odometry node and check what TF you have (e.g. rosrun tf view_frames and/or check the fixed frames in rviz.). Someone should provide /base_link -> /laser and you should be able to select /base_link as a fixed frame in rviz without errors. This is either provided by your robot, e.g. by URDF + robot_state_publisher or your static_transform_publisher. There must be only one publisher.

Second, if that works start your odometry node. This node must provide odometry TF, that is the /odom -> /base_link TF transform, not only the /odom topic. You should be able to select /odom as a fixed frame in TF. Everything should work fine and driving around you should see the laser being transformed correctly in rviz. If you set the laser display decay high in rviz, you should see an "odometry map" of laser scans.

If all this works fine, gmapping should work fine. If not, fix the step that doesn't work without running anything else that interferes.