In recent years, co-simulation became an exciting area in the industry as well as in the industry. The aim of co-simulation is to create synergies between different simulation software. In the following example, the traffic simulator SUMO is connected to a visualization module built in Unreal Engine 4, through Simulink.
SUMO is an open-source traffic simulation software used by traffic engineers to evaluate different traffic control and routing strategies. Accordingly, it is capable of efficiently simulating large-scale traffic with hundreds of actors. On the other hand, its visualization is very limited, only 2D.
Unreal Engine 4(UE4) is a game engine with excellent 3D visualization. The automotive industry turned towards graphical engines to create photorealistic driving scenarios to test their (especially camera-based) ADAS functions. Although UE4 is a very flexible tool, it is a tedious job to create high-fidelity simulations within it.
The Vehicle Dynamics Blockset of Matlab Simulink provides interface blocks to connect with scenes created with UE4. SUMO cannot directly connect to Simulink, but it can be interfaced with Matlab through TraCI. To circumvent this limitation of Simulink, a set of embedded Matlab function blocks is created. These blocks initialize a predefined traffic simulation network and communicate with it. Relevant states (vehicle ID, position, velocity, and heading) are continuously read from SUMO and output to Simulink. The states of each individual vehicle are passed to 3D vehicle simulation blocks that can be directly visualized in UE4.
The simulation example is based on the model of SmartCity track at the ZalaZone automotive proving ground. The accurate models of the test track are available in different file formats: https://github.com/BMEAutomatedDrive/ZalaZONE-automotive-proving-ground-virtual-simulation-models.
The SUMO model and the UE4 model are created from the same laser-scanned source and therefore shall match. In SUMO some routes are created with swarm traffic. These vehicles (the first 16 of them) are then visualized in the 3D environment of the test track in Unreal. The 3D environment only contains the road network with road markings and traffic signs. Although real-time speeds are not required in most co-simulations, in this example quasi-real-time was achieved with 16 vehicles and 0.025 s sampling time. Experiments were run on a computer with a 7th Gen Intel Core i7 processor running at 2.9 GHz using 8 MB of RAM.