Skip to content

How to import a single XODR file into the CARLA simulator to make it a level or a static asset?​ #8854

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
21stCenturyGreensleeves opened this issue Apr 18, 2025 · 0 comments

Comments

@21stCenturyGreensleeves
Copy link

21stCenturyGreensleeves commented Apr 18, 2025

I want to import an XODR file(without .fbx file) into the CARLA simulator, use CARLA to Automatically generate corresponding static assets for the road network, and then use it in a level to represent roads then adding other components. However, I have encountered some issues:

**1:**I compiled the simulator locally following the latest official CARLA build documentation, so my version is likely 0.9.14 (though I'm not entirely sure). Referring to https://carla.readthedocs.io/en/0.9.7/how_to_make_a_new_map/, I added an XODR file to carla\Unreal\CarlaUE4\Content\Carla\Maps\OpenDrive and opened the existing level OpenDriveMap in the UE4 Editor under carla/maps. Then, I dragged the OpenDrive Actor into this empty level, but when I clicked "Play" I couldn't see the generated road network assets in the window. However, when I directly modified the carla\Unreal\CarlaUE4\Content\Carla\Maps\OpenDrive\OpenDriveMap.xodr file and Play Content\Carla\Maps\OpenDriveMap, I could see the imported road network's generate road network in the window. But it seems the road network generation is related to the OpenDrive Generator in the level rather than the OpenDrive Actor? For my version, is the method described in the 0.9.7 documentation correct?

**2.**I asked a classmate who previously worked on something similar, and he confirmed that his approach was to place the XODR file in PythonAPI/util/opendrive and then run PythonAPI/util/config.py -x opendrive/filename.xodr, or carry it out in the same way and with similar instructions. He was certain that after using this method, he could obtain a level/blueprint/asset (unsure which) in the UE4 Editor containing the generated road network mesh from the XODR file and then import it into another level with other elements he added, but he has forgotten the specific content of this job. I tried replicating this method, but after running the command, I could only see the loaded map in the runtime window and couldn't find any generated content in the project. It seems that the mesh of the road network is only generated during Play and not saved after it is ended, but it seems that there's a way to save the road network mesh generated as asset and then use it in other level. Can similar command actually accomplish this task?

**3.**I used the osm2xodr library to generate some XODR files. When I directly modified the XODR file using Method 1 mentioned above, simple single-road files could be displayed in CARLA, but road networks with multiple junctions failed to render correctly. What could be the possible reasons for this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant