Gazebo | Ignition | Community
Ask Your Question

OSM/Google Maps with Gazebo

asked 2015-06-23 23:52:59 -0500

karthikj219 gravatar image


Is there a way to import street views from Open Street Maps/Google Maps to use as a Gazebo world file? I'm working on a simulator for an autonomous car, and this would be really helpful!

Thanks in advance.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2015-06-27 20:58:59 -0500

l0g1x gravatar image

updated 2015-06-29 14:37:06 -0500

You can view my fork here: of tashwins gazeboosm fork (she had unmerged changes into upstream).

I currently took out everything except roads as I have a similar need. I also changed the texture of the road to a simple color for now as the default road texture with lines did not visually merge nicely at intersections, junctions, etc.. It also seems that the osmapi does not give osm node data only from within the boundary box specified. I fixed this and now the outFile.sdf loads alot quicker (within 1 second for me).

Working on it now, so hopefully by tonight ill implement a cubic hermite spline to be applied to the roads/road interections/road junctions to make the roads alot smoother. However, i think this should be done from within the gazebo source for But maybe it might be better to already supply smoother points from a higher level (like gazebo_osm)

EDIT: I should also mention that the option of using data from google maps i think is out of the question as it is in their terms of service agreement. Reference here:

EDIT2: (June 29th) So i have made some progress with implementing a hermite spline to an individual road, however its not perfect and theres still a couple of bugs, but they dont affect the generation of the world file, just the output of the roads once you launch the world has few hickups; primary one being checking if a road contains at least 3 points so that a spline can be applied. Im just learning about splines, but i have a good grasp on it after working on it for past couple of days and reading couple books. Hopefully the ticket to revive the package gets bumped so there is more support for osm with gazebo.

edit flag offensive delete link more


Thanks a lot for your answer! Will try out your edited version of the gazebo_osm library and get back to you.

karthikj219 gravatar imagekarthikj219 ( 2015-06-29 05:36:56 -0500 )edit

So, I tried using your edited version of the library, and the default map is working just fine. However, on entering custom latitude/longitude (via interactive mode of the python program), I get an error that says "could not create datasource for type osm".

karthikj219 gravatar imagekarthikj219 ( 2015-06-30 02:21:01 -0500 )edit

sorry, forgot to mention that i disabled some feature to make debugging faster. either you can uncomment the stuff for custom boundaries, or manually download a .osm and load that.

l0g1x gravatar imagel0g1x ( 2015-06-30 19:17:50 -0500 )edit

Your edited version of the library is giving me an empty world in gazebo when I take the input as a manually downloaded .osm file. I tried uncommenting the custom boundaries stuff too, but no difference. I checked both outFiles, and couldn't find any difference either.

karthikj219 gravatar imagekarthikj219 ( 2015-07-01 06:08:39 -0500 )edit

Try this command to just see if its working ./ -O testFiles/map1.osm i pulled fresh from the repo and it works for me. Im going to make a simple interactive gui to make things easier to use, rather then command line arguements.

l0g1x gravatar imagel0g1x ( 2015-07-01 18:54:37 -0500 )edit

answered 2015-06-25 11:15:07 -0500

scpeters gravatar image

We have a tool in a branch, but it hasn't been merged yet. Please vote for the this issue.

edit flag offensive delete link more


So, I tried running the file under tkhurana's library in interactive mode, so as to enter some custom Latitude/Longitude data. I get an error that says "could not create datasource", but the default map generates just fine. Any ideas as to what am I missing?

karthikj219 gravatar imagekarthikj219 ( 2015-06-26 03:46:33 -0500 )edit

Question Tools

1 follower


Asked: 2015-06-23 23:52:59 -0500

Seen: 5,867 times

Last updated: Jun 29 '15