GithubHelp home page GithubHelp logo

johschmitz / blender-driving-scenario-creator Goto Github PK

View Code? Open in Web Editor NEW
225.0 6.0 36.0 607 KB

Blender add-on for creating OpenDRIVE and OpenSCENARIO based automotive driving scenarios including 3D models

License: GNU General Public License v3.0

Python 99.80% Shell 0.20%
blender blender-addon opendrive openscenario openscenegraph fbx carla-simulator carla automotive simulation

blender-driving-scenario-creator's People

Contributors

johschmitz avatar lyfs avatar manu12121999 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

blender-driving-scenario-creator's Issues

Usability issue with not memorizing lane settings

Hello, following the previous suggestions, I also want to point a bug that I found.

When adding or removing a lane in the settings, it would just reset all the other lanes to a default setting. I then have to go over all the other lane settings again and reapply their values.

BugWithLaneSettings

When exporting, there is an error: 'NoneType' object has no attribute 'predecessor'

Hi,

I just tried the add on for Blender 2.93 and I wanted to export the following map

first_infinity_like_map.zip.

When exporting, I received the following error:

Python: Traceback (most recent call last):
File ".config/blender/2.93/scripts/addons/blender-driving-scenario-creator/export.py", line 45, in execute
self.export_openscenario(context, self.directory)
File ".config/blender/2.93/scripts/addons/blender-driving-scenario-creator/export.py", line 223, in export_openscenario
if incoming_roads[k].predecessor:
AttributeError: 'NoneType' object has no attribute 'predecessor'

location: :-1

However, some folders were created (catalogs, models, scenegraph, xodr). But the xodr folder is empty, so I guess there is a problem with the OpenDrive file generation (would also match with 'predecessor' attribute I guess?)

Would be cool, if you could have a look at that, maybe try the blender file or say, what I did wrong. That would be awesome. :)

Junctions in CARLA

Hi, is there any way of controlling junctions?

When I load the xodr to CARLA with wider roads the junctions seem to be completly broken.

image

Open designed roads in CARLA

Hi
Would you please explain how I can export the roads designed in blender driving scenario creator to Carla?
which format should I export?
I wanted to design my own road and then open it in the Carla simulator, then I wanted to add objects such as a vehicle, pedestrian, bicycle, and .. (in Carla) to generate my scenario.

how do I make a ramp?

Hi. Thanks for making and distributing a good add-on.
I'm practicing making a road with this, how do I make a ramp? Any ideas?

Missing Spiral and polynomial functions

Really impressive tool!

Are the Spiral and Polynomial functions placeholders or do they function? They are greyed out in the plug-in I have.
These can be necessary to fit the xodr standard for linking some more complex road structures together.

Generate xodr file corresponding to fbx file

Hi, I have a fbx file that I generated using 3ds Max. Can I use the blender-driving-scenario-creator to generate this fbx file corresponding to xodr file, and then import them into Carla for use?
image

Error : no module named 'scenario generation'

Hello ! I am having trouble with the installation. I do have the scenariogeneration module installed but I still have this error when I want to enable the add-on.

Traceback (most recent call last):
File "C:\Program Files (x86)\Steam\steamapps\common\Blender\3.0\scripts\modules\addon_utils.py", line 351, in enable
mod = import(module_name)
File "C:\Users\diane\AppData\Roaming\Blender Foundation\Blender\3.0\scripts\addons\blender-driving-scenario-creator_init_.py", line 19, in
from . export import DSC_OT_export
File "C:\Users\diane\AppData\Roaming\Blender Foundation\Blender\3.0\scripts\addons\blender-driving-scenario-creator\export.py", line 17, in
from scenariogeneration import xosc
ModuleNotFoundError: No module named 'scenariogeneration'

Has someone had the same error ? Thank you !

some suggestion for code

Hi, thanks for your contribution, it's a wonderful project for me, combine blender and openDrive is a genius idea!

but when i reading the code , here are some suggestion for your pro
image
The function's job is to translate the "sample points" to "Mesh", so may be we can delete the strip param in this function ? for this, we just delete none type points in "get_road_sample_points".

def get_road_vertices_edges_faces(self, road_sample_points): vertices = [] edges = [] faces = [] idx_vertex = 0 point_index = 0 while point_index < len(road_sample_points): for idx_face_strip in range(len(road_sample_points[point_index])): if not road_sample_points[point_index][0]: continue samples_right = road_sample_points[point_index + 1][idx_face_strip] samples_left = road_sample_points[point_index][idx_face_strip] num_vertices = len(samples_left) + len(samples_right) vertices += samples_right + samples_left[::-1] edges += [[idx_vertex + n, idx_vertex + n + 1] for n in range(num_vertices - 1)] \ + [[idx_vertex + num_vertices - 1, idx_vertex]] faces += [[idx_vertex + n for n in range(num_vertices)]] idx_vertex += num_vertices point_index = point_index + 2 return vertices, edges, faces

and when i want to add a solid_solid type for it, i found maybe it's better to add "s" and "t" to strip struct, because solid_solid neet 3 "t" value to create mesh (yellow line, asphalt line, yellow lin) , for this struct, i have to write this code anywhere

