Ask Your Question
4

How to programatically set the 2D pose on a map ?

asked 2011-04-09 04:28:34 -0500

How do I programatically set the the initial 2D pose estimate on a map when running acml and move_base - equivalent to the "2D pose estimate" button within Rviz ?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
4

answered 2011-04-11 05:03:24 -0500

eitan gravatar image

Just to add a little more information. You can set the inital pose of the robot by publishing to the "initialpose" topic used by AMCL and documented here: http://www.ros.org/wiki/amcl#Subscribed_Topics. This is, in fact, what RVIZ does when you use the "2D Pose Estimate" button. You can always user "rostopic echo initialpose" to see exactly what it's sending.

Hope this helps.

edit flag offensive delete link more
1

answered 2011-04-10 18:20:24 -0500

Prasad gravatar image

Hello,

We have done like below:

We used ar_pose_estimate to get pattern position from the robot and then subsribe to ar pose topic and get the robot pose.

msg_mark is the message received from ar_pose_marker

msg.header.frame_id = "/map";
msg.pose.pose.position.x = msg_mark->pose.pose.position.x;
msg.pose.pose.position.y = msg_mark->pose.pose.position.y;
msg.pose.pose.position.z = 0.0;
msg.pose.pose.orientation.w = msg_mark->pose.pose.orientation.w;

double theta;
btQuaternion quat;
quat.setRPY(0.0, 0.0, theta);

tf::quaternionTFToMsg(quat, pose.pose.pose.orientation);

msg.pose.covariance[6*0+0] = 0.5 * 0.5;

msg.pose.covariance[6*1+1] = 0.5 * 0.5;

msg.pose.covariance[6*3+3] = m_pi/12.0 * m_pi/12.0;

Regards,

Prasad

edit flag offensive delete link more

Comments

Does this answer the question? Sorry but i really cant understand the ar pose topic.

FuerteNewbie gravatar imageFuerteNewbie ( 2014-01-02 20:31:57 -0500 )edit

@FuerteNewbie Here some detail about ar_pose_estimate. Anyway I have similar problem, so how you solve it?

achmad_fathoni gravatar imageachmad_fathoni ( 2018-06-16 12:43:50 -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

Stats

Asked: 2011-04-09 04:28:34 -0500

Seen: 4,726 times

Last updated: Apr 11 '11