AP_ExternalAHRS: added support for GPS disable and fwd flight

allow backends to determine if we are in fixed wing flight and/or the
GPS is disabled by the user
This commit is contained in:
Andrew Tridgell 2024-02-16 10:37:34 +11:00 committed by Randy Mackay
parent 2895fd3bec
commit 1f1392ddbc
3 changed files with 28 additions and 2 deletions

View File

@ -164,6 +164,11 @@ public:
float temperature; // degC float temperature; // degC
} airspeed_data_message_t; } airspeed_data_message_t;
// set GNSS disable for auxillary function GPS_DISABLE
void set_gnss_disable(bool disable) {
gnss_is_disabled = disable;
}
protected: protected:
enum class OPTIONS { enum class OPTIONS {
@ -193,6 +198,9 @@ private:
} }
uint32_t last_log_ms; uint32_t last_log_ms;
// true when user has disabled the GNSS
bool gnss_is_disabled;
}; };
namespace AP { namespace AP {

View File

@ -17,6 +17,7 @@
*/ */
#include "AP_ExternalAHRS_backend.h" #include "AP_ExternalAHRS_backend.h"
#include <AP_AHRS/AP_AHRS.h>
#if HAL_EXTERNAL_AHRS_ENABLED #if HAL_EXTERNAL_AHRS_ENABLED
@ -37,5 +38,10 @@ bool AP_ExternalAHRS_backend::option_is_set(AP_ExternalAHRS::OPTIONS option) con
return frontend.option_is_set(option); return frontend.option_is_set(option);
} }
bool AP_ExternalAHRS_backend::in_fly_forward(void) const
{
return AP::ahrs().get_fly_forward();
}
#endif // HAL_EXTERNAL_AHRS_ENABLED #endif // HAL_EXTERNAL_AHRS_ENABLED

View File

@ -58,6 +58,18 @@ protected:
frontend.set_default_sensors(sensors); frontend.set_default_sensors(sensors);
} }
/*
return true if the GNSS is disabled
*/
bool gnss_is_disabled(void) const {
return frontend.gnss_is_disabled;
}
/*
return true when we are in fixed wing flight
*/
bool in_fly_forward(void) const;
private: private:
AP_ExternalAHRS &frontend; AP_ExternalAHRS &frontend;
}; };