- QGIS OpenSCENARIO Generation Plugin
- Python 3.6
- QGIS 3
- CARLA AD Map plugin version 2.4.5 and above
- CARLA (Version >= 0.9.10)
- CARLA Scenario Runner
Python packages can be installed using the supplied requirements.txt
by:
pip3 install --user -r /path/to/requirements.txt
-
Download the repo as a zip file in GitHub (
Code > Download ZIP
). -
Run QGIS 3.
-
Install plugin from plugins menu (
Plugins > Manage and Install Plugins > Install from ZIP
), choose the zip file that was previously downloaded.Note: If CARLA AD Map plugin has not been installed before, same steps can be used to install the ZIP package.
- Change to
Installed
tab and make sureOpenSCENARIO Editor Toolkit
is enabled. - Enjoy!
- Place entiites onto loaded OpenDRIVE map (through AD Map plugin)
- Specity start and stop triggers for maneuvers
- Add maneuvers to entities
- Add global maneuvers
- Current support for traffic light actions only
- Set initial environment variables (cloud state, time of day, precipitation)
- When map is unloaded and reloaded with AD Map Access, exporting scenarios might not work
For the full support list, visit OpenSCENARIO Tags Support
✅ - Supported
❌ - Not supported
Description | Support | Notes |
---|---|---|
Time of day | ✅ | Includes enabling animation of time |
Cloud state | ✅ | |
Fog visual range | ✅ | |
Sun | ✅ | Includes intensity, azimuth, elevation |
Precipitation | ✅ | Includes precipitation type and intensity |
Description | Support | Notes |
---|---|---|
Spawn with World Position | ✅ | |
Set initial speed | ✅ | |
Set orientation | ✅ | Can either use lane heading, or manually specified |
Set as ego vehicle | ✅ | Only for vehicles |
Agent selection | ✅ | Only for ego vehicles (manual_control will require manually changing Ego_1 tag to hero ) |
Agent parameter overrides | ❌ | Only for ego vehicles (overriding throttle, brake, clutch, parking brake, steering, gear) |
Description | Support | Notes |
---|---|---|
Spawn with World Position | ✅ | |
Set object type | ✅ | |
Set object mass | ✅ | |
Set orientation | ✅ | Can either use lane heading, or manually specified |
Enable/Disable physics | ✅ |
Description | Support | Notes |
---|---|---|
Running stop test | ✅ | |
Running red light test | ✅ | |
Wrong lane test | ✅ | |
On sidewalk test | ✅ | |
Keep lane test | ✅ | |
Collision test | ✅ | |
Driven distance test | ✅ |
Description | Support | Notes |
---|---|---|
Waypoints | ✅ | |
Longitudinal | ✅ | |
Lateral | ✅ | |
Synchronize Action | ❌ | |
Teleport Action | ❌ |
Description | Support | Notes |
---|---|---|
Environment | ❌ | |
Infrastructure Action | ✅ | Traffic light signal control |
- Open OpenDRIVE map using CARLA AD Map plugin
- Click on 'Edit environment' button to load dock widget.
- Edit parameters in dock widget to desired parameters.
- Press on 'Apply'
Note: To change environment settings, simply adjust the parameters and press 'Apply' again. Previous environment settings will be cleared and replaced with the updated ones.
- Click on 'Add vehicles' button to load dock widget.
- Choose parameters (vehicle type, use lane heading / manually specify, initial speed)
- Agent selection is only enabled for Ego vehicles. You can also specify your own agent.
-
Press on 'Insert', mouse pointer will change to cross-type pointer.
-
Click on desired map position to spawn vehicle.
-
If click point contains multiple lanes and 'Use lane heading' is checked, a dialog box will appear and ask to select lane ID to use for lane heading.
-
If click point contains lanes with multiple elevations, a dialog box will appear and ask to select the desired elevation.
Note: Sometimes there will be a "Click point too far from lane" error. Try choosing a different elevation.
Note: Currently you can insert vehicle one at a time.
Note: You can toggle labels on and off by clicking on the 'Label' button
-
Click on 'Add pedestrians' button to load dock widget.
-
Choose parameters (pedestrian type, use lane heading / manually specify, initial speed)
-
If 'Use random pedestrian' is checked, a random pedestrian type will be selected for every spawned pedestrian.
-
Press on 'Insert', mouse pointer will change to cross-type pointer.
-
Click on desired map position to spawn pedestrian.
-
If click point contains multiple lanes and 'Use lane heading' is enabled, a dialog box will appear and ask to select lane ID to use for lane heading.
-
If click point contains lanes with multiple elevations, a dialog box will appear and ask to select the desired elevation.
Note: Sometimes there will be a "Click point too far from lane" error. Try choosing a different elevation.
Note: You can insert as many pedestrians as you desire after pressing on 'Insert'
Note: You can toggle labels on and off by clicking on the 'Label' button
- In
Layers
right click on layer and selectOpen Attribute Table
.
- Click on the pencil icon on top left to enable editing.
- Highlight the row containing the entity for deletion.
- Click on trash can to delete entity.
- Click on pencil icon to disable editing.
- When prompted to save changes, choose 'Yes'.
-
Click on 'Add Maneuvers' button to load dock widget.
-
Choose either to add entity maneuvers or global actions under
Maneuver Type
. -
Entity maneuvers
- Choose entity to apply maneuver to, if entity is not listed, click on
Refresh entity list
. - Set up start triggers of the maneuver using the
Start Triggers
tab. - If stop triggers are needed, set up stop triggers of the maneuver using the
Stop Triggers
tab by checking the box besideStop Triggers
. - Choose type of maneuver (waypoints, longitudinal, lateral)
- Waypoint Maneuvers
- Choose waypoint strategy and whether to use lane heading or user-defined heading.
- Click on
Insert
, and click on the map to spawn as many waypoints as intended. - To end spawning of waypoints, click on the
Pan Map
tool (symbolized with a hand icon)
- Longitudinal and lateral maneuvers
- Choose the parameters.
- Click on
Insert
.
- Waypoint Maneuvers
- Choose entity to apply maneuver to, if entity is not listed, click on
-
Global actions
- To enable/disable labels on traffic lights, press on
Toggle traffic light labels
. - To refresh traffic light IDs, press on
Refresh traffic light IDs
. - Choose the desired action.
- Set up the start triggers of the maneuvers using the
Triggers
tab. - Click on
Insert
.
- To enable/disable labels on traffic lights, press on
Note: It is important to set up the start/stop triggers first before inserting the maneuver
- Special note for Reach Position Condition
- To set up
ReachPositionCondition
, click onChoose position
. - Click on a point on the map.
- The coordinates of the click point will be updated in the UI.
- To set up
- In
Layers
right click on layer and selectOpen Attribute Table
.
- Click on the pencil icon on top left to enable editing.
- Highlight the row containing the maneuver / waypoint for deletion.
- Click on trash can to delete entity.
- Click on pencil icon to disable editing.
- When prompted to save changes, choose 'Yes'.
After inserting entities or maneuvers, you can edit them using the Attributes table.
-
In
Layers
, right click on layer and selectOpen Attribute Table
. -
Click on the pencil icon on top left to enable editing.
-
Double click on cell to edit.
-
Change the cell value.
-
When desired changes are complete, click on pencil icon to disable editing.
-
When promted to save changes, choose 'Yes'.
Note: Changing the positions (X, Y, heading) in the attributes table does not update the positions seen in the map.
You can define you own parameters to be used inside the scenario.
-
Click on the
Add Parameters
icon. -
Setup parameters based on requirements (name, type, value).
-
Click on
Insert
. -
If a parameter name already exists, the plugin will prompt you if you want to replace it.
Note: To edit existing parameters, you can edit them directly using the Attributes table, or using the same parameter name and clicking on Insert
. The plugin will ask for confirmation to replace the existing parameter.
Parameters can be used when creating scenarios.
-
In the text field entry, simply input the name of the parameter to be used.
-
If the parameter does not exist, and error message will appear, as shown below.
- For Scenario_Runner
export CARLA_ROOT=/path/to/your/carla/installation
export SCENARIO_RUNNER_ROOT=/path/to/your/scenario/runner/installation
export PYTHONPATH=$PYTHONPATH:${CARLA_ROOT}/PythonAPI/carla/dist/carla-<VERSION>.egg
export PYTHONPATH=$PYTHONPATH:${CARLA_ROOT}/PythonAPI/carla/agents
export PYTHONPATH=$PYTHONPATH:${CARLA_ROOT}/PythonAPI/carla
export PYTHONPATH=$PYTHONPATH:${CARLA_ROOT}/PythonAPI
-
Click on 'Carla-connect' button to load the dock widget.
-
To change the map, Choose a map from drop down menu.
-
Press on 'Change Map'
Note: To change environment settings, simply select the map and press 'Change Map' again. Previous map will be cleared and replaced with the updated ones.
-
Select the height you want to place the bird eye camera from drop down menu.
-
Click on 'Insert camera manually' button, mouse pointer will change to cross-type pointer.
-
Click on desired map position to spawn camera.
- To place camera automatically click on 'Auto Insert Camera'. This will find the centroid of all actors spawned and place a bird eye view camera 30m above the centriod positon.
Note: To use Automatic Camera placement, make sure you have added at least 2 actors/vehicles.
- To Run the created scenario, press on 'Play Scenario' button.
- This will pop up a Pygame window, where created scenario can be visulaized.
- To stop the Scenario click on 'Stop scenario button', this will destroy all actors and close py game window.