-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
Thanks for your contributions!
I got a problem,after I get the osm file, I want to convert it to opendrive, but I get the error 'No nodes loaded'
.
How to fix it. Any information helps.
My conversion code is as follows:
import io
import carla
import os
# Set PROJ_LIB environment variable
os.environ['PROJ_LIB'] = r'D:\Downloads\Software\Anaconda3\envs\scene\Lib\site-packages\pyproj\proj_dir\share\proj'
# Verify PROJ_LIB
if not os.path.exists(os.environ['PROJ_LIB']):
raise FileNotFoundError(f"PROJ_LIB path does not exist: {os.environ['PROJ_LIB']}")
osm = "./singapore-onenorth.osm"
f = open(osm, 'r')
osm_data = f.read()
f.close()
# Define the desired settings. In this case, default values.
settings = carla.Osm2OdrSettings()
# Convert to .xodr
print(len(osm_data), settings)
xodr_data = carla.Osm2Odr.convert(osm_data, settings)
# save opendrive file
f = open(osm.split("/")[-1].replace("osm", "xodr"), 'w')
f.write(xodr_data)
f.close()
Metadata
Metadata
Assignees
Labels
No labels