These steps guide you through using FMU (Functional Mock-up Unit) integration with Simulink for co-simulation with BeamNG.tech, supporting both FMI 2 and FMI 3 standards. To make your custom FMU model, follow the BeamNG FMU repository.
-
Open an Example Model: Begin by opening one of the example models, FMI2.slx or FMI3.slx, available in the src/examples/simulink/FMI/ folder.
-
Configure the FMU Block: Double-click the red FMU block within the model to configure it. Specify the path to your chosen BeamNG-FMU file. After configuration, the block should display the "BeamNG" text, indicating proper linkage.
-
Edit FMU Parameters: To modify the FMU parameters such as input/output ports and simulation time, double-click the FMU file.
-
Start the Vehicle Coupling: Follow the integration instructions similar to those for the S-function Simulink integration to start the vehicle coupling. Alternatively, use the
Ctrl+Shift+V
shortcut to initiate coupling directly in BeamNG. Once started, the vehicle will begin moving, and you should observe a simulation environment similar to the following: