Ask Your Question
0

Ros, stage, gmapping --> tf

asked 2011-06-06 21:33:16 -0500

Lotoreo gravatar image

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!

edit retag flag offensive close merge delete

4 Answers

Sort by ยป oldest newest most voted
1

answered 2011-06-06 22:11:25 -0500

Miguel Prada gravatar image

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.

edit flag offensive delete link more
2

answered 2011-06-06 23:33:20 -0500

dornhege gravatar image

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.

edit flag offensive delete link more
1

answered 2011-06-07 21:24:07 -0500

Brian Gerkey gravatar image

updated 2011-06-08 04:26:58 -0500

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.

edit flag offensive delete link more
0

answered 2011-06-07 03:30:57 -0500

Lotoreo gravatar image

Thx for the links, don't know how I could have overseen section 5.1.5! Now I do at least have a clue, what gmapping needs, and why. But there are still some things that bother me:

1) Do I have to transform the actual values, or is that than by gmapping, if I just give it the right transformation?

2) Do I have to broadcast the transformations or shall I just publish them in the tf topic?

Regards, Lotoreo

edit flag offensive delete link more

Comments

You should publish via the tf library and not directly to the tf topic.
dornhege gravatar imagedornhege ( 2011-06-07 04:25:13 -0500 )edit
What you mean with 1? You need to make sure that stage publishes the transform between the odometry frame and the robot base frame. Also, someone must be publishing the transform between the robot base frame and the laser frame, I ignore if stage does it too. Also configure gmapping with frame names
Miguel Prada gravatar imageMiguel Prada ( 2011-06-07 21:44:51 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2011-06-06 21:33:16 -0500

Seen: 2,221 times

Last updated: Jun 08 '11