Using OSM map in Carla does not provide acutal longitude and latitude

Hi all,
I followed “Generate maps with OpenStreetMap” section to export osm from OpenstreetMap. Then i converted osm to OpenDrive format xodr. Lastly, I used python3 --osm-file=/path/to/OSM/file to import into carla.

As I run Carla, I print out the latitude and longitude given by Carla(gnss_sensor), and the positions are not the same as in OpenstreetMap.

My questions are as follow:

  1. Do I need to do offset/conversion (converting Carla gnss_sensor position to OpenStreetMap position)?
  2. If yes, how?

Thanks in advance.


Hi Sam:
You will have to check if the xodr file has Georeference defined. OSM files don’t come with Georeference marker included - and I don’t think the CARLA converter translates if there is one. I might be wrong about this - but just my initial assessment. I have had similar issues with OpenDRIVE xodr files (not converted) where the gnss_sensor worked, but always started with lat=0,long=0. After adding Georeference to the xodr file, it worked fine. See more on OpenDRIVE 1.4 specification for details on Georeferencing. Also, see some discussion on Github for issue#1264.

Hi svanimisetti,
thanks for your reply. you are right, xodr doesn’t have georeference!