{"id":28650583,"url":"https://github.com/carla-simulator/traffic-generation-editor","last_synced_at":"2025-06-13T05:06:50.800Z","repository":{"id":46680105,"uuid":"331024976","full_name":"carla-simulator/traffic-generation-editor","owner":"carla-simulator","description":"Visual generation of traffic scenarios based on the OpenSCENARIO standard","archived":false,"fork":false,"pushed_at":"2021-10-18T08:08:34.000Z","size":2534,"stargazers_count":57,"open_issues_count":14,"forks_count":14,"subscribers_count":5,"default_branch":"main","last_synced_at":"2024-05-01T11:28:00.007Z","etag":null,"topics":["automated-driving","openscenario","qgis-plugin","scenario"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/carla-simulator.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-01-19T15:29:38.000Z","updated_at":"2024-04-21T13:39:22.000Z","dependencies_parsed_at":"2022-09-12T21:50:27.754Z","dependency_job_id":null,"html_url":"https://github.com/carla-simulator/traffic-generation-editor","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/carla-simulator/traffic-generation-editor","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carla-simulator%2Ftraffic-generation-editor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carla-simulator%2Ftraffic-generation-editor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carla-simulator%2Ftraffic-generation-editor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carla-simulator%2Ftraffic-generation-editor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/carla-simulator","download_url":"https://codeload.github.com/carla-simulator/traffic-generation-editor/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carla-simulator%2Ftraffic-generation-editor/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259584827,"owners_count":22880202,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["automated-driving","openscenario","qgis-plugin","scenario"],"created_at":"2025-06-13T05:06:49.290Z","updated_at":"2025-06-13T05:06:50.791Z","avatar_url":"https://github.com/carla-simulator.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# QGIS OpenSCENARIO Generation Plugin\n\n## Table of Contents\n- [QGIS OpenSCENARIO Generation Plugin](#qgis-openscenario-generation-plugin)\n  - [Table of Contents](#table-of-contents)\n    - [Prerequisites](#prerequisites)\n      - [Python Packages](#python-packages)\n  - [Installation](#installation)\n  - [Features](#features)\n  - [Known Issues](#known-issues)\n  - [OpenSCENARIO Support List](#openscenario-support-list)\n    - [Environment](#environment)\n    - [Actors](#actors)\n    - [Static Objects (Props)](#static-objects-props)\n    - [End Evaluation KPIs](#end-evaluation-kpis)\n    - [Entity Maneuvers](#entity-maneuvers)\n    - [Global Maneuvers](#global-maneuvers)\n  - [Guide](#guide)\n    - [Prerequisite](#prerequisite)\n    - [Toolbar UI](#toolbar-ui)\n    - [Adding Environment Variables](#adding-environment-variables)\n    - [Adding Vehicles](#adding-vehicles)\n    - [Adding Pedestrians](#adding-pedestrians)\n    - [Removing Vehicles or Pedestrians](#removing-vehicles-or-pedestrians)\n    - [Adding Maneuvers](#adding-maneuvers)\n    - [Removing Maneuvers and Waypoints](#removing-maneuvers-and-waypoints)\n    - [Editing Entity / Maneuver Parameters](#editing-entity--maneuver-parameters)\n    - [Adding Own Parameters](#adding-own-parameters)\n    - [Using Self-defined Parameters](#using-self-defined-parameters)\n  - [Connecting to CARLA](#connecting-to-carla)\n    - [Env variables](#env-variables)\n    - [Adding Camera](#adding-camera)\n      - [Place Camera Manually:](#place-camera-manually)\n      - [Place Camera Automatically:](#place-camera-automatically)\n    - [Play Scenario](#play-scenario)\n    - [Stop Scenario](#stop-scenario)\n\n\n### Prerequisites\n- Python 3.6\n- [QGIS 3](https://www.qgis.org/)\n- [CARLA AD Map plugin version 2.4.5 and above](https://github.com/carla-simulator/map/releases)\n- [CARLA](https://github.com/carla-simulator/carla/releases/) (Version \u003e= 0.9.10)\n- [CARLA Scenario Runner](https://github.com/carla-simulator/scenario_runner/releases)\n\n#### Python Packages\n- [pygame package](https://pypi.org/project/pygame/)\n- [defusedxml package](https://pypi.org/project/defusedxml/)\n- [numpy package](https://pypi.org/project/numpy/)\n- [xmlschema package](https://pypi.org/project/xmlschema/)\n\nPython packages can be installed using the supplied `requirements.txt` by:\n```bash\npip3 install --user -r /path/to/requirements.txt\n```\n\n## Installation\n1. Download the repo as a zip file in GitHub (`Code \u003e Download ZIP`).\n2. Run QGIS 3.\n3. Install plugin from plugins menu (`Plugins \u003e Manage and Install Plugins \u003e Install from ZIP`), choose the zip file that was previously downloaded.\n\n   _Note: If [CARLA AD Map plugin](https://github.com/carla-simulator/map/releases) has not been installed before, same steps can be used to install the ZIP package._\n\n![Install from ZIP](Docs/OSCGenerator_InstallZIP.png)\n\n4. Change to `Installed` tab and make sure `OpenSCENARIO Editor Toolkit` is enabled.\n5. Enjoy!\n\n## Features\n- Place entiites onto loaded OpenDRIVE map (through AD Map plugin)\n- Specity start and stop triggers for maneuvers\n- Add maneuvers to entities\n- Add global maneuvers\n  - Current support for traffic light actions only\n- Set initial environment variables (cloud state, time of day, precipitation)\n\n## Known Issues\n- When map is unloaded and reloaded with AD Map Access, exporting scenarios might not work\n\n## OpenSCENARIO Support List\n\n_For the full support list, visit [OpenSCENARIO Tags Support](Docs/OpenSCENARIO_Support.md)_\n\n✅ - Supported\n\n❌ - Not supported\n\n### Environment\n| Description      | Support | Notes                                     |\n| ---------------- | ------- | ----------------------------------------- |\n| Time of day      | ✅       | Includes enabling animation of time       |\n| Cloud state      | ✅       |\n| Fog visual range | ✅       |\n| Sun              | ✅       | Includes intensity, azimuth, elevation    |\n| Precipitation    | ✅       | Includes precipitation type and intensity |\n\n### Actors\n| Description               | Support | Notes                                                                                       |\n| ------------------------- | ------- | ------------------------------------------------------------------------------------------- |\n| Spawn with World Position | ✅       |\n| Set initial speed         | ✅       |\n| Set orientation           | ✅       | Can either use lane heading, or manually specified                                          |\n| Set as ego vehicle        | ✅       | Only for vehicles                                                                           |\n| Agent selection           | ✅       | Only for ego vehicles (manual_control will require manually changing `Ego_1` tag to `hero`) |\n| Agent parameter overrides | ❌       | Only for ego vehicles (overriding throttle, brake, clutch, parking brake, steering, gear)   |\n\n### Static Objects (Props)\n| Description               | Support | Notes                                              |\n| ------------------------- | ------- | -------------------------------------------------- |\n| Spawn with World Position | ✅       |\n| Set object type           | ✅       |\n| Set object mass           | ✅       |\n| Set orientation           | ✅       | Can either use lane heading, or manually specified |\n| Enable/Disable physics    | ✅       |\n\n### End Evaluation KPIs\n| Description            | Support | Notes |\n| ---------------------- | ------- | ----- |\n| Running stop test      | ✅       |\n| Running red light test | ✅       |\n| Wrong lane test        | ✅       |\n| On sidewalk test       | ✅       |\n| Keep lane test         | ✅       |\n| Collision test         | ✅       |\n| Driven distance test   | ✅       |\n\n### Entity Maneuvers\n| Description        | Support | Notes |\n| ------------------ | ------- | ----- |\n| Waypoints          | ✅       |\n| Longitudinal       | ✅       |\n| Lateral            | ✅       |\n| Synchronize Action | ❌       |\n| Teleport Action    | ❌       |\n\n### Global Maneuvers\n| Description           | Support | Notes                        |\n| --------------------- | ------- | ---------------------------- |\n| Environment           | ❌       |\n| Infrastructure Action | ✅       | Traffic light signal control |\n\n\n## Guide\n### Prerequisite\n1. Open OpenDRIVE map using CARLA AD Map plugin\n\n### Toolbar UI\n\n![OpenSCENARIO Generator Toolbar](Docs/OSCGenerator_Toolbar.png)\n\n| Icon                                                                         | Description                                            |\n| ---------------------------------------------------------------------------- | ------------------------------------------------------ |\n| \u003cimg src=\"icons/icon_weather.png\" alt=\"Edit environment\" width=\"50\"/\u003e        | Edit environment                                       |\n| \u003cimg src=\"icons/icon_vehicle.png\" alt=\"Add vehicles\" width=\"50\"/\u003e            | Add vehicles                                           |\n| \u003cimg src=\"icons/icon_pedestrian.png\" alt=\"Add pedestrians\" width=\"50\"/\u003e      | Add pedestrians                                        |\n| \u003cimg src=\"icons/icon_static.png\" alt=\"Add static objects\" width=\"50\"/\u003e       | Add static objects                                     |\n| \u003cimg src=\"icons/icon_maneuver.png\" alt=\"Add maneuvers\" width=\"50\"/\u003e          | Add maneuvers                                          |\n| \u003cimg src=\"icons/icon_parameter.png\" alt=\"Add parmeters\" width=\"50\"/\u003e         | Add parameters                                         |\n| \u003cimg src=\"icons/icon_endEval.png\" alt=\"Add end evaluation KPIs\" width=\"50\"/\u003e | Add end evaluation KPIs (Specific for Scenario Runner) |\n| \u003cimg src=\"icons/icon_code.png\" alt=\"Export OpenSCENARIO\" width=\"50\"/\u003e        | Export OpenSCENARIO file                               |\n| \u003cimg src=\"icons/icon_import.png\" alt=\"Import OpenSCENARIO\" width=\"50\"/\u003e      | Import OpenSCENARIO file                               |\n| \u003cimg src=\"icons/carla_logo.png\" alt=\"Connect to CARLA instance\" width=\"50\"/\u003e | Connect to carla instance                              |\n| \u003cimg src=\"icons/video_cam.png\" alt=\"Insert camera\" width=\"50\"/\u003e              | Add bird eye view camera                               |\n\n\n### Adding Environment Variables\n1. Click on 'Edit environment' button to load dock widget.\n2. Edit parameters in dock widget to desired parameters.\n\n  ![Edit Environment Dock Widget](Docs/OSCGenerator_Environment.png)\n\n3. Press on 'Apply'\n\n_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._\n\n### Adding Vehicles\n1. Click on 'Add vehicles' button to load dock widget.\n2. Choose parameters (vehicle type, use lane heading / manually specify, initial speed)\n3. Agent selection is only enabled for Ego vehicles. You can also specify your own agent.\n\n  ![Add Vehicles Dock Widget](Docs/OSCGenerator_Vehicles.png)\n\n4. Press on 'Insert', mouse pointer will change to cross-type pointer.\n5. Click on desired map position to spawn vehicle.\n6. 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.\n\n   ![Selecting Lane ID](Docs/OSCGenerator_Vehicles_LaneID.png)\n\n7. If click point contains lanes with multiple elevations, a dialog box will appear and ask to select the desired elevation.\n\n   ![Selection Elevation](Docs/OSCGenerator_Elevation.png)\n\n_Note: Sometimes there will be a \"Click point too far from lane\" error. Try choosing a different elevation._\n\n_Note: Currently you can insert vehicle one at a time._\n\n_Note: You can toggle labels on and off by clicking on the 'Label' button_\n\n### Adding Pedestrians\n1. Click on 'Add pedestrians' button to load dock widget.\n2. Choose parameters (pedestrian type, use lane heading / manually specify, initial speed)\n3. If 'Use random pedestrian' is checked, a random pedestrian type will be selected for every spawned pedestrian.\n\n   ![Add Pedestrians Dock Widget](Docs/OSCGenerator_Pedestrians.png)\n\n4. Press on 'Insert', mouse pointer will change to cross-type pointer.\n5. Click on desired map position to spawn pedestrian.\n6. 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.\n\n   ![Selecting Lane ID](Docs/OSCGenerator_Vehicles_LaneID.png)\n\n7. If click point contains lanes with multiple elevations, a dialog box will appear and ask to select the desired elevation.\n\n   ![Selection Elevation](Docs/OSCGenerator_Elevation.png)\n\n_Note: Sometimes there will be a \"Click point too far from lane\" error. Try choosing a different elevation._\n\n_Note: You can insert as many pedestrians as you desire after pressing on 'Insert'_\n\n_Note: You can toggle labels on and off by clicking on the 'Label' button_\n\n### Removing Vehicles or Pedestrians\n1. In `Layers` right click on layer and select `Open Attribute Table`.\n\n  ![Attributes Table](Docs/OSCGenerator_AttributesTable.png)\n\n2. Click on the pencil icon on top left to enable editing.\n3. Highlight the row containing the entity for deletion.\n4. Click on trash can to delete entity.\n5. Click on pencil icon to disable editing.\n6. When prompted to save changes, choose 'Yes'.\n\n### Adding Maneuvers\n1. Click on 'Add Maneuvers' button to load dock widget.\n\n   ![Maneuvers Dock Widget](Docs/OSCGenerator_Maneuvers_Entity.png)\n\n2. Choose either to add entity maneuvers or global actions under `Maneuver Type`.\n3. Entity maneuvers\n   1. Choose entity to apply maneuver to, if entity is not listed, click on `Refresh entity list`.\n   2. Set up start triggers of the maneuver using the `Start Triggers` tab.\n   3. If stop triggers are needed, set up stop triggers of the maneuver using the `Stop Triggers` tab by checking the box beside `Stop Triggers`.\n   4. Choose type of maneuver (waypoints, longitudinal, lateral)\n      1. Waypoint Maneuvers\n         1. Choose waypoint strategy and whether to use lane heading or user-defined heading.\n         2. Click on `Insert`, and click on the map to spawn as many waypoints as intended.\n         3. To end spawning of waypoints, click on the `Pan Map` tool (symbolized with a hand icon)\n      2. Longitudinal and lateral maneuvers\n         1. Choose the parameters.\n         2. Click on `Insert`.\n4. Global actions\n   1. To enable/disable labels on traffic lights, press on `Toggle traffic light labels`.\n   2. To refresh traffic light IDs, press on `Refresh traffic light IDs`.\n   3. Choose the desired action.\n   4. Set up the start triggers of the maneuvers using the `Triggers` tab.\n   5. Click on `Insert`.\n\n_Note: It is important to set up the start/stop triggers first before inserting the maneuver_\n1. Special note for Reach Position Condition\n   1. To set up `ReachPositionCondition`, click on `Choose position`.\n   2. Click on a point on the map.\n   3. The coordinates of the click point will be updated in the UI.\n\n### Removing Maneuvers and Waypoints\n1. In `Layers` right click on layer and select `Open Attribute Table`.\n\n  ![Attributes Table](Docs/OSCGenerator_AttributesTable_Maneuvers.png)\n\n2. Click on the pencil icon on top left to enable editing.\n3. Highlight the row containing the maneuver / waypoint for deletion.\n4. Click on trash can to delete entity.\n5. Click on pencil icon to disable editing.\n6. When prompted to save changes, choose 'Yes'.\n\n### Editing Entity / Maneuver Parameters\nAfter inserting entities or maneuvers, you can edit them using the Attributes table.\n1. In `Layers`, right click on layer and select `Open Attribute Table`.\n2. Click on the pencil icon on top left to enable editing.\n3. Double click on cell to edit.\n\n   ![Editing Parameters](Docs/OSCGenerator_EditAttributes.png)\n\n4. Change the cell value.\n5. When desired changes are complete, click on pencil icon to disable editing.\n6. When promted to save changes, choose 'Yes'.\n\n_Note: Changing the positions (X, Y, heading) in the attributes table does not update the positions seen in the map._\n\n### Adding Own Parameters\nYou can define you own parameters to be used inside the scenario.\n1. Click on the `Add Parameters` icon.\n2. Setup parameters based on requirements (name, type, value).\n\n   ![Parameters Dock Widget](Docs/OSCGenerator_Parameters.png)\n\n3. Click on `Insert`.\n4. If a parameter name already exists, the plugin will prompt you if you want to replace it.\n\n_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._\n\n### Using Self-defined Parameters\nParameters can be used when creating scenarios.\n1. In the text field entry, simply input the name of the parameter to be used.\n2. If the parameter does not exist, and error message will appear, as shown below.\n\n   ![Parameter Error Message](Docs/OSCGenerator_ParameterNotExist.png)\n\n## Connecting to CARLA\n\n### Env variables\n\n* For Scenario_Runner\n```bash\nexport CARLA_ROOT=/path/to/your/carla/installation\nexport SCENARIO_RUNNER_ROOT=/path/to/your/scenario/runner/installation\nexport PYTHONPATH=$PYTHONPATH:${CARLA_ROOT}/PythonAPI/carla/dist/carla-\u003cVERSION\u003e.egg\nexport PYTHONPATH=$PYTHONPATH:${CARLA_ROOT}/PythonAPI/carla/agents\nexport PYTHONPATH=$PYTHONPATH:${CARLA_ROOT}/PythonAPI/carla\nexport PYTHONPATH=$PYTHONPATH:${CARLA_ROOT}/PythonAPI\n```\n1. Click on 'Carla-connect' button to load the dock widget.\n\n   ![Carla_connect Dock Widget](Docs/camera1.PNG)\n\n2. To change the map, Choose a map from drop down menu.\n\n   ![Carla_connect Dock Widget town](Docs/camera2.PNG)\n\n3. Press on 'Change Map'\n\n_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._\n\n### Adding Camera\n\n1. click on 'Add Camera' button to load Add camera dock widget.\n\n    ![Add Camera](Docs/camera3.PNG)\n\n#### Place Camera Manually:\n\n* Select the height you want to place the bird eye camera from drop down menu.\n\n    ![plot](Docs/camera4.PNG)\n\n* Click on 'Insert camera manually' button,  mouse pointer will change to cross-type pointer.\n* Click on desired map position to spawn camera.\n\n#### Place Camera Automatically:\n\n* 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.\n\n_Note: To use Automatic Camera placement, make sure you have added at least 2 actors/vehicles._\n\n\n### Play Scenario\n\n1. To Run the created scenario, press on 'Play Scenario' button.\n2. This will pop up a Pygame window, where created scenario can be visulaized.\n\n### Stop Scenario\n\n1. To stop the Scenario click on 'Stop scenario button', this will destroy all actors and close py game window.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcarla-simulator%2Ftraffic-generation-editor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcarla-simulator%2Ftraffic-generation-editor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcarla-simulator%2Ftraffic-generation-editor/lists"}