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

Import of OpenDRIVE files #5

Open kargarisaac opened 2 years ago

kargarisaac commented 2 years ago

Hi,

Thank you for the great software. I wonder if it is possible to import pre-existing opendrive maps and then edit them or define a scenario on that?

Thank you

johschmitz commented 2 years ago

@kargarisaac Thanks for the interest. In theory it is possible to write an importer. Currently this is on my agenda with a very low priority though because it will be a lot of work and there are so many other things I want to try frst. It will also require a lot of refactoring/rewriting work since I did not optimize the architecture for the import use-case so far. So maybe I will work on this in the future.

fangchaooo commented 2 years ago

Thanks for @johschmitz work! I want to know how to import opendrive map, Maybe I can do some work for it. I need this feature.

johschmitz commented 2 years ago

@fangchaooo thanks for the interest. If you want we could have a video call to do some brainstorming on this. You should be able to find my email address in my profile.

johschmitz commented 2 years ago

@fangchaooo I thought about this again and my idea would be that the first thing to be implemented would be an xodr_reader class/method for the scenariogeneration library. Currently I think there is only an xosc_reader implemented. I would then use this reader as the basis. I would not try to implement the low level reading in the add-on code but rather contribute to the library and then use it in here.

ClemensLinnhoff commented 1 year ago

Any progress on this issue? This would be a really great feature!

johschmitz commented 1 year ago

@ClemensLinnhoff there's some news in #27 but I guess that is not really what you want. I assume you would like to import and then modify. This is a really much more difficult problem to solve since you have to support all kinds of OpenDRIVE files. However, my code assumes only one way and then the export becomes more or less straightforward but the import will then only work some special cases. You could compare this to the problem of importing and editing a PDF file which is notoriously difficult. For example if the imported file contains a road with a "mixed" geometry (line, arc, clothoid) that will currently not work at all since there is no "internal" logic to map this to, since I am currently not using this feature. In my opinion this whole issue arises since it never has been an official goal of the OpenDRIVE format (standardization) to close this round-trip write-read-edit-write kind of loop. So it was just not designed with simplifying that use-case easy in mind. So essentially without one or more full-time developers or at least one more hobby developer focusing only on this topic, I don't see this happening anytime soon. This is except maybe for an experimental implementation working for some simple cases which will annoy people more than make them happy when error messages with unsupported features pop up all the time or they have gaps in the road. Also when looking at some very expensive commercial tools you will see that even there it doesn't work perfectly all the time, due to above mentioned legacy of the standard. I hope that this situation will be improved in OpenDRIVE 2.0 if it ever happens.