Updated function naming.
This commit is contained in:
parent
4016cb2cc1
commit
6d56aa843f
|
@ -34,7 +34,7 @@ __1.6. Click the `Export` button__ in the __Export__ pannel, and save the map in
|
|||
|
||||
CARLA can read a XML file generated with OpenStreetMaps, and convert it to OpenDRIVE format that can be ingested as a CARLA map. This can be done through the PythonAPI using the following classes.
|
||||
|
||||
* __[carla.osm2odr](python_api.md#carla.osm2odr)__ – The class that does the conversion. It takes the content of the `.osm` parsed as strind, and returns a string containing the resulting `.xodr`.
|
||||
* __[carla.Osm2Odr](python_api.md#carla.Osm2Odr)__ – The class that does the conversion. It takes the content of the `.osm` parsed as strind, and returns a string containing the resulting `.xodr`.
|
||||
* `osm_file` — The content of the initial `.osm` file parsed as string.
|
||||
* `settings` — A [carla.Osm2OdrSettings](python_api.md#carla.Osm2OdrSettings) object containing the settings to parameterize the conversion.
|
||||
* __[carla.Osm2OdrSettings](python_api.md#carla.Osm2OdrSettings)__ – Helper class that contains different parameters used during the conversion.
|
||||
|
@ -55,7 +55,7 @@ f.close()
|
|||
# Define the desired settings. In this case, default values.
|
||||
settings = carla.Osm2OdrSettings()
|
||||
# Convert to .xodr
|
||||
xodr_data = carla.osm2odr.convert(osm_data, settings)
|
||||
xodr_data = carla.Osm2Odr.convert(osm_data, settings)
|
||||
|
||||
# save opendrive file
|
||||
f = open("path/to/output/file", 'w')
|
||||
|
|
|
@ -32,7 +32,7 @@ void export_osm2odr() {
|
|||
.def(self_ns::str(self_ns::self))
|
||||
;
|
||||
|
||||
class_<OSM2ODR>("osm2odr", no_init)
|
||||
class_<OSM2ODR>("Osm2Odr", no_init)
|
||||
.def("convert", &ConvertOSMToOpenDRIVE, (arg("osm_file"), arg("settings") = OSM2ODRSettings()))
|
||||
.staticmethod("convert")
|
||||
;
|
||||
|
|
|
@ -236,7 +236,7 @@ def main():
|
|||
print('file could not be readed.')
|
||||
sys.exit()
|
||||
print('Converting OSM data to opendrive')
|
||||
xodr_data = carla.osm2odr.convert(data)
|
||||
xodr_data = carla.Osm2Odr.convert(data)
|
||||
print('load opendrive map.')
|
||||
vertex_distance = 2.0 # in meters
|
||||
max_road_length = 500.0 # in meters
|
||||
|
|
Loading…
Reference in New Issue