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

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

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 close merge delete

Sort by ยป oldest newest most voted

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.

more

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,

more

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

( 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?

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

## Stats

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

Seen: 6,329 times

Last updated: Apr 11 '11