SUMO¶
SUMO allows for traffic systems to be modelled. Click Here to find out more about SUMO.
How to connect to SUMO¶
Connecting Traffic3D with SUMO allows for SUMO simulations to be viewed and controlled in Traffic3D using the settings from the Sumo Manager. Currently, this features allows Traffic3D and SUMO to control the following:
- Traffic Flow
- Traffic Lights
The buildings and lampposts are automatically generated and will adapt to the road network. Once running, Traffic3D will render the vehicles on the road according to their positions in SUMO. To connect to SUMO, follow the instructions below:
- Within Unity, load the Sumo Scene which is found at
/Assets/Scenes/Sumo.unity
. - Edit the Sumo Manager options within the
SumoManager
game object. - Navigate to the
Assets/Sumo/
folder and remove the originalmap.net
andmap.rou
files. - Find or Create a SUMO network (
.net file
) and a SUMO demand (.rou
) file to use. - In NetEdit, with the SUMO network and demand file loaded, press
Edit > Open in SUMO-GUI
. - Save the configuration in SumoGui with
File > Save Configuration
and close SumoGui. -
Add the following xml within the
configuration
xml tag in the.sumocfg
file created when saving the configuration in the previous step.<traci_server> <remote-port value="4001"/> </traci_server> <step-length value="0.016" />
-
Edit the port if needed according to the port displayed in the
Sumo Manager
. The step length is your simulation time. The current value of0.016
is close to real time, increase this if needed. - Get the
.net
and.rou
files created in the previous steps, copy them into theAssets/Sumo/
folder and rename them tomap.net
andmap.rou
. - Open SumoGui, press
File > Open Simulation
and use the configuration file that was previously edited. The SumoGui console should output***Starting server on port 4001 ***
. - Finally press the play button on Unity and it should load the SUMO Network into Traffic3D with the chosen options from
Sumo Manager
.