Robotics StackExchange | Archived questions

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

Hi,

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"

tf.jpg

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.........

Asked by RB on 2014-04-30 05:35:28 UTC

Comments

Answers

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: http://wiki.ros.org/tf#tf_echo

Asked by mmwise on 2014-04-30 07:45:49 UTC

Comments

@mmwise, thanks for the information. Got a link, might be helpful for others http://answers.ros.org/question/67206/getting-accurate-real-time-xy-coordinates-with-gmapping/

Asked by RB on 2014-04-30 19:58:54 UTC

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

Asked by Abdulbaki on 2018-02-18 04:38:05 UTC