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 replicated your setup and used the gmapping node for SLAM with your ground bag.

Not quite sure what your problem is, but one issue I can see is that to see the results of the SLAM algorithm running on your bag file in RVIZ, you need to add the map message in RVIZ (Add -> rviz/Map), and then select the /map topic. If you do this, you will see that gmapping (for example) is indeed generating a map from your bag file.

Another issue is the message timestamps on your bag are set to the beginning of UNIX time (Jan 1 1970). You can see the bag timestamps by running

rosbag info ground.bag

and looking at the "start" and "end" fields. This is why you cannot see the robot model in RVIZ even after including the "RobotModel" message, as ROS drops old TF messages. You can also see this in effect if you look at your TF frames with

rosrun tf view_frames

Apart from map->odom (provided by gmapping), all other transforms are 1593366155.891 seconds old.

This happens because the Raspberry Pi 3 updates its date and time according to a time server on the internet. If the Pi is not connected to the internet, then it cannot update its own time and thus defaults to the beginning of UNIX time. In that case, you need to set the date and time manually with the "date" command. Note that the "date" command does not persist over reboots (the Pi 3 does not have a battery backup for clock), so you have to do it every reboot.

I am not sure this is really a problem for you since the SLAM map is being generated regardless of the old transforms. Nevertheless, the easiest way to fix this would be to update the date and time on your raspberry and record the bag again. Another slightly less easy way to fix this is to use the ROSBAG API and update the timestamps manually.