This is the repo for the Simulation Testing project. The project goal is to
- 1. Recreate a testing scenario that is listed among the NHTSA challenging dataset.
- 2. Test OpenCDA's default autopilot agent in this scenario.
- 3. Generate traffic level performance metrics for the OpenCDA's default agent.
This meta file’s intention is to help you streamline the process and break down the task into multiple steps. You are encouraged to experiment with alternative methods, should you have a different approach. Please feel free to contact me (Xu) if you have any questions or need help with anything. The task breakdown is as follows.
-
The NHTSA dataset we used contains a list of scenarios that we selected from the official "Pre-Crash Scenario Typology for Crash Avoidance Research." A detailed document is uploaded to the "NHTSA dataset" folder within the repo. The list we are using is summarized in "cee 298 scenario docs.pdf," and the original pre-crash document is also uploaded in the same directory as a reference.
-
A detailed CARLA map introduction can be found here. A list of all ten maps can be found here. After selecting the desired NHTSA scenario to recreate, you can go through these 10 CARLA towns to select a map to create your scenario. Please note that these 10 towns are built with different emphasis, so select the corresponding map based on your own needs.
-
OpenCDA loads the scenario by reading the scenario configuration file. This file dictates all the details in the testing scenario, such as what vehicles are included in the scene, where they are spawned, where they are trying to go, and what their behaviors are. In addition, these files set the OpenCDA in different modes; for example, trajectory analysis can be turned on/off here. All the existing sample scenarios provided in OpenCDA are listed here, and their corresponding Python scripts (i.e., [same_name].py) are stored here. It is important to look at these config files and determine what information is needed for your own customized scenario.
-
Please refer to this directory to learn how to navigate through CARLA. Basically, you need to read all existing waypoints in CARLA and print them on screen to learn the exact location of the spot you chose. Then in the CARLA config file, use this location to initiate the scenario.
-
Once you have selected the spot, please generate a new config file (YAML file) and a corresponding Python script (same_name.py) to run your scenario by running.
python opencda.py -t your_scenario_nameIt is a good practice to disable the performance analysis or plots and focus on the environment first, and then add more functions step-wise. Note: run all python script within the "opencda" conda env. If you encounter "cannot import carla" error, this usually means you forgot the conda env.