if strip.type_road_mark == 'solid_solid': do something

Blender with CARLA simulator

Hello @johschmitz , I am new to this openscenario and CARLA simulator, Is it possible to create a specific scenario, for example, a overtaking scenario in a two-way highway with this blender creator and to import it to CARLA for testing?

Also, just an add-on question from my side, Are there any solutions?/tools for creating concrete scenarios from functional scenarios for testing with CARLA simulator?

Playing OpenSCENARIO inside Blender

Hi! Thank you for the great software.

After I create OpenScenario (trajectories and car), I confirmed that xosc file has been created properly.
However, I want to check in the Blender layout that the scenario was created well as I expected.
Playing animation does not work so I can't check my scenario was created properly or not.
As I am new to blender, I want to know if these features are supported or not .

./pip3 failed and no module named "scenariogeneration"

System: Ubuntu 22.04
Blender 3.5

I have run ./python3.10 -m ensurepip.

It shows satisfaction, but there is no pip3 in the folder. Thus, the scenariogeneration cannot be installed by ./pip3 install scenariogeneration and the addon does not work well.

I looked for some methods to address this issue. Fortunately, I got it.

Try download install package from https://pypi.python.org/pypi/pip#downloads and use ./python[python version] setup.py install to install pip.

I share this with someone who has the same issue here.

Connection of on/off ramps to road network

Hi!
I'm using your add-on to create custom maps for CARLA. It works fine, but I'm facing some problems when connecting on and off ramps of highways to the other road network. Here is an example:

Screenshot_20240724_155207

What's the best way to connect the off ramp of the highway to a default street? When I force it to become a single lane by closing it, I cannot connect it, because it uses the former left lane (off ramp) and connects it with the right lane of the default street.

BTW: I used the option "close" when turning the double lane off ramp to a single lane street. Why is this option not available any in current releases (I used 0.21.1)?

Thanks in advance!

Make an OpenDrive .xodr based on real world map

Hello

Your tool is very useful to create OpenDrive files. I just started using the tool and have a couple of questions regarding the tool.

  1. How can i create a map based on real world. I need to create a rough road based on google map. i roughly estimated the distances from the google map. I also created a straight road but seems like i can't control the length of the road. Is there any option to adjust the length of the road after plotting it. I saw the scale option but i think its not the right one as the markings are streching while using it. Any method i am missing ?

  2. Is there any another approach rather than the distance to create a map based on google map?

  3. How to join two roads expecially a road that goes left from the main road like a cut out road from the Autobahn?

Thanks

Update the locations of the section after it is first created

Hi, I'm having trouble creating a highway entrance/exit. I would like to know if there is anything about creating the roadway by entering the exact coordinates and heading of the startpoints/endpoints, or a way to update the coordinates of the startpoints/endpoints of the road section after the first creation.

Thanks a lot.

PS. If this is not the proper channel to ask for it, I do apologize

where to download

where to download driving scenario generator release .zip archive?

List of suggestions to improve workflow

Hello, I have been working with the Driving Scenario Creator and have made a list of suggestions that can improve the workflow.

  1. I like that I can make custom roads. However, it takes a very long time to create a version of a road that exists in real life. So far, my workflow has consisted of creating the road, checking if it fits, deleting the road, changing some settings and repeat. In other words, a lot of trial and error.
    My suggestion is to have a section in the object properties menu that holds the values for the created road, which can then be changed dynamically to update it when it's already placed. This would also make changing previously placed roads possible if they need to be adjusted to fit a newer one. I believe this would speed up the process of making and connecting roads by a lot.

  2. The road presets that are given by default are a great starting point in most cases. The problem I am having is that sometimes I would need one or a few settings that are different from the preset, which I need to use more than once. It would be nice to be able to save my own presets and maybe edit and delete them as well.

  3. Three great additions to the broken line setting would be:

  • a length value for when shorter broken lines are needed
  • a shift value. This removes the problem of when two roads that are connecting could also make a double-length broken white line.
  • a solid broken and broken solid line setting to allow cars to pass on only one side of the road.
  1. Roads that can be made using a curve with adjustable handles. In addition to that, the ability to rework this kind of road after it is placed down would make it even better.

Thank you!

CARLA map import experience

Hello,

