Ask Your Question

Revision history [back]

First off, in RVIZ, change the "fixed frame" in "Global Options" (the left side panel) to "map" rather than "base_link". This will then display the laser and map data in the proper frame. This should then have the laser data line up with the map (when you stop the robot).

Now the next problem is probably related to your odometry. Before even trying to map, I would try this experiment:

  • Set the "fixed frame" to "odom" (or whatever the TF frame of your odometry is)
  • Change the "decay time" for your laser visualization (also in the left side panel, expand the LaserScan to see options) to a high number - say 100.
  • Rotate the robot

This will cause RVIZ to display all of your laserscans, transformed only by the odometry. If your odometry is good, the various laser scans will line up relatively closely (there will always be some drift, but you should still see the outline of the room you are in fairly clearly). Your scans probably won't line up - but you can re-run this experiment as you tune the odometry. Once you have decent odometry, the scan matcher will be more able to actually line up the scans and build a reasonable map.