Is it posibble to import a simulink model into Unreal Engine simulation ?
3 views (last 30 days)
Show older comments
Jakub Wiech
on 10 Jul 2024
Commented: Nishan Nekoo
on 12 Jul 2024
Hi,
I'm trying to create a simulation of a self-driving car in Unreal Engine with Simulink modeling the dynamics and control logic. It is easy to use UE scenes in Simulink, but I'm wondering if it's possible to compile the Simulink model into the Unreal Engine project. The simulation would be developed in Unreal Engine, and I need the logic from Simulink to be imported into the UE project.
Is there any easy way to do this, except for compiling the Simulink model into C++ and incorporating it by hand into UE project?
Thanks for the help.
0 Comments
Accepted Answer
Nishan Nekoo
on 12 Jul 2024
Hi Jakub,
There currently isn't a very easy way to do this unfortunately beyond the method you have mentioned. Can you tell me a little more about your use case for doing this? Is it due to the co-simulation performance or are there any other reasons?
Nishan
2 Comments
Nishan Nekoo
on 12 Jul 2024
Hi Jakub,
I just wanted to note that Simulation 3D blocks currently do not support code generation to begin with (link to doc), so you wouldn't be able to generate code or a standalone application for your Simulink model if you are using Simulation 3D blocks. The development team is aware of this limitation and may consider improving this in a future product release.
If you aren't using Simulation 3D blocks, then integrating is possible but this will likely be a tricky process as you have mentioned. For one, the generated Simulink code would need to be recompiled which requires dealing with any dependencies needed. You will likely also need to write some C++ code to expose the functions to blueprints etc if that is what you are using.
I apologize that there isn't a more straightforward approach for now... but we are aware of how useful this workflow can be!
Nishan
More Answers (1)
See Also
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!