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

How to get robot position (x,y) in a map?

asked 2014-04-30 05:35:28 -0500

RB gravatar image


I want to calculate robot's current position with respect to the map. Autonomous navigation of ROS works fine. Initially, I thought that by listening to /amcl_pose topic, we can get the current position. But when I do, "rostopic echo /amcl_pose", then there is no such messages.

I am using Pioneer 3 AT, and want to calculate the robot's (center of gravity) position with respect to a known map. (don't want to consider four corners of the robot).

Following is my "rosrun tf view_frames"


In the answer, I get that AMCL usually publishes the position of the robot as a TF transform from the /map frame to the /base_link frame?

But, How to achieve this can you help me with some simple code snippet?

Thanks in advance.........

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2014-04-30 07:45:49 -0500

mmwise gravatar image

a quick and easy way to get the transform from the /map to /base_link is to use the command-line tool:

rosrun tf tf_echo /map /base_link

for more information about the tf command-line tools see the tf wiki page:

edit flag offensive delete link more



@mmwise, thanks for the information. Got a link, might be helpful for others

RB gravatar image RB  ( 2014-04-30 19:58:54 -0500 )edit

In real time, which node publishes map frame? should I publish it by myself from pose information?

Abdulbaki gravatar image Abdulbaki  ( 2018-02-18 03:38:05 -0500 )edit
hunterlineage1 gravatar image hunterlineage1  ( 2023-03-19 01:32:49 -0500 )edit

Question Tools



Asked: 2014-04-30 05:35:28 -0500

Seen: 17,570 times

Last updated: Apr 30 '14