Ask Your Question
0

Getting coordinates of robot positions from move_base

asked 2021-05-04 03:36:50 -0500

darkpsinight gravatar image

Hi, I'm playing around move_base , trying to find a way to get the coordinations of my robot each time it moves on the map ( x,y, rotation ). Any idea how to get theses from the move_base?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

answered 2021-05-04 08:43:58 -0500

tf2 allows you to get the coordinate relationship between map and base_link. The following example the difference between the positions of turtle2 and turtle1.

http://wiki.ros.org/tf2/Tutorials/Wri...

edit flag offensive delete link more
0

answered 2021-05-04 04:20:19 -0500

move_base uses a global costmap and a local costmap.

You can get the pose of the bot in the global_frame of the costmap using the costmap_2d::Costmap2DROS::getRobotPose() function.

edit flag offensive delete link more

Comments

thanks for the answer, but i need the return as a value not boolean.

darkpsinight gravatar image darkpsinight  ( 2021-05-04 04:40:51 -0500 )edit

Let's assume that move_base uses costmap_2d::Costmap2DROS* global_costmap.

Then, we can use the following -

tf::Stamped< tf::Pose > global_pose;

bool flag = global_costmap->getRobotPose(global_pose);

Does that make sense?

skpro19 gravatar image skpro19  ( 2021-05-04 05:09:21 -0500 )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

1 follower

Stats

Asked: 2021-05-04 03:36:50 -0500

Seen: 29 times

Last updated: May 04