0
$\begingroup$

Rosanswers logo

Hello!

I am trying to use ros with stage and gmapping. I can move my robot in stage around, and with rostopic echo I can see, that the sensor readings change. But when I start gmapping, the GridMap values stay at -1.

I guess that is, because I did not compute tf. But rostopic info tells me, that stage is a publisher to tf, so now I am not sure, if I must calculate it myself, or if that is done for me.

If I have to do it myself, i guess i got to do the following:

Create a TransformListener

tf::StampedTransform transform;

listener.lookupTransform("/odom", "/map",ros::Time(0), transform);

And then publish the transform to tf?

Would be really glad if someone could help me!


Originally posted by Lotoreo on ROS Answers with karma: 1 on 2011-06-06

Post score: 0

$\endgroup$

3 Answers 3

0
$\begingroup$

Rosanswers logo

I'm not familiar with stage, but gmapping will require your robot (simulator) to publish transforms between the odometry and robot base frames, and between the robot base and laser frames. The default frame names expected by gmapping are "odom" for the odometry frame, "base_link" for the robot base frame, and whichever frame the laser is being published on.

The transform between "odom" and "map" will be then published by gmapping itself.

Check sections 5.1.1 and 5.1.5 in gmapping docs.


Originally posted by Miguel Prada with karma: 1071 on 2011-06-06

This answer was ACCEPTED on the original site

Post score: 1

$\endgroup$
0
$\begingroup$

Rosanswers logo

You should follow this tutorial: Robot Setup It explains what the prerequisites for navigation are, i.e. what you have to set up. Stage publishing /tf doesn't mean it publishes all transforms necessary. You can look at the tf tree by rosrun tf view_frames.


Originally posted by dornhege with karma: 31395 on 2011-06-06

This answer was NOT ACCEPTED on the original site

Post score: 2

$\endgroup$
0
$\begingroup$

Rosanswers logo

Stage publishes all the necessary tf data. The problem is likely that you don't have gmapping correctly configured (in particular, remapping the input scan topic). The navigation_stage package has example of using both gmapping and amcl with stage. For example, see this launch file.


Originally posted by Brian Gerkey with karma: 2916 on 2011-06-07

This answer was NOT ACCEPTED on the original site

Post score: 1

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.