I need to make a FMI-FMU Simulation in Unity

120 views Asked by At

I am a software engineer that recently tasked with an important mission at hand. My mission is to create a software that uses Unity Engine to convert and simulate FMU's. From what I researched so far I need to call functions in FMU's DLL's. Is there anyone who has this type of knowledge?

So far I read the documentation a little bit. Couldn't figure out how to do it or what should my roadmap be. I asked ChatBots to what to do and they said similar things like learn c# better, read modelica documentation etc.. Yesterday in order to understand more I asked Modelica Association and they gave me this reply.

"In any case, if you want to convert (whatever that means) and simulate FMUs, no knowledge of Modelica is required, nor you need to understand C to understand Modelica. FMUs compute the behaviour of hybrid dynamic systems, using either pre-compiled DLLs/shared libraries or source-code C, according to an API described in the standard. So, if Unity can call functions in a DLL, you are pretty much done, you only need to understand what they mean and when/how to call them, which is also explained in the standard."

So now, I never worked with pre-compiled dll libraries of another software. I don't know what to do. If anyone helps I would be really grateful.


2

There are 2 answers

2
Christian Bertsch On

There is a soluation available to simulate FMUs in Unity: https://github.com/CATIA-Systems/Unity-FMI-Addon

For a general introduction to FMI I would like to refer you to the FMI beginners' tutorial from the Modelica Conference 2023 https://github.com/modelica/fmi-beginners-tutorial-2023 and the "Getting started" on https://fmi-standard.org/

4
janpeter On

There is a popular package for simulation of FMU called PyFMI that you find here https://github.com/modelon-community/PyFMI and the report mentioned there by Andersson et al from 2016 give you some broader introduction that might be helpful for you. Another package is FMPy that you find here https://github.com/CATIA-Systems/FMPy, but here is no introductory report to my knowledge. The FMI-standard https://fmi-standard.org may also be useful. But I would start with the report by Andersson et al from 2016 that you can easily find on internet. Good luck!