Skip to content

Commit 1d93c80

Browse files
committed
[MC-FMS] Fix mode degrade timing issue
1 parent 3f52af2 commit 1d93c80

9 files changed

Lines changed: 277 additions & 412 deletions

File tree

src/model/fms/mc_fms/lib/FMS.c

Lines changed: 244 additions & 387 deletions
Large diffs are not rendered by default.

src/model/fms/mc_fms/lib/FMS.h

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
*
44
* Code generated for Simulink model 'FMS'.
55
*
6-
* Model version : 1.2197
6+
* Model version : 1.2218
77
* Simulink Coder version : 9.0 (R2018b) 24-May-2018
8-
* C/C++ source code generated on : Fri Jul 4 09:55:30 2025
8+
* C/C++ source code generated on : Fri Aug 1 09:04:59 2025
99
*
1010
* Target selection: ert.tlc
1111
* Embedded hardware selection: ARM Compatible->ARM Cortex
@@ -108,6 +108,7 @@ typedef struct {
108108
Pilot_Cmd_Bus BusConversion_InsertedFor_FMS_f;
109109
Pilot_Cmd_Bus pilot_cmd; /* '<Root>/FMS State Machine' */
110110
Commander_In_Bus Cmd_In; /* '<Root>/FMS State Machine' */
111+
real_T degrade; /* '<Root>/SafeMode' */
111112
real_T stick_val[4]; /* '<Root>/FMS State Machine' */
112113
real_T lla[3]; /* '<Root>/FMS State Machine' */
113114
real_T llo[2]; /* '<Root>/FMS State Machine' */
@@ -208,6 +209,8 @@ typedef struct {
208209
int32_T durationLastReferenceTick_1_b;/* '<Root>/FMS State Machine' */
209210
int32_T durationLastReferenceTick_2_n;/* '<Root>/FMS State Machine' */
210211
int32_T M_qId; /* '<Root>/FMS State Machine' */
212+
uint32_T flag_prev; /* '<Root>/SafeMode' */
213+
uint32_T flag_start; /* '<Root>/SafeMode' */
211214
uint32_T temporalCounter_i1; /* '<Root>/FMS State Machine' */
212215
uint32_T mission_timestamp_prev; /* '<Root>/FMS State Machine' */
213216
uint32_T mission_timestamp_start; /* '<Root>/FMS State Machine' */
@@ -217,8 +220,10 @@ typedef struct {
217220
FMS_Cmd cmd_start; /* '<Root>/FMS State Machine' */
218221
FMS_Cmd M_msgData; /* '<Root>/FMS State Machine' */
219222
FMS_Cmd M_msgReservedData; /* '<Root>/FMS State Machine' */
220-
PilotMode mode_prev; /* '<Root>/FMS State Machine' */
221-
PilotMode mode_start; /* '<Root>/FMS State Machine' */
223+
PilotMode mode_prev; /* '<Root>/SafeMode' */
224+
PilotMode mode_start; /* '<Root>/SafeMode' */
225+
PilotMode mode_prev_n; /* '<Root>/FMS State Machine' */
226+
PilotMode mode_start_a; /* '<Root>/FMS State Machine' */
222227
uint16_T nav_cmd; /* '<Root>/FMS State Machine' */
223228
uint16_T temporalCounter_i1_i; /* '<S114>/Motion State' */
224229
uint8_T Delay_DSTATE_o; /* '<S11>/Delay' */
@@ -248,8 +253,8 @@ typedef struct {
248253
uint8_T DiscreteTimeIntegrator5_IC_LOAD;/* '<S502>/Discrete-Time Integrator5' */
249254
uint8_T DiscreteTimeIntegrator5_IC_LO_a;/* '<S504>/Discrete-Time Integrator5' */
250255
uint8_T DiscreteTimeIntegrator5_IC_LO_g;/* '<S503>/Discrete-Time Integrator5' */
251-
uint8_T is_active_c3_FMS; /* '<Root>/SafeMode' */
252-
uint8_T is_c3_FMS; /* '<Root>/SafeMode' */
256+
uint8_T is_active_c1_FMS; /* '<Root>/SafeMode' */
257+
uint8_T is_Mode; /* '<Root>/SafeMode' */
253258
uint8_T is_active_c11_FMS; /* '<Root>/FMS State Machine' */
254259
uint8_T is_Command_Listener; /* '<Root>/FMS State Machine' */
255260
uint8_T is_active_Command_Listener; /* '<Root>/FMS State Machine' */

src/model/fms/mc_fms/lib/FMS_data.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
*
44
* Code generated for Simulink model 'FMS'.
55
*
6-
* Model version : 1.2197
6+
* Model version : 1.2218
77
* Simulink Coder version : 9.0 (R2018b) 24-May-2018
8-
* C/C++ source code generated on : Fri Jul 4 09:55:30 2025
8+
* C/C++ source code generated on : Fri Aug 1 09:04:59 2025
99
*
1010
* Target selection: ert.tlc
1111
* Embedded hardware selection: ARM Compatible->ARM Cortex

src/model/fms/mc_fms/lib/FMS_private.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
*
44
* Code generated for Simulink model 'FMS'.
55
*
6-
* Model version : 1.2197
6+
* Model version : 1.2218
77
* Simulink Coder version : 9.0 (R2018b) 24-May-2018
8-
* C/C++ source code generated on : Fri Jul 4 09:55:30 2025
8+
* C/C++ source code generated on : Fri Aug 1 09:04:59 2025
99
*
1010
* Target selection: ert.tlc
1111
* Embedded hardware selection: ARM Compatible->ARM Cortex

src/model/fms/mc_fms/lib/FMS_types.h

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
*
44
* Code generated for Simulink model 'FMS'.
55
*
6-
* Model version : 1.2197
6+
* Model version : 1.2218
77
* Simulink Coder version : 9.0 (R2018b) 24-May-2018
8-
* C/C++ source code generated on : Fri Jul 4 09:55:30 2025
8+
* C/C++ source code generated on : Fri Aug 1 09:04:59 2025
99
*
1010
* Target selection: ert.tlc
1111
* Embedded hardware selection: ARM Compatible->ARM Cortex
@@ -425,10 +425,7 @@ typedef enum {
425425
VehicleState_InvalidArmMode,
426426
VehicleState_Land,
427427
VehicleState_Return,
428-
VehicleState_Takeoff,
429-
VehicleState_Climb,
430-
VehicleState_Climb_Manual,
431-
VehicleState_Climb_Sideway
428+
VehicleState_Takeoff
432429
} VehicleState;
433430

434431
#endif
@@ -483,6 +480,9 @@ typedef struct {
483480

484481
/* Set speed for cuise flight */
485482
real32_T set_speed;
483+
484+
/* Set yaw angle in rad, valid range is [0 360]. Set to negative to ignore */
485+
real32_T set_yaw;
486486
} Commander_In_Bus;
487487

488488
#endif
@@ -497,7 +497,10 @@ typedef enum {
497497
NAV_Cmd_Return = 20,
498498
NAV_Cmd_Land,
499499
NAV_Cmd_Takeoff,
500-
NAV_Cmd_SetSpeed = 178
500+
NAV_Cmd_VTOL_Takeoff = 84,
501+
NAV_Cmd_VTOL_Land,
502+
NAV_Cmd_SetSpeed = 178,
503+
NAV_Cmd_VTOL_Transition = 3000
501504
} NAV_Cmd;
502505

503506
#endif

src/model/fms/mc_fms/lib/builtin_typeid_types.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
*
44
* Code generated for Simulink model 'FMS'.
55
*
6-
* Model version : 1.2197
6+
* Model version : 1.2218
77
* Simulink Coder version : 9.0 (R2018b) 24-May-2018
8-
* C/C++ source code generated on : Fri Jul 4 09:55:30 2025
8+
* C/C++ source code generated on : Fri Aug 1 09:04:59 2025
99
*
1010
* Target selection: ert.tlc
1111
* Embedded hardware selection: ARM Compatible->ARM Cortex

src/model/fms/mc_fms/lib/rtmodel.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
*
44
* Code generated for Simulink model 'FMS'.
55
*
6-
* Model version : 1.2197
6+
* Model version : 1.2218
77
* Simulink Coder version : 9.0 (R2018b) 24-May-2018
8-
* C/C++ source code generated on : Fri Jul 4 09:55:30 2025
8+
* C/C++ source code generated on : Fri Aug 1 09:04:59 2025
99
*
1010
* Target selection: ert.tlc
1111
* Embedded hardware selection: ARM Compatible->ARM Cortex

src/model/fms/mc_fms/lib/rtwtypes.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
*
44
* Code generated for Simulink model 'FMS'.
55
*
6-
* Model version : 1.2197
6+
* Model version : 1.2218
77
* Simulink Coder version : 9.0 (R2018b) 24-May-2018
8-
* C/C++ source code generated on : Fri Jul 4 09:55:30 2025
8+
* C/C++ source code generated on : Fri Aug 1 09:04:59 2025
99
*
1010
* Target selection: ert.tlc
1111
* Embedded hardware selection: ARM Compatible->ARM Cortex

src/model/fms/mc_fms/lib/zero_crossing_types.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
*
44
* Code generated for Simulink model 'FMS'.
55
*
6-
* Model version : 1.2197
6+
* Model version : 1.2218
77
* Simulink Coder version : 9.0 (R2018b) 24-May-2018
8-
* C/C++ source code generated on : Fri Jul 4 09:55:30 2025
8+
* C/C++ source code generated on : Fri Aug 1 09:04:59 2025
99
*
1010
* Target selection: ert.tlc
1111
* Embedded hardware selection: ARM Compatible->ARM Cortex

0 commit comments

Comments
 (0)