How To Run a Scenario or Test Case
The following steps detail how to run the Vehicle Following scenario. This scenario and other example scenarios can be found on our examples page. These scenarios use the SVL Simulator Python API.
The SVL Simulator Python API is available on GitHub: https://github.com/lgsvl/PythonAPI
After cloning or downloading it from the git repository follow these steps:
Run the following command to install Python files and necessary dependencies:
pip3 install --user -e .
Start the simulator.
Set environment variables SIMULATOR_HOST and BRIDGE_HOST
- SIMULATOR_HOST is where the simulator will be run. The default value for this is "localhost" and does not need to be set if the simulator is running on the same machine that the Python script will be run from.
- BRIDGE_HOST is where the AD stack will be run. This is relative to where the simulator is run. The default value is "localhost" which is the same machine as the simulator.
- For example, if computer A will run the simulator and computer B will run the AD stack
- SIMULATOR_HOST should be set to the IP of computer A
- BRIDGE_HOST should be set to the IP of computer B
- To set the variables for the current terminal window use
export SIMULATOR_HOST=192.168.1.100 export BRIDGE_HOST=192.168.1.101
Start your AD stack. The example scripts are written for Apollo 5.0. See below for how to edit the scripts to work with other AD stacks.
- Select the MKZ as the vehicle SingleLaneRoad for the map
- Start all modules and the bridge (if relevant)
Run the script
Set the destination for the AD stack. For this scenario, the destination is the end of the current lane.
The AV should start driving forward towards the NPC. It should avoid crashing into the NPC.
If using a different AD stack, the vehicle type needs to be changed.
- Change the agent name (orange string) to what is desired.
- e.g. For Autoware it might be "Lexus2016RXHybrid (Autoware)"