Unity-FMI-Addon
Unity-FMI-Addon copied to clipboard
Unity crash
When I use a .fmu file of 184 model variables, FMI2's variable "component" always set to 0x0. Then, when I play app, Unity crash.
I have the same problem with FMU's made in OpenModelica. From simulink it works with a hack (setting time to 0 every step).
Same problem here.
Simulink FMUs are working
FMUs from https://github.com/fmi-tools/cpp-fmus are crashing during FMI initialisation. FMPy can simulate these FMUs. So I guess the problem is in the Unity FMI Importer. Anyone has any clue why that is?
edit: Using Debug Logs in the FMI unity crashes during processing https://github.com/viproma/cppfmu/blob/100cdd288dd9deedd5eb0d20abddcc7cbc96fd53/fmi_functions.cpp#L495 in the FMU. My guess is, there is a problem with this cpp library and the C# FMI Importer. But I don't know for sure on which side the error is. (as the FMI can be simulated with FMPy, I guess the error is on the C# side, but I'm not an expert in this)
I have the same issue, Unity crashes when instantiating the fmu, at FMI2.cs -> Line 223:
component = fmi2Instantiate(instanceName, (int)fmi2Type.fmi2CoSimulation, guid, resourceLocation, callbacks, fmi2False, loggingOn ? fmi2True : fmi2False);
The FMU im using is made with OpenModelica:
I'm seeing a crash as well when initializing my own FMU, I think it's the same as described in this thread. The crash dump says
0xC0000090 The exponent of a floating-point operation is greater than the magnitude allowed by the corresponding type
The demo scene with the bouncing ball works fine.
I have the same issue, Unity crashes when instantiating the fmu, at FMI2.cs -> Line 223:
component = fmi2Instantiate(instanceName, (int)fmi2Type.fmi2CoSimulation, guid, resourceLocation, callbacks, fmi2False, loggingOn ? fmi2True : fmi2False);
The FMU im using is made with OpenModelica:
Exact same for me. Have you found a solution?