johschmitz / blender-driving-scenario-creator

Blender add-on for creating OpenDRIVE and OpenSCENARIO based automotive driving scenarios including 3D models
GNU General Public License v3.0
232 stars 36 forks source link

Converting the .xodr file with junctions generated by the plugin to .net.xml for "Simulation of Urban MObility" (SUMO). #38

Closed msunkaradtt closed 1 month ago

msunkaradtt commented 2 months ago

Hello,

I'm currently using your plugin to design a road network for one of our use cases. However, I encountered a bug after exporting the project using the plugin's export option. The problem arises with the exported .xodr file when converting it to a .net.xml using netconvert (a SUMO tool). This issue only occurs when I add a junction to the network. I've attached screenshots below to illustrate the steps for reproducing the issue.

Note: I am using the latest release of both tools.

Network created in the blender with a junction

Screenshot from 2024-09-09 22-15-11

Converting the .xodr file to .net.xml

Screenshot from 2024-09-09 22-17-19

After reverse engineering, I discovered that the issue is caused by the predecessor and successor XML tags within the link XML tags.

An example of a predecessor and successor inside a link tag

Screenshot from 2024-09-09 22-21-06

Issue/Bug

As the log indicates, the id attribute used with the predecessor and successor tags should be of type string int rather than string float.

Temporary Workaround

Therefore, to resolve the issue, simply replace all occurrences of the predecessor and successor tag IDs with a string int, as shown in the image below:

Screenshot from 2024-09-09 22-21-23

By following these steps, you should be able to resolve the issue and successfully convert the file as shown below:

Screenshot from 2024-09-09 22-22-32

Thanks in advance! Happy coding!

johschmitz commented 2 months ago

Note for later: I/we need to check if this bug is in the add-on code or in the scenariogeneration lib it uses in the background.

johschmitz commented 2 months ago

image

@msunkaradtt this seems to be a bug in https://github.com/pyoscx/scenariogeneration could you open another issue there and link back to this issue here? I think they are missing an int() somewhere. I can then also add information to that issue if needed.

msunkaradtt commented 2 months ago

Hello @johschmitz ,

Thank you for your prompt response and attention to the matter. I have created an issue and linked it to this one as requested.

johschmitz commented 1 month ago

@msunkaradtt can you confirm that this is fixed when using the latest version of both the addon and the scenariogenertion library?

msunkaradtt commented 1 month ago

@johschmitz I checked the new versions of the addon and library today, and I can confirm that the bug is fixed. I am also attaching a screenshot for your verification.

However, I want to highlight that even though the changes have been merged into the scenariogenertion library main branch, the current version of the library, when reinstalled with pip, still lacks these updates. I had to install it by pulling the source instead.

Could you please ask the author of the library to release a new version that includes these changes?

Thank you!

Screenshot 2024-10-25 165317

johschmitz commented 1 month ago

Thanks for the confirmation, I think you can tell that it works and ask that yourself in the other issue. I'm sure they are eventually going to do another release but I have no direct influence on that