Giter VIP home page Giter VIP logo

gazebo_osm's Introduction

OSM Plug-in for Gazebo

Author: Tashwin Khurana

Version: 1.0

Description: Open Street Maps plugin for Gazebo
             This folder contains files for building osm_plugin for gazebo simulator.

Dependencies:

Python 2.7

Mapnik:

sudo apt-get install -y python-software-properties

sudo add-apt-repository ppa:mapnik/v2.2.0

sudo apt-get update

sudo apt-get install libmapnik libmapnik-dev mapnik-utils python-mapnik

Files:

osm2dict.py

Collects data about certain types of roads based on input coordinates from osm database and converts the information received to format that can be used to build sdf files.

dict2sdf.py

Used to build sdf file from data received about the elements in the sdf format. 
functionality: 
	add models to world, 
	add road element, 
	set road width, 
	add points to the road element

getMapImage.py

   Gets the image of the area required to be simulated.

getOsmFile.py

   Downloads the osm database of the specified area.

gz_osm.py

   Command line compatible program which combine the functionality of all the above classes and functions to output the .sdf file for gazebo. 

usage: gz_osm.py [-h] [-f OUTFILE] [-o OSMFILE] [-O INPUTOSMFILE]
                 [-i IMAGEFILE] [-d DIRECTORY]
                 [-B [BOUNDINGBOX [BOUNDINGBOX ...]]] [-r] [-m] [-b] [-a]
                 [--interactive]

optional arguments:
  -h, --help            show this help message and exit
  -f OUTFILE, --outFile OUTFILE
                        Output file name
  -o OSMFILE, --osmFile OSMFILE
                        Name of the osm file generated
  -O INPUTOSMFILE, --inputOsmFile INPUTOSMFILE
                        Name of the Input osm file
  -i IMAGEFILE, --imageFile IMAGEFILE
                        Generate and name .png image of the selected areas
  -d DIRECTORY, --directory DIRECTORY
                        Output directory
  -B [BOUNDINGBOX [BOUNDINGBOX ...]], --boundingbox [BOUNDINGBOX [BOUNDINGBOX ...]]
                        Give the bounding box for the area Format: MinLon
                        MinLat MaxLon MaxLat
  -r, --roads           Display Roads
  -m, --models          Display models
  -b, --buildings       Display buildings
  -a, --displayAll      Display roads and models
  --interactive         Starts the interactive version of the program

Test files:

Unit testing for each of the source files is provided in the testfiles/ folder.

Usage:

Run gz_osm.py file

	$ python gz_osm.py 

            or 

            $ ./gz_osm.py [-h] [-f OUTFILE] [-o OSMFILE] [-i IMAGEFILE] [-d DIRECTORY]
                 [-B [BOUNDINGBOX [BOUNDINGBOX ...]]] [-r] [-m] [-b] [-a][--interactive]

Output file: outFile.sdf (default)

Check the file on gazebo
	gazebo outFile.sdf

gazebo_osm's People

Contributors

caguero avatar scpeters avatar tashwin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gazebo_osm's Issues

<road> has no element <texture>

Just simply using the gz_osm.py with default value, the SDF is produced with road elements, which have a non-existent sub element , like so:

<road name="footway_87383624">
      <texture>footway</texture>
      <width>0.3</width>
      <point>80.8064537091 -127.894211004 0.0</point>
      <point>65.8062953159 -130.038706459 0.0</point>
</road>

I believe it should be instead of as defined here: http://sdformat.org/spec?ver=1.5&elem=world#world_road and example here: https://bitbucket.org/osrf/gazebo/src/3e1e86e456efae91240b61a42238e437ab07bdad/worlds/road_textures.world?at=default

When loading it into gazebo theres a warning from parser.cc stating as well:

Warning [parser.cc:713] XML Element[texture], child of element[road] not defined in SDF. Ignoring[texture]. You may have an incorrect SDF file, or an sdformat version that doesn't support this element.
Warning [parser.cc:713] XML Element[texture], child of element[road] not defined in SDF. Ignoring[texture]. You may have an incorrect SDF file, or an sdformat version that doesn't support this element.
Warning [parser.cc:713] XML Element[texture], child of element[road] not defined in SDF. Ignoring[texture]. You may have an incorrect SDF file, or an sdformat version that doesn't support this element.

My question is, how are the road texture images still showing?

Elevation data on road

In sdf file, road elements have points and all points have z axis value default 0.0. As known osm does not provide elevation data. Is there any possibilities to obtain z axis values to points?

converting osm to sdf

hi
I want to convert a osm map, but it doesn't work

 ./gz_osm.py -O map.osm 
Downloading the osm data ... 
Elapsed time is 0.159263849258 seconds.
Extracting the map data for gazebo ...
Traceback (most recent call last):
  File "./gz_osm.py", line 175, in <module>
    roadPointWidthMap, modelPoseMap, buildingLocationMap = osmRoads.getMapDetails()
  File "source/osm2dict.py", line 308, in getMapDetails
    self.getModelDetails()
  File "source/osm2dict.py", line 195, in getModelDetails
    modelLocation = self.getPoints(coords)
  File "source/osm2dict.py", line 107, in getPoints
    dLat = lat2-np.radians(self.latStart)
TypeError: Not implemented for this type

Footway layout

I have been having issues with respect to layout of the footways.

I have added some screenshots from the actual map, and the gazebo simulator along with the sdf file generated in gist.

https://gist.github.com/Tashwin/f0cb1c41354d382eecfe

I think it has to do with the sorting and ordering of the points.

You can also regenerate these results by simply running gz_osm without any input arguments. (i.e., $ ./gz_osm)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.