Skip to content

Commit

Permalink
feat(ap): add NAV on GA (flybywiresim#8483)
Browse files Browse the repository at this point in the history
* feat(ap): add NAV on GA
* chore: add changelog
* feat(ap): add NAV on GA and upgrade SM to MATLAB R2023b

---------

Co-authored-by: 2hwk <[email protected]>
  • Loading branch information
lukecologne and 2hwk authored Feb 14, 2024
1 parent bf32952 commit bdbc349
Show file tree
Hide file tree
Showing 13 changed files with 1,440 additions and 1,482 deletions.
1 change: 1 addition & 0 deletions .github/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
1. [AP] Increased nz limit for SRS mode during go-arounds - @aguther (Andreas Guther)
1. [AP] Further tuned Autoland in Crosswind Situations - @aguther (Andreas Guther)
1. [EFB] Automatically unfocus EFB input fields when the camera shifts away from the EFB - @tracernz (Mike)
1. [AP] Add NAV on GA capability - @lukecologne (luke)
1. [ND] Fix ND ETA of TO waypoint display prior to takeoff and after landing. - Alex Milshtein (@alexm1987 on Discord)

## 0.11.0
Expand Down
194 changes: 97 additions & 97 deletions fbw-a32nx/src/wasm/fbw_a320/src/model/AutopilotStateMachine.cpp

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions fbw-a32nx/src/wasm/fbw_a320/src/model/AutopilotStateMachine.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,8 @@ class AutopilotStateMachine final
boolean_T sTCAS_l;
boolean_T wasFlightPlanAvailable;
boolean_T wasFlightPlanAvailable_not_empty;
boolean_T state_c;
boolean_T wasInSrsGa;
boolean_T state_d;
boolean_T state_k;
boolean_T state_j;
boolean_T sFINAL_DES;
Expand Down Expand Up @@ -295,7 +296,6 @@ class AutopilotStateMachine final
void AutopilotStateMachine_RWY_TRK_entry(const ap_sm_output *BusAssignment);
void AutopilotStateMachine_GA_TRK_entry(const ap_sm_output *BusAssignment);
void AutopilotStateMachine_ON(const ap_sm_output *BusAssignment);
void AutopilotStateMachine_GA_TRK_during(void);
boolean_T AutopilotStateMachine_OFF_TO_HDG(const ap_sm_output *BusAssignment);
boolean_T AutopilotStateMachine_OFF_TO_NAV(const ap_sm_output *BusAssignment);
boolean_T AutopilotStateMachine_OFF_TO_RWY(const ap_sm_output *BusAssignment);
Expand Down
2 changes: 1 addition & 1 deletion fbw-a380x/src/wasm/fbw_a380/src/FlightDataRecorder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ void FlightDataRecorder::initialize() {
std::cout << "WASM: Flight Data Recorder Configuration : Interface Version = " << INTERFACE_VERSION << std::endl;
}

void FlightDataRecorder::update(AutopilotStateMachineModelClass* autopilotStateMachine,
void FlightDataRecorder::update(AutopilotStateMachine* autopilotStateMachine,
AutopilotLawsModelClass* autopilotLaws,
Autothrust* autoThrust,
const EngineData& engineData,
Expand Down
2 changes: 1 addition & 1 deletion fbw-a380x/src/wasm/fbw_a380/src/FlightDataRecorder.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class FlightDataRecorder {

void initialize();

void update(AutopilotStateMachineModelClass* autopilotStateMachine,
void update(AutopilotStateMachine* autopilotStateMachine,
AutopilotLawsModelClass* autopilotLaws,
Autothrust* autoThrust,
const EngineData& engineData,
Expand Down
4 changes: 2 additions & 2 deletions fbw-a380x/src/wasm/fbw_a380/src/FlyByWireInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ class FlyByWireInterface {

FailuresConsumer failuresConsumer;

AutopilotStateMachineModelClass autopilotStateMachine;
AutopilotStateMachineModelClass::ExternalInputs_AutopilotStateMachine_T autopilotStateMachineInput = {};
AutopilotStateMachine autopilotStateMachine;
AutopilotStateMachine::ExternalInputs_AutopilotStateMachine_T autopilotStateMachineInput = {};
ap_raw_laws_input autopilotStateMachineOutput;

AutopilotLawsModelClass autopilotLaws;
Expand Down
2,401 changes: 1,163 additions & 1,238 deletions fbw-a380x/src/wasm/fbw_a380/src/model/AutopilotStateMachine.cpp

Large diffs are not rendered by default.

87 changes: 43 additions & 44 deletions fbw-a380x/src/wasm/fbw_a380/src/model/AutopilotStateMachine.h
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
#ifndef RTW_HEADER_AutopilotStateMachine_h_
#define RTW_HEADER_AutopilotStateMachine_h_
#include <cmath>
#include "rtwtypes.h"
#include "AutopilotStateMachine_types.h"

#include "multiword_types.h"

class AutopilotStateMachineModelClass
class AutopilotStateMachine final
{
public:
struct BlockIO_AutopilotStateMachine_T {
ap_sm_output BusAssignment_g;
ap_vertical_output out;
ap_lateral_output out_n;
ap_lateral_output out_p;
};

struct D_Work_AutopilotStateMachine_T {
Expand Down Expand Up @@ -44,25 +41,25 @@ class AutopilotStateMachineModelClass
real_T nav_gs_deg;
real_T eventTime;
real_T eventTime_n;
real_T eventTime_m;
real_T eventTime_mz;
real_T eventTime_e;
real_T eventTime_h;
real_T pY;
real_T pU;
real_T lastTargetSpeed;
real_T timeDeltaSpeed4;
real_T timeDeltaSpeed10;
real_T timeConditionSoftAlt;
real_T eventTime_o;
real_T eventTime_g;
real_T runwayHeadingStored;
real_T eventTime_n4;
real_T eventTime_i;
real_T eventTime_p;
real_T eventTime_ht;
real_T eventTime_l;
real_T eventTime_k;
real_T eventTime_c;
real_T eventTime_b;
real_T eventTime_i;
real_T eventTime_a;
real_T eventTime_ae;
real_T eventTime_a2;
real_T eventTime_ec;
real_T canArm;
real_T canArm_b;
real_T canArm_i;
boolean_T DelayInput1_DSTATE_a;
boolean_T DelayInput1_DSTATE_p;
boolean_T DelayInput1_DSTATE_bo;
Expand All @@ -86,14 +83,14 @@ class AutopilotStateMachineModelClass
uint8_T is_c5_AutopilotStateMachine;
uint8_T is_active_c1_AutopilotStateMachine;
uint8_T is_c1_AutopilotStateMachine;
uint8_T is_ON_l;
uint8_T is_ON_j;
uint8_T is_LOC;
boolean_T local_TCAS_TRK_FPA_Reverted;
boolean_T local_TCAS_is_corrective;
boolean_T wereAllEnginesOperative;
boolean_T wereAllEnginesOperative_not_empty;
boolean_T wereAllEnginesOperative_h;
boolean_T wereAllEnginesOperative_not_empty_g;
boolean_T wereAllEnginesOperative_b;
boolean_T wereAllEnginesOperative_not_empty_p;
boolean_T prevNumberofAutopilotsEngaged_not_empty;
boolean_T verticalSpeedCancelMode;
boolean_T eventTimeTC_not_empty;
Expand All @@ -111,9 +108,9 @@ class AutopilotStateMachineModelClass
boolean_T prev_FDES_active;
boolean_T prev_FDES_armed;
boolean_T eventTime_not_empty;
boolean_T eventTime_not_empty_p;
boolean_T eventTime_not_empty_a;
boolean_T eventTime_not_empty_l;
boolean_T eventTime_not_empty_i;
boolean_T eventTime_not_empty_c;
boolean_T eventTime_not_empty_o;
boolean_T pY_not_empty;
boolean_T pU_not_empty;
boolean_T lastTargetSpeed_not_empty;
Expand All @@ -125,27 +122,28 @@ class AutopilotStateMachineModelClass
boolean_T sTCAS;
boolean_T latch;
boolean_T sSRS;
boolean_T eventTime_not_empty_k;
boolean_T state;
boolean_T eventTime_not_empty_f;
boolean_T eventTime_not_empty_j;
boolean_T eventTime_not_empty_m;
boolean_T state;
boolean_T eventTime_not_empty_l;
boolean_T eventTime_not_empty_k;
boolean_T eventTime_not_empty_k5;
boolean_T sThrottleCondition;
boolean_T eventTime_not_empty_d;
boolean_T eventTime_not_empty_i;
boolean_T eventTime_not_empty_b;
boolean_T eventTime_not_empty_kh;
boolean_T sTCAS_g;
boolean_T eventTime_not_empty_ow;
boolean_T eventTime_not_empty_m;
boolean_T eventTime_not_empty_ma;
boolean_T eventTime_not_empty_g;
boolean_T sTCAS_l;
boolean_T wasFlightPlanAvailable;
boolean_T wasFlightPlanAvailable_not_empty;
boolean_T state_e;
boolean_T state_i;
boolean_T state_n;
boolean_T wasInSrsGa;
boolean_T state_d;
boolean_T state_k;
boolean_T state_j;
boolean_T sFINAL_DES;
boolean_T sDES;
boolean_T sCLB;
boolean_T was_TCAS_active;
boolean_T newFcuAltitudeSelected_h;
boolean_T newFcuAltitudeSelected_j;
};

struct ExternalInputs_AutopilotStateMachine_T {
Expand Down Expand Up @@ -250,8 +248,10 @@ class AutopilotStateMachineModelClass
real_T Falling_Value_as;
};

AutopilotStateMachineModelClass(AutopilotStateMachineModelClass const&) =delete;
AutopilotStateMachineModelClass& operator= (AutopilotStateMachineModelClass const&) & = delete;
AutopilotStateMachine(AutopilotStateMachine const&) = delete;
AutopilotStateMachine& operator= (AutopilotStateMachine const&) & = delete;
AutopilotStateMachine(AutopilotStateMachine &&) = delete;
AutopilotStateMachine& operator= (AutopilotStateMachine &&) = delete;
void setExternalInputs(const ExternalInputs_AutopilotStateMachine_T *pExternalInputs_AutopilotStateMachine_T)
{
AutopilotStateMachine_U = *pExternalInputs_AutopilotStateMachine_T;
Expand All @@ -265,8 +265,8 @@ class AutopilotStateMachineModelClass
void initialize();
void step();
static void terminate();
AutopilotStateMachineModelClass();
~AutopilotStateMachineModelClass();
AutopilotStateMachine();
~AutopilotStateMachine();
private:
ExternalInputs_AutopilotStateMachine_T AutopilotStateMachine_U;
ExternalOutputs_AutopilotStateMachine_T AutopilotStateMachine_Y;
Expand Down Expand Up @@ -296,7 +296,6 @@ class AutopilotStateMachineModelClass
void AutopilotStateMachine_RWY_TRK_entry(const ap_sm_output *BusAssignment);
void AutopilotStateMachine_GA_TRK_entry(const ap_sm_output *BusAssignment);
void AutopilotStateMachine_ON(const ap_sm_output *BusAssignment);
void AutopilotStateMachine_GA_TRK_during(void);
boolean_T AutopilotStateMachine_OFF_TO_HDG(const ap_sm_output *BusAssignment);
boolean_T AutopilotStateMachine_OFF_TO_NAV(const ap_sm_output *BusAssignment);
boolean_T AutopilotStateMachine_OFF_TO_RWY(const ap_sm_output *BusAssignment);
Expand All @@ -309,7 +308,7 @@ class AutopilotStateMachineModelClass
boolean_T AutopilotStateMachine_getTcasSubModeCompatibility(void) const;
void AutopilotStateMachine_TCAS_during(void);
void AutopilotStateMachine_TCAS_exit(void);
void AutopilotStateMachine_OFF_entry_p(void);
void AutopilotStateMachine_OFF_entry_m(void);
void AutopilotStateMachine_DES_entry(void);
void AutopilotStateMachine_CLB_entry(void);
void AutopilotStateMachine_OP_CLB_entry(void);
Expand Down Expand Up @@ -343,13 +342,13 @@ class AutopilotStateMachineModelClass
void AutopilotStateMachine_DES(void);
void AutopilotStateMachine_FINAL_DES_during(void);
void AutopilotStateMachine_FLARE_during(void);
void AutopilotStateMachine_ROLL_OUT_entry_m(void);
void AutopilotStateMachine_ROLL_OUT_entry_e(void);
boolean_T AutopilotStateMachine_GS_TO_X(void) const;
boolean_T AutopilotStateMachine_GS_TO_X_MR(void) const;
boolean_T AutopilotStateMachine_GS_TO_ALT(void) const;
void AutopilotStateMachine_GS_TRACK_entry(void);
void AutopilotStateMachine_LAND_entry_p(void);
void AutopilotStateMachine_FLARE_entry_e(void);
void AutopilotStateMachine_LAND_entry_b(void);
void AutopilotStateMachine_FLARE_entry_m(void);
void AutopilotStateMachine_GS(void);
void AutopilotStateMachine_OP_CLB_during(void);
void AutopilotStateMachine_OP_CLB_exit(void);
Expand All @@ -359,7 +358,7 @@ class AutopilotStateMachineModelClass
void AutopilotStateMachine_SRS_during(void);
void AutopilotStateMachine_SRS(void);
void AutopilotStateMachine_exit_internal_ON(void);
void AutopilotStateMachine_ON_l(void);
void AutopilotStateMachine_ON_p(void);
void AutopilotStateMachine_SRS_GA_during(void);
};

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#include "AutopilotStateMachine.h"
#include "AutopilotStateMachine_private.h"

AutopilotStateMachineModelClass::Parameters_AutopilotStateMachine_T AutopilotStateMachineModelClass::
AutopilotStateMachine_P{
AutopilotStateMachine::Parameters_AutopilotStateMachine_T AutopilotStateMachine::AutopilotStateMachine_P{

{
{
Expand Down Expand Up @@ -137,7 +135,7 @@ AutopilotStateMachineModelClass::Parameters_AutopilotStateMachine_T AutopilotSta
false,
false,
0.0,
fm_requested_vertical_mode_NONE,
fm_requested_vertical_mode::NONE,
0.0,
0.0,
false,
Expand Down Expand Up @@ -167,10 +165,10 @@ AutopilotStateMachineModelClass::Parameters_AutopilotStateMachine_T AutopilotSta
},

{
lateral_mode_NONE,
lateral_mode::NONE,
false,
false,
lateral_law_NONE,
lateral_law::NONE,
0.0
}
},
Expand All @@ -192,10 +190,10 @@ AutopilotStateMachineModelClass::Parameters_AutopilotStateMachine_T AutopilotSta
},

{
lateral_mode_NONE,
lateral_mode::NONE,
false,
false,
lateral_law_NONE,
lateral_law::NONE,
0.0
}
},
Expand Down Expand Up @@ -232,12 +230,12 @@ AutopilotStateMachineModelClass::Parameters_AutopilotStateMachine_T AutopilotSta
},

{
vertical_mode_NONE,
athr_requested_mode_NONE,
vertical_mode::NONE,
athr_requested_mode::NONE,
false,
0.0,
false,
vertical_law_NONE,
vertical_law::NONE,
0.0,
0.0,
0.0,
Expand All @@ -248,7 +246,7 @@ AutopilotStateMachineModelClass::Parameters_AutopilotStateMachine_T AutopilotSta
false,
false,
false,
NONE,
tcas_sub_mode::NONE,
false,
false,
false,
Expand Down Expand Up @@ -288,12 +286,12 @@ AutopilotStateMachineModelClass::Parameters_AutopilotStateMachine_T AutopilotSta
},

{
vertical_mode_NONE,
athr_requested_mode_NONE,
vertical_mode::NONE,
athr_requested_mode::NONE,
false,
0.0,
false,
vertical_law_NONE,
vertical_law::NONE,
0.0,
0.0,
0.0,
Expand All @@ -304,7 +302,7 @@ AutopilotStateMachineModelClass::Parameters_AutopilotStateMachine_T AutopilotSta
false,
false,
false,
NONE,
tcas_sub_mode::NONE,
false,
false,
false,
Expand Down Expand Up @@ -474,12 +472,12 @@ AutopilotStateMachineModelClass::Parameters_AutopilotStateMachine_T AutopilotSta
},

{
vertical_mode_NONE,
athr_requested_mode_NONE,
vertical_mode::NONE,
athr_requested_mode::NONE,
false,
0.0,
false,
vertical_law_NONE,
vertical_law::NONE,
0.0,
0.0,
0.0,
Expand All @@ -490,7 +488,7 @@ AutopilotStateMachineModelClass::Parameters_AutopilotStateMachine_T AutopilotSta
false,
false,
false,
NONE,
tcas_sub_mode::NONE,
false,
false,
false,
Expand All @@ -516,10 +514,10 @@ AutopilotStateMachineModelClass::Parameters_AutopilotStateMachine_T AutopilotSta
},

{
lateral_mode_NONE,
lateral_mode::NONE,
false,
false,
lateral_law_NONE,
lateral_law::NONE,
0.0
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#define RTW_HEADER_AutopilotStateMachine_private_h_
#include "rtwtypes.h"
#include "multiword_types.h"
#include "AutopilotStateMachine_types.h"
#ifndef UCHAR_MAX
#include <limits.h>
#endif
Expand Down
Loading

0 comments on commit bdbc349

Please sign in to comment.