Converting a simulink model (containing a state space block) into a DLL

1 次查看(过去 30 天)
I'm trying to convert a Simple Longitudanal Autopilot for a fixed wing aircraft into a DLL and then call that DLL from a Unity Script for Flight Visualization. I have figured out how to convert a simple simulink model (like sum of two numbers) and convert that into a DLL and call it from Unity.
However, when I try to convert this state space model into a DLL and run it from Unity, it crashes. I have attached a screenshot of the simulink block below:
Furthermore, I suspect the source of the error is coming from this part of the generated code:
static void rt_ertODEUpdateContinuousStates(RTWSolverInfo *si ,
RT_MODEL_pitchautopilot_T *const pitchautopilot_M, real_T
pitchautopilot_U_Pitch_Input, real_T *pitchautopilot_Y_Angle_of_Attack, real_T
*pitchautopilot_Y_Pitch_Rate, real_T *pitchautopilot_Y_Pitch_Output)
Is this the function I need to call from Unity? And if so, what is the data type of RTWSolverInfo *si?

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Simulink 的更多信息

产品


版本

R2022a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by