3 #if HAL_CPU_CLASS >= HAL_CPU_CLASS_150 49 const float posFiltTimeConst = 10.0f;
57 gpsDriftNE *= (1.0f - deltaTime/posFiltTimeConst);
68 "GPS drift %.1fm (needs %.1f)", (
double)
gpsDriftNE, (
double)(3.0
f*checkScaler));
83 gpsVertVelFail =
true;
89 gcs().
send_text(MAV_SEVERITY_WARNING,
"EK3: Changed EK3_GPS_TYPE to 1");
92 gpsVertVelFail =
false;
99 "GPS vertical speed %.2fm/s (needs %.2f)", (
double)fabsf(
gpsVertVelFilt), (
double)(0.3
f*checkScaler));
107 bool gpsHorizVelFail;
113 gpsHorizVelFail =
false;
117 if (gpsHorizVelFail) {
120 "GPS horizontal speed %.2fm/s (needs %.2f)", (
double)
gpsDriftNE, (
double)(0.3
f*checkScaler));
139 "GPS horiz error %.1fm (needs %.1f)", (
double)hAcc, (
double)(5.0
f*checkScaler));
148 bool vAccFail =
false;
156 "GPS vert error %.1fm (needs < %.1f)", (
double)vAcc, (
double)(7.5
f * checkScaler));
169 "GPS speed error %.1f (needs %.1f)", (
double)
gpsSpdAccuracy, (
double)(1.0
f*checkScaler));
181 "GPS HDOP %.1f (needs 2.5)", (
double)(0.01
f * gps.
get_hdop()));
193 "GPS numsats %u (needs 6)", gps.
num_sats());
212 "Mag yaw error x=%.1f y=%.1f",
227 if (gpsSpdAccFail || numSatsFail || hdopFail || hAccFail || vAccFail || yawFail || gpsDriftFail || gpsVertVelFail || gpsHorizVelFail) {
244 const float alpha1 = 0.2f;
245 const float tau = 10.0f;
255 if (!
AP::gps().speed_accuracy(gpsSpdAccRaw)) {
266 if (sAccFilterState2 > 1.5
f ) {
268 }
else if(sAccFilterState2 < 1.0
f) {
310 bool highGndSpd =
false;
311 bool highAirSpd =
false;
312 bool largeHgtChange =
false;
328 if (fabsf(
hgtMea) > 10.0f) {
329 largeHgtChange =
true;
333 if (
motorsArmed && highGndSpd && (highAirSpd || largeHgtChange)) {
339 if (
motorsArmed && (highGndSpd || highAirSpd || largeHgtChange)) {
462 angRateVec = ins.
get_gyro() - gyroBias;
472 #endif // HAL_CPU_CLASS
float norm(const T first, const U second, const Params... parameters)
char prearm_fail_string[40]
gps_elements gpsDataDelayed
bool calcGpsGoodToAlign(void)
uint32_t terrainHgtStableSet_ms
bool magStateInitComplete
uint32_t lastInnovPassTime_ms
Quaternion quatAtLastMagReset
bool expectGndEffectTouchdown
imu_elements imuDataDelayed
const Vector3f & get_gyro(uint8_t i) const
Interface definition for the various Ground Control System.
bool assume_zero_sideslip(void) const
float get_airspeed(uint8_t i) const
range_elements rangeDataNew
void calcGpsGoodForFlight(void)
void getGyroBias(Vector3f &gyroBias) const
const Location & location(uint8_t instance) const
float posDownAtLastMagReset
static auto MAX(const A &one, const B &two) -> decltype(one > two ? one :two)
struct NavEKF3_core::state_elements & stateStruct
static AP_InertialSensor ins
bool use_compass(void) const
const AP_Airspeed * get_airspeed(void) const
Vector2f location_diff(const struct Location &loc1, const struct Location &loc2)
bool expectGndEffectTakeoff
const AP_HAL::HAL & hal
-*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*-
float yawInnovAtLastMagReset
uint32_t lastPreAlignGpsCheckTime_ms
void setTakeoffExpected(bool val)
#define MASK_GPS_HORIZ_SPD
void detectOptFlowTakeoff(void)
uint16_t get_hdop(uint8_t instance) const
struct Location gpsloc_prev
void send_text(MAV_SEVERITY severity, const char *fmt,...)
uint32_t magYawResetTimer_ms
GPS_Status status(uint8_t instance) const
Query GPS status.
uint32_t lastGpsCheckTime_ms
struct NavEKF3_core::@154 gpsCheckStatus
float constrain_float(const float amt, const float low, const float high)
float get_EAS2TAS(uint8_t i) const
uint8_t num_sats(uint8_t instance) const
uint32_t touchdownExpectedSet_ms
int snprintf(char *str, size_t size, const char *format,...)
bool getTouchdownExpected()
uint32_t takeoffExpectedSet_ms
uint32_t get_time_flying_ms(void) const
bool getTakeoffExpected()
const uint16_t gndEffectTimeout_ms
AP_InertialSensor & ins()
#define MASK_GPS_POS_DRIFT
void setTouchdownExpected(bool val)
bool get_gyro_health(uint8_t instance) const
bool airspeed_sensor_enabled(void) const
Receiving valid messages and 3D lock.
bool vertical_accuracy(uint8_t instance, float &vacc) const
bool horizontal_accuracy(uint8_t instance, float &hacc) const
uint32_t imuSampleTime_ms
#define MASK_GPS_VERT_SPD
uint32_t lastGpsVelFail_ms
void setTerrainHgtStable(bool val)
uint32_t airborneDetectTime_ms
bool have_vertical_velocity(uint8_t instance) const
uint32_t lastInnovFailTime_ms