Ask Your Question
2

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

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

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
6

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

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

@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 imageRB ( 2014-04-30 19:58:54 -0600 )edit

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

Abdulbaki gravatar imageAbdulbaki ( 2018-02-18 03:38:05 -0600 )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

3 followers

Stats

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

Seen: 9,664 times

Last updated: Apr 30 '14