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

[gmapping] get current robot-position?

asked 2011-06-19 03:38:38 -0600

G_Threepwood gravatar image

updated 2011-06-19 07:08:48 -0600

dornhege gravatar image

Hi folks!

Rosaria provides me with odometry, which is then given to gmapping and (along with some laser-sensordata) processed. As the robot moves in the world this creates a map of its environment. Now I wish to get the current position of my robot but can't quite figure out how. My understanding is as follows:

I need - a TransformListener from gmapping to be able to transform odometry into world-coordinates. - a Subscriber to get the odometry in the first place.

Since both need to be handled with callbacks I need to use gobal variables to get information from one to the other. This in turn makes it necessary to think about synchronization and race-conditions.

Is this really the proper way to do it / do I have an error in my understanding? If so, how do i go about solving the race-condition problem?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2011-06-19 07:07:45 -0600

dornhege gravatar image

You just need one TransformListener and listen for the /map -> /base_link transform.

The transform listener will take the gmapping and odometry transforms and build the correct one from that automatically.

edit flag offensive delete link more


@dornhege how can i acomplish to make this tranfsormlistener?? Can you give some details? Because ive been unable to mak eit work, thanks

ctguell gravatar image ctguell  ( 2013-12-19 15:33:59 -0600 )edit
dornhege gravatar image dornhege  ( 2013-12-20 00:05:29 -0600 )edit

Question Tools



Asked: 2011-06-19 03:38:38 -0600

Seen: 4,012 times

Last updated: Jun 19 '11