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

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

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

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

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

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

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

Prasad gravatar image


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;



edit flag offensive delete link more


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

FuerteNewbie gravatar image FuerteNewbie  ( 2014-01-02 20:31:57 -0600 )edit

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

achmad_fathoni gravatar image achmad_fathoni  ( 2018-06-16 12:43:50 -0600 )edit

Question Tools


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

Seen: 6,329 times

Last updated: Apr 11 '11