In recent years, co-simulation became an exciting area in the industry. The aim of co-simulation is creating 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 to efficiently simulate 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.
Simulink is widely used in the automotive industry for software function development and testing. It allows users to develop custom functions and control algorithms in a graphical fashion, requiring little to no programming knowledge. It offers several toolboxes and interfaces to different software being an ideal framework for co-simulation. The Vehicle Dynamics Block set 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 are 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 models SmartCity module of the ZalaZone automotive proving ground. The accurate models of the test track is available in different file formats here.
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.