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

gmapping creates no map

asked 2012-09-15 14:17:13 -0600

Flowers gravatar image

updated 2012-09-16 08:32:15 -0600

Hey,

I created a bagfile containing the data of a LaserScan and odometry published in /tf.

According to rostopic echo the data is fine, by fine I mean the data is changing and in the right form.

Still, for some reason I don't know, this warning occurs:

[ WARN] [1243531255.142345324]: MessageFilter [target=/odom ]: Dropped 100.00% of messages so far. Please turn the [ros.gmapping.message_notifier] rosconsole logger to DEBUG for more information.

Anyone there, who had the same problem?

P.S.: I know, there warning contains information about what to do, but I haven't figured out, what it wants me to do...so explanations what "turn the rosconsole logger" means and how it is done are also welcome :-)

Edit: According to another question asked here, it might be some issue concerning time stamps, therefore I modified my /scan topic by setting the header.stamp to ros::Time::now(), which is exactly what I do with the /odom's header...

Edit2: link text

That is one of the bagfiles I recorded :-)

Edit3: testfile here is a file with a static transform publisher - still all odom data is dropped, and I really can't make out the difference to the tutorial's bagfile - at least I've found nothing that should matter....

edit retag flag offensive close merge delete

Comments

could you post the bagfile? It is hard to tell what's going on without it...

allenh1 gravatar image allenh1  ( 2012-09-16 05:12:36 -0600 )edit

done, thanks for your affords

Flowers gravatar image Flowers  ( 2012-09-16 07:12:50 -0600 )edit

4 Answers

Sort by ยป oldest newest most voted
2

answered 2012-09-16 20:37:43 -0600

Are you sure you have set up everything correctly for using simulation time (so the timestamps from the bagfile are used)? Also see the Clock documentation regarding this. You have start a roscore, set the parameter:

rosparam set use_sim_time true

then start anything else you need and then play your bagfile with the --clock option:

rosbag play [your_bagfile] --clock

As for the rosconsole logger question, you can use the rxconsole tool to set different log levels for different nodes and get more debug output.

edit flag offensive delete link more

Comments

1

Short question: Do I have to set use_sim_time before recording the data - because if I follow your instructions still all the odom messages are dropped(rxconsole doesn't really help, seems to be some issue in /tf messagefilter - given codeline is just the output).

Flowers gravatar image Flowers  ( 2012-09-16 21:46:27 -0600 )edit

I am facing the same problem and I am using the use_sim_time parameter correctly. I have added a static transform publisher between- base_link and map, & map and odom. This is what i run-

  rosrun gmapping slam_gmapping scan:=base_scan _odom_frame:=odom _base_frame:=base_link _map_frame:=map
Harsh2308 gravatar image Harsh2308  ( 2017-09-07 08:05:36 -0600 )edit
4

answered 2012-09-16 22:00:43 -0600

Lorenz gravatar image

Your tf tree is apparently not complete. Have a look at the gmapping wiki page. You can find a section on required tf transforms at the bottom.

First, the system needs to be able to transform from your laser sensor into base link. You seem to publish a transform from base_link to base_laser, but your sensor data on the scan topic is in frame openni_depth_frame, i.e. gmapping will not be able to transform the sensor data correctly. Instead of having a static_transform_publisher from base_link to base_laser, publish the transform from base_link to openni_depth_frame.

Second, you don't seem to have an odom transform. However, gmapping requires valid odometry. Normally, the transform is published by your robot's base driver that also publishes on the /odom topic. Make sure you have that set up correctly, otherwise gmapping won't work.

edit flag offensive delete link more

Comments

My odom node is basically http://www.ros.org/wiki/navigation/Tutorials/RobotSetup/Odom , so there should be everything needed?

Flowers gravatar image Flowers  ( 2012-09-17 04:30:20 -0600 )edit

In the bag you provide I cannot see the odom->base_link transform. Verify that your odom node is really working.

Lorenz gravatar image Lorenz  ( 2012-09-17 04:31:59 -0600 )edit

http://speedy.sh/c7p5J/test2.bag <- would you mind looking at this bagfile, I tried to implement your solution. I am pretty sure that my odom node works, especially as it is nearly 1:1 the example code for fake odom data from the navigation stack(which uses gmapping, so that should be fine)

Flowers gravatar image Flowers  ( 2012-09-17 06:18:45 -0600 )edit
1

It looks like your tf tree is somehow messed up. rosrun tf view_frames shows that you seem to have two root,s, base_footprint and odom. I don't know which node publishes the transform base_footprint->base_link but either odom should publish odom->base_footprint or you should get rid of it.

Lorenz gravatar image Lorenz  ( 2012-09-17 06:24:10 -0600 )edit

Can't thank you enough, finally got everything to work(my maps look like crap, but I suppose thats due to the recorded data).

Flowers gravatar image Flowers  ( 2012-09-17 12:40:06 -0600 )edit

Great! If my answer was correct, please mark it so (little check under the up/downvote buttons).

Lorenz gravatar image Lorenz  ( 2012-09-17 21:58:06 -0600 )edit
1

answered 2012-09-16 07:25:40 -0600

allenh1 gravatar image

Ok. So, you have the robot's \scan topic publishing on the wrong frame. You need to publish the data on the same frame as the robot. So, try a static transform publisher. This will let gmapping know where the laser is with respect to the robot's coordinate system. Hope this was of use to you!

edit flag offensive delete link more

Comments

Flowers gravatar image Flowers  ( 2012-09-16 08:29:07 -0600 )edit
1

answered 2019-09-11 06:40:09 -0600

obernoob gravatar image

In my case it didn't work if I had recorded the bagfile with

$ rosbag record -O testbag1.bag scan tf

but it did work quick & dirty when I had used

$ rosbag record -a

I am very new to ROS and I only assume there is another necessary topic recorded among all topics when using "-a" which is related to tf transform as Lorenz and allenh1 mentioned.

edit flag offensive delete link more

Comments

I was having the same issue, and doing rosbag record -a fixed it. After that, I did some testing and found that the other necessary topic is /tf_static. This has something to do with the change to tf2 that occurred since the Hydroversion. http://wiki.ros.org/tf2/Migration#Add...

BesterJester gravatar image BesterJester  ( 2020-11-16 03:37:24 -0600 )edit

Question Tools

3 followers

Stats

Asked: 2012-09-15 14:17:13 -0600

Seen: 13,428 times

Last updated: Sep 11 '19