how can I set the position of my robot on a openstreet map in order to use move base?

asked 2014-04-16 07:37:10 -0600

jules gravatar image

updated 2014-04-18 10:15:38 -0600

Hello, I'm a student (novice with ROS) and I need to set the position of my robot on a map which I took from OpenStreetMap. I can see this map on Rviz and I visualize the displacement of my robot thanks to the GPS data via the package GPS common. Now I have 2 tf trees : one until the odom frame and the second for the map to local_map generated by openstreepmap.

I have to connect these 2 together but I don't know how. I have tried with gmapping but the problem was to give the exact position of my robot on the local_map. Thank you for your help!!

edit retag flag offensive close merge delete


Have you tried to use [amcl](

AbuIbra gravatar image AbuIbra  ( 2014-04-18 16:41:28 -0600 )edit

In fact, I try to use move base on a map generated by openstreetmap. According to me, AMCL can't initialize the position of my robot on this map. The goal of my project is to move via move base and to create a second map via gmapping in order to visualize obstacles on the openstreetmap. I used gmapping in same time with move base and the link betweem the 2 frames (one for the robot and the other for the generated map) was done but I was unable to set the initial position of my robot on the map. I don't know if It's easy to understand but I search a way to link these 2 frames and to initialize the position. Thank you very much ! My 2 tf trees are : 1) sensors-->base_link-->base_footprint-->odom 2) local_map-->map I had via gmapping : sensors-->base_link-->base_footprint-->odom-- ...(more)

jules gravatar image jules  ( 2014-04-18 23:27:55 -0600 )edit

Is "/local_map" the frame of the map created by GMapping? And if so tell me how /local_map and /map are linked? is local_map-->map link something you can choose freely? If you answer those two questions, I think I have a good idea for you

AbuIbra gravatar image AbuIbra  ( 2014-04-20 06:23:50 -0600 )edit

In fact, I didn't use GMapping to create the frame "/local_map". I Uploaded a map from openstreetmap ( and I used the package "osm_cartography" to show the map on rviz. The launch file used to see the map :

jules gravatar image jules  ( 2014-04-20 07:25:51 -0600 )edit

launch file : <launch> <arg name="url" default="package://osm_cartography/tests/maprobot.osm"/> <node pkg="tf" type="static_transform_publisher" name="local_map_tf" args="598022.3 5633435.3 0 0 0 0 1 map local_map 100"/> <node pkg="osm_cartography" type="osm_server" name="osm_server"/> <node pkg="osm_cartography" type="viz_osm" name="viz_osm"> </node> </launch>

jules gravatar image jules  ( 2014-04-20 07:26:20 -0600 )edit

So, I have to create a link between the frame "/map" and "/local_map" in order to see the generated map on rviz (frame=local_map). I hope that is better explained.

jules gravatar image jules  ( 2014-04-20 07:28:58 -0600 )edit