We observed traffic safety researchers invested considerable time, effort, and money in developing a co-simulation tool that integrated Traffic Simulation SUMO (Simulation of Urban MObility) and Unity Game Engine. Each study ‘re-invented the wheel’ and therefore sacrificed resources that could have been used to focus on the ultimate goal, i.e., improving safety. Sumo2Unity tool integrates Traffic Simulation SUMO (Simulation of Urban MObility) with Unity Game Engine. SUMO2Unity is an open-source project contains the following items:
- Integrate SUMO and Unity. This included programming the data exchange between the trajectory coordinates (X, Y, Z) of the vehicles and the signal timing (phase and duration) every 0.02 seconds;
- Develop a 2D environment for SUMO and 3D environment for Unity. The SUMO and Unity environments were designed to allow researchers to develop and modify their own scenarios and test the tool’s integration. The 3D environment included 3D models of vehicles, traffic lights, and various road configurations including two-lane/four-lane roads and signalized and unsignalized intersections; and
- Develop a 3D model of a simulator vehicle and develop VR-based driver simulator. The 3D model of simulator vehicle includes creating a realistic interior design and adding vehicle dynamics and the VR-based driver simulator adds functionality by allowing us to control the simulator vehicle.
Check out the quick 2 minute demo
- Download latest version of Sumo. We recommend version 1.18 or 1.19.
- Download Unity Hub.
- Once you install Unity Hub, download and install Unity Editor. We recommend version 2022.3.16f1.
-SUMO - Step by Step Tutorial Youtube Tutorial
- Install SUMO (Version 1.18 or 1.19)
- Set Up SUMO Environment Variables
- Install Notepad ++
- Watch SUMO Tutorial
-Unity - Step by Step Tutorial Youtube Tutorial
- Install Unity HUB
- Install Unity Editor. We recommend version 2022.3.16f1.
- Install Visual Studio
- Install Visual Studio Dependencies
- Watch Unity VR Tutorial
-SUMO2Unity - Step by Step Tutorial Youtube Tutorial
- Download this repository as a zip file.
- Extract the zip file.
- Add the extract file in Unity Hub and open it with version 2022.3.16f1.
- In the editor, go to
_Project/Scenes
and open SUMO2Unity scene. - Watch SUMO2Unity Tutorial
- To change the simulation settings, go to
Assets/_Project/Sumo_Data
. - Open Sumo2Unity file to see the existing simulation.
- To change simulation, click on
Edit > Open network in netedit
or pressctrl + T
. - You can add or modify vehicles and traffic signals in the Simulation.
- If you need more help or have any questions, feel free to create a new issue at the Issues section.
If you use SUMO2Unity, please cite our paper.
Mohammadi, A., Park, P. Y., Nourinejad, M., Cherakkatil, M. S. B., & Park, H. S. (2024, June). SUMO2Unity: An Open-Source Traffic Co-Simulation Tool to Improve Road Safety. In 2024 IEEE Intelligent Vehicles Symposium (IV) (pp. 2523-2528). IEEE.
- SUMO2Unity codes are distributed under MIT License.
- SUMO2Unity assets are distributed under CC-BY License.
The following assets are developed by Unity and are free to use for commercial and non-commercial use. The assets are licensed by the standard Unity Asset Store EULA (https://unity.com/legal/as-terms).
- Automotive HMI Template
- TerrainDemoScene_URP
- UnityStandardAssets
- Viking Village