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

amcl laser localization

asked 2013-04-12 02:42:07 -0500

acp gravatar image


I have a question.

I have created a map using slam_gmapping package, then I save that map as map.yaml using rosrun map_server map_saver -f map.

Is it possible to use a laser and the map I have created with amcl for localization?

I appreciate your answer :)

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2013-04-12 03:04:02 -0500

Ben_S gravatar image

Short answer: yes.

Longer answer: Yes, it is possible. Use the map_server to publish your saved map, start amcl and use rviz to estimate the inital pose. Then move your robot around and see, if the localization is working. :)

edit flag offensive delete link more


well, I do the following: I use rosrun map_server map_server map.yaml then in another console I use rosrun amcl amcl scan. Then the only topic I see in rviz under Pose is /move_base_simple/goal. I supposed to see amcl_pose topic under Pose, right?

acp gravatar image acp  ( 2013-04-12 03:15:24 -0500 )edit

According to the docs, amcl publishes the pose as geometry_msgs/PoseWithCovarianceStamped. But you can also add displays for the particlecloud (geometry_msgs/PoseArray) and tf. Through tf, amcl should publish the most likely transform between your map and odom.

Ben_S gravatar image Ben_S  ( 2013-04-12 03:40:33 -0500 )edit

well, i have 2 issues, 1.-how i can set the initial pose 2--why my map gets rotated after I have published it and visualized in rviz?

acp gravatar image acp  ( 2013-04-12 04:07:39 -0500 )edit

1) In rviz you should have a "2d pose estimate" button. 2) Depending on your fixed frame, the visualized map can rotate if the best guess by amcl changes. Try setting the fixed frame to /map in rviz.

Ben_S gravatar image Ben_S  ( 2013-04-12 04:14:16 -0500 )edit

Well, it seems to be as it everything is working, the only issue now is how to see the estimated poses produced by amcl in rviz? in other words, how can I see that amcl is working?

acp gravatar image acp  ( 2013-04-14 22:30:06 -0500 )edit

Add a display of type PoseArray to rviz, set the topic to /particlecloud and then drive around a little bit. You then should see all the pose-guesses of amcl as small arrows in rviz.

Ben_S gravatar image Ben_S  ( 2013-04-14 23:25:20 -0500 )edit

Well, it seems to be as PoseAarray is working under rviz, however, from the beginning the amcl algorithm spreads particles even outside the map. Is that normal? or is there a way to fix it?

acp gravatar image acp  ( 2013-04-15 22:11:46 -0500 )edit

Since amcl publishes the pose as geometry_msgs/PoseWithCovarianceStamped, how can I see the poses with covariance under rviz?

acp gravatar image acp  ( 2013-04-15 22:12:49 -0500 )edit

Question Tools

1 follower


Asked: 2013-04-12 02:42:07 -0500

Seen: 1,587 times

Last updated: Apr 12 '13