Since several issues refer to this task (#21, #14, #4), I thought writing about my experience here would be useful. I ran both tools on Windows. Here was the process:

  • From the current latest version of this tool (0.17.2), I created a 4 way junction. I was able to snap straight roads easily to the junction polygon.
  • I used the eye icon on the right side menu (the outliner menu in Blender) to hide the junction_connecting_road elements. This is because no fbx is generated for these connecting roads and the CARLA map import had an issue with that. I don't think this affects the connecting roads in the OpenDRIVE file.
  • I chose the fbx import option. An opendrive is also generated when the export button of this tool is clicked.
  • I had CARLA installed, built from source on Windows. I added copies of the fbx file and the opendrive file in the Import folder in CARLA. I renamed both files to be the same name.
  • I ran make import from the CARLA project directory. It did not give any error. It creates a map_package directory in the <CARLA project folder>/Unreal/CarlaUE4/Content directory.
  • I started CARLA by running make launch from the CARLA project directory. Clicked the play button on Unreal Engine to start the server.
  • I opened another console and in the <CARLA project folder>/PythonAPI/util directory, I ran the config.py script using the following command: python config.py --map <map name> This is the same map name of the fbx and opendrive from earlier. This reloaded the scene with the imported map with lane markings. I also ran /PythonAPI/examples/generate_traffic.py to test simulation capability and it worked.

Here are the outputs on Blender and CARLA:

blender-intersection
unreal-blender-intersection

An OpenDRIVE file importer for Blender

Hello,

Using a parser for OpenDRIVE and its capability to generate .obj files, I was able to create an OpenDRIVE importer for Blender. I separated the .obj files for multiple elements so that each can have a different material applied to them. Currently, it's just the base road mesh and road markings. Luckily, all the imported meshes seem to have the same origin so no transformations are needed. Once the .obj files are brought in, I can apply materials and create a hierarchy for the meshes.

We can completely run the process without opening the Blender GUI to go from OpenDRIVE to FBX using the command blender --background --python <scriptname.py> -- <path to .obj 1> <path to .obj 2> <path to fbx output>. This can be combined with the steps mentioned in #23 to bring generated maps into CARLA if needed.

pip's dependency resolver error

When executing sudo -E ./pip3 install scenariogeneration I get the follwing error:

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
ipympl 0.9.3 requires matplotlib<4,>=3.4.0, which is not installed.
ipympl 0.9.3 requires pillow, which is not installed.
fmpy 0.3.15 requires attrs, which is not installed.
fmpy 0.3.15 requires lark, which is not installed.
fmpy 0.3.15 requires lxml, which is not installed.
fmpy 0.3.15 requires pytz, which is not installed.

I just executed it again and this time, no errors popped up. Is this normal behavior?

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

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!

Is OpenCRG on the roadmap?

Is it on the roadmap to also be able to model and export OpenCRG data alongside the OpenDRIVE? This would enable to build more detailed 3D models of the road surface for sensor simulation while also enabling a consistent vehicle dynamics simulation.

ModuleNotFoundError: No module named 'lib2to3' when enabling the add-on on blender

Hi, I get the following error when trying to enable the blender-driving-scenario-creator add-on.
Here some remarks for reproducing the error. It would be great if you could help me with this issue.

Operating System Ubuntu 18.04.6 LTS
Step where the problem occurs: Add-on (Linux and Windows)
Blender version: Blender 3.2.2
Notes: I tried installing blender both under /opt and under my home and nothing changed
Printout when trying to enable the add-on:

Read prefs: /home/aaa/.config/blender/3.2/config/userpref.blend
Traceback (most recent call last):
  File "/home/aaa/blender-3/3.2/scripts/modules/addon_utils.py", line 335, in enable
    mod = __import__(module_name)
  File "/home/aaa/.config/blender/3.2/scripts/addons/blender-driving-scenario-creator/__init__.py", line 19, in <module>
    from . export import DSC_OT_export
  File "/home/aaa/.config/blender/3.2/scripts/addons/blender-driving-scenario-creator/export.py", line 17, in <module>
    from scenariogeneration import xosc
  File "/home/aaa/blender-3/3.2/python/lib/python3.10/site-packages/scenariogeneration/__init__.py", line 7, in <module>
    from .esmini_runner import *
  File "/home/aaa/blender-3/3.2/python/lib/python3.10/site-packages/scenariogeneration/esmini_runner.py", line 15, in <module>
    from .xodr import OpenDrive
  File "/home/aaa/blender-3/3.2/python/lib/python3.10/site-packages/scenariogeneration/xodr/__init__.py", line 11, in <module>
    from .signals_objects import *
  File "/home/aaa/blender-3/3.2/python/lib/python3.10/site-packages/scenariogeneration/xodr/signals_objects.py", line 12, in <module>
    from lib2to3.pytree import convert
ModuleNotFoundError: No module named 'lib2to3'

I tried to install it with ./python3.10 -m pip install 2to3 in /home/aaa/blender-3/3.2/python/bin but I didn't notice any improvements.

Thanks

Procedure to automatically add roads on a set of curves

Hi, I don't know if it could be considered an issue but I was wondering if there is any suggestion on how to
automatically add OpenDrive roads on a set of curves (eventually imported from OSM) directly in Blender.

Thanks a lot.

PS. If this is not the proper channel to ask for it, I do apologize

Import of OpenDRIVE files

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

Locked objects

Hi,

Some of the objects are locked for me. Are they implemented or not?
image

Thanks

Show road lines and textures in CARLA

Hello :)

I am quite new to this, and I am curious is it possible to show road lines when I import the .xodr map file into CARLA simulator.

This is what I get in CARLA:

carla

And this is what I get in esmini:

esmini

Thank you :)

wrong snap point

Hello,
I found a problem. As shown in the figure when I use multiple lanes to reduce lanes, the connection snap point of the rear lanes is incorrect , and the connection is not continuous.
image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.