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

robot initial localization

asked 2012-07-16 23:00:17 -0500

viking gravatar image

Hi, every one, I have build a map with Pioneer robot P3AT now, and the navigation node alse seems run well. But there is one question: How to initial localize the robot in the map?

That is to say, the problem of "global localization", after we fire up the navigation node, we have to localize robot in map accoring to the laser reading, this is not a problem while running with stage, because we can always set the position of robot in *.world and *.yaml exactly same. But, if run with a real robot, it's almost impossible to put the robot at an exactly correct position according to what we have set in *.yaml.

In the toolbar of rviz, there have a button says "2D Pose Estimate", but I don't think it's what I'm finding, because it's just put robot at the position where mouse click, I guess it's just initialize the particle filter used in amcl, but not sure for this.

Dose anyone have suggestion for this? Or is there exist a implemented answer for this in ROS ?


edit retag flag offensive close merge delete


Do you found any solution yet?

achmad_fathoni gravatar image achmad_fathoni  ( 2018-06-18 08:32:10 -0500 )edit

3 Answers

Sort by ยป oldest newest most voted

answered 2012-07-17 02:57:33 -0500

viking gravatar image

updated 2012-07-17 03:00:45 -0500

To test the global_localization in amcl suggest by Stephan, I have launch a navigation task work with stage, which was configured according to navigation node, and just modify the map to one built by myself. After start up, the laser scan and obstacle in rviz fixed very well. But, once I run global_localization by type:

rosservice call /global_localization

I can see blow output in terminator which roslaungh run:

[ INFO] [1342528758.779217076, 70.900000000]: Initializing with uniform distribution
[ INFO] [1342528758.808788272, 70.900000000]: Global initialisation done!

But the position of robot have change very much, and the laser scan doesn't fix with obstacle any more!

Is there something I have missed? Dose global_localization works well on your side?

(Because the karma is too low, I can't upload the screenshot of ros running now, sorry for this >_< )

edit flag offensive delete link more

answered 2012-07-16 23:13:27 -0500

michikarg gravatar image

Why do you need to localize your robot for map building? Usually you can build a 2D gridmap with GMapping using only odometry information and controlling the robot using a joystick or keyboard...

edit flag offensive delete link more


e, may be I have not say it clearly, I wanna to localize while beginning navigation, the map building is not a problem

viking gravatar image viking  ( 2012-07-16 23:33:25 -0500 )edit

answered 2012-07-16 23:26:53 -0500

Stephan gravatar image

If you use amcl, try calling it's service for global localization:

rosservice call amcl_node/global_localization
edit flag offensive delete link more


OK ,thanks, I'll try it

viking gravatar image viking  ( 2012-07-16 23:34:01 -0500 )edit

I have try it, but the result become even more bad. Please see the answer post by myself below, thanks

viking gravatar image viking  ( 2012-07-17 02:58:24 -0500 )edit

Question Tools


Asked: 2012-07-16 23:00:17 -0500

Seen: 3,055 times

Last updated: Jul 17 '12