This tool generates collision-scenario videos using the LGSVL Simulator via its Python API. It controls one EGO vehicle and one NPC vehicle to reproduce selected collision types. By default, videos are exported at 1920×1080 and 50 fps. Users can choose from five collision types and configure multiple environment parameters.
- LD: Vehicle turns right at a signalized intersection and enters the opposite direction of a vehicle traveling straight from a lateral approach.
- LTIP: Vehicle stops at a stop sign, then turns left across lateral crossing traffic.
- OD: Vehicle turns left at an uncontrolled intersection and cuts across the path of an oncoming vehicle.
- RTIP: Vehicle stops at a stop sign, then turns right across lateral crossing traffic.
- SCP: Vehicle stops at a stop sign, then proceeds straight across lateral crossing traffic.
- speed (km/h)
- rain level
- fog level
- wetness level
- pedestrian count (beta)
- NPC vehicle count (beta)
- Ubuntu 18.04
- 4 GHz quad-core CPU
- NVIDIA GTX 1080, 8 GB GPU memory
- Python 3.6
- LGSVL Simulator 2020.03-rc1
- Python API for LGSVL Simulator
- ROS Melodic
- lgsvl_msgs
- ffmpeg
- Download the 2020.03-rc1 release for Linux: https://github.com/lgsvl/simulator/releases/tag/2020.03-rc1
- Unzip the archive and run the executable.
- Get the Python API: https://github.com/lgsvl/PythonAPI
- Install the API:
cd PythonAPI
pip3 install --user .- Install ROS1 Melodic on Ubuntu 18.04: ROS Documentation
- Install
lgsvl_msgs: lgsvl_msgs Documentation
- Launch the simulator.
- Click "Open Browser" to open the Simulator UI.
- After default maps and vehicles download, go to the "Simulations" tab.
- Create a new Simulation, give it a name, and check "API Only". Click Submit.
- Select the new Simulation and click "Play" in the bottom-right.
- Clone and start the tool:
git clone https://github.com/kuoyaoming/collision_video_generator
cd collision_video_generator
python main.py- Choose your desired setup and parameters.
- Click the "Play" button to generate the video.
- Default output: 1920×1080 at 50 fps.
- Items marked as "beta" are experimental and may change.
- Built on the LGSVL Simulator and its Python API.
