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

how to localize my robot

asked 2016-02-21 10:39:08 -0500

David John gravatar image

Hi all, I used gmapping to obtain the map.Now i want to localize my robot in this map,so that i can apply my path planning algorithm(A*).someone please help me to do this.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2016-02-22 06:36:38 -0500

donmrsir gravatar image

Hi!

First, i think that the package gmapping already does the localization for you, since gmapping is design to work with SLAM (Simulataneos localization and mapping), you can check this in the wiki http://wiki.ros.org/gmapping. If your robot is not being localized maybe you should check your tf tree, and make sure that there is a transformation between the frame /odom (the one where gmapping "publish" the localization information), and the base frame of your robot (by default should be /base_link and it should be connected, at the same time, to the other parts of your robot).

Anyway if you are searching for packages in ROS to perform the localization, the amcl package http://wiki.ros.org/amcl, is one option.

Hope this helps!

edit flag offensive delete link more

Comments

thank you...i went through this tutorials.i applied this to turtlebot rosrun amcl amcl but it is showing that request for map failed.

David John gravatar image David John  ( 2016-02-25 00:12:12 -0500 )edit

If you are you using gmapping, try set the param "use_map_topic" to true, this way the amcl node will read the information from the topic /map published by gmapping. To do this adding the following line in your launch should be enough:

 <param name="use_map_topic " value="true" />
donmrsir gravatar image donmrsir  ( 2016-02-25 03:38:12 -0500 )edit

Or if you want to do a rosrun directly this should work:

rosrun amcl amcl _use_map_topic:=true
donmrsir gravatar image donmrsir  ( 2016-02-25 03:39:45 -0500 )edit

I did rosrun amcl amcl _use_map_topic:=true. I got map also but how can i find the grid in which the robot resides so that i can apply my A* algorithm.

David John gravatar image David John  ( 2016-02-25 04:23:07 -0500 )edit

As you can see in the wiki documentation, the map is published in the /map topic, in the type of message Occupancy grid, while the pose of the robots is published in the topics /amcl_pose.

donmrsir gravatar image donmrsir  ( 2016-02-25 04:57:28 -0500 )edit

You should then, just subscribe/publish to that topics and use that information, for that the following tutorial could help you. Tutorial

donmrsir gravatar image donmrsir  ( 2016-02-25 04:59:02 -0500 )edit

thank you sir..But when i do the same i'm getting the x,y coordinates of the robot in its current position. I want to know the index of the grid in which the robot is situated in the map so that I can apply my A* algorithm. Could you please help me to solve this problem.?

David John gravatar image David John  ( 2016-02-25 06:44:17 -0500 )edit

Hi! Right now i am not quite sure about how to exactly doing that. What i know is that gmapping publish a map in the format of a occupancygrid msg see the msg documentation.

donmrsir gravatar image donmrsir  ( 2016-02-25 06:59:00 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2016-02-21 10:39:08 -0500

Seen: 716 times

Last updated: Feb 22 '16