Map not built in slam_gmapping
Hi,
I am trying to build a map using slam_gmapping. My platform is ActivMedia MobileRobots Powerbot equipped with sonar sensors and SICKLMS laser range finder. I am using the ROSARIA
package to interact with the robot and to get the odometry data. Then I am using sicktoolbox_wrapper
package in order to interface with the laser range finder. I have tested each node separately to make sure that the data I want is being published over the respective topics. I tested this with ROSARIA by running rostopic echo /RosAria/pose
and also by writing code to subscribe to that topic. Similarly I ran rostopic echo scan
to see that the laser range finder is really working and I can see the data being streamed. I also tried to visualize it on rviz
but I got an error saying that the frame [laser]
does not exist. I don't know how to fix this but since I saw the data being publish over rostopic
I assumed that the laser scanner was set up and ready to be used.
So I followed this tutorial and built a bag by moving my robot around the room. The bag was created "successfully" since no errors had been given. At this point I wanted to verify that all the nodes were running appropriately and the right publishing and subcribing was being made. So I ran rqt_graph
and got this: C:\fakepath\setup rqt.png. From what I know of ROS, everything is set up according to the tutorial, having the slam_gmapping
node being subscribed to both /scan
and /tf
(this is the only difference from the tutorial: in the tutorial base_scan
was used while my topic from sicktoolbox_wrapper was just scan
).
I thought that having all this set up would result in a successful build of the map. However, when I ran gmapping and replayed the bag that I had recorded I got this error:
Warning: TF_OLD_DATA ignoring data from the past for frame base_link at time 1.42253e+09 according to authority /play_1422525800501358444
Possible reasons are listed at http://wiki.ros.org/tf/Errors%20explained
at line 260 in /tmp/buildd/ros-hydro-tf2-0.4.12-0precise-20141016-1214/src/buffer_core.cpp
When the bag stopped replaying and I attempted to save the map, no map was saved and it just kept "Waiting for map". Also, during the process of 'building' the map, I tried to visualize it on rviz but again, I got a warning message telling me "Map is not found".
Can anyone help me identify the fault and explain what is going on? Thanks!
EDIT
From what I can see from this rqt_graph
C:\fakepathslam_gmapping.png is that the node slam_gmapping is publishing on the topic /map
. I have added a Map on rviz
and set its topic to /map
but in the Status I'm getting a Warning saying: No Map Received. C:\fakepath\Rviz Slam_gmapping.pngHow is this possible?
EDIT
I run the sicktoolbox_wrapper node as follows:
rosrun sicktoolbox_wrapper sicklms _port:=/dev/ttyS1 _baud ...
the most likely reason is that your tf is not defined and connected to the base_laser_link. Can you check your tf tree for connection between the base_link with your laser sensor. Because the link is not published you are not able to see the laser data and also the map.
Hi Alex,
I am using this transform code (see this link) and I have seen the following tf frames (see frames.pdf.
The problem I'm facing now is that I can, technically, see a map being built. BUT the laser readings are seen jumping around on the grid in rviz, thus creating duplicates of the same mapped area. Do I have something wrong in my tf configuration?
Can you update your question with the launch files you are using for both the sicklaser and rosaria launch. I am guessing problem with your tf. What do you get when you change the fixed frame in rviz to laser frame. Do you still see jumping?
No, when the fixed frame in rviz is set to laser, I don't see any jumping. The jumping around of laser readings only happens when I run the tf broadcaster node (see link of transform.cpp in above comments). I'm not using any launch files for sicklaser and rosaria. I'll write how I run the nodes.
This is what I mean by jumping around of laser readings: laser jumps
and this is the "duplicated map" that is produced as a result: duplicate map
Can you share the bag file?
I was not recording bag files because I was running it and building the map in real-time...does that make a difference? The slam_gmapping algorithm can be run in real time, right? In any case I will record and share a bag file of the readings maybe you can help me identify what's wrong.