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

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

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

RB gravatar image

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

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
7

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

edit flag offensive delete link more

Comments

1

@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/

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

2 followers

Stats

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

Seen: 17,570 times

Last updated: Apr 30 '14