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

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

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 -0600 )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 -0600 )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 -0600 )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 -0600 )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 -0600 )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 -0600 )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 -0600 )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 -0600 )edit

Question Tools

1 follower

Stats

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

Seen: 742 times

Last updated: Feb 22 '16