mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-02-06 03:13:00 +08:00
ekf2: fuse airspeed & beta only in fronttransition and fixed wing (#25980)
This allows airspeed and sideslip fusion to start during VTOL front transition, but not in backtransition or MC. This mitigates issues seen due to going in and out of airspeed fusion in strong headwinds in MC. Co-authored-by: bresch <brescianimathieu@gmail.com>
This commit is contained in:
@@ -96,7 +96,8 @@ void Ekf::controlAirDataFusion(const imuSample &imu_delayed)
|
||||
_innov_check_fail_status.flags.reject_airspeed =
|
||||
_aid_src_airspeed.innovation_rejected; // TODO: remove this redundant flag
|
||||
|
||||
const bool continuing_conditions_passing = _control_status.flags.in_air
|
||||
const bool continuing_conditions_passing = _control_status.flags.in_air && (_control_status.flags.fixed_wing
|
||||
|| _control_status.flags.in_transition_to_fw)
|
||||
&& !_control_status.flags.fake_pos;
|
||||
|
||||
const bool is_airspeed_significant = airspeed_sample.true_airspeed > _params.ekf2_arsp_thr;
|
||||
|
||||
@@ -267,6 +267,7 @@ struct systemFlagUpdate {
|
||||
bool is_fixed_wing{false};
|
||||
bool gnd_effect{false};
|
||||
bool constant_pos{false};
|
||||
bool in_transition_to_fw{false};
|
||||
};
|
||||
|
||||
struct parameters {
|
||||
@@ -611,6 +612,8 @@ uint64_t gnss_fault :
|
||||
uint64_t yaw_manual : 1; ///< 46 - true if yaw has been reset manually
|
||||
uint64_t gnss_hgt_fault :
|
||||
1; ///< 47 - true if GNSS measurements (alt) have been declared faulty and are no longer used
|
||||
uint64_t in_transition_to_fw : 1; ///< 48 - true if the vehicle is in transition to fw
|
||||
|
||||
} flags;
|
||||
uint64_t value;
|
||||
};
|
||||
|
||||
@@ -58,6 +58,7 @@ void Ekf::controlFusionModes(const imuSample &imu_delayed)
|
||||
set_in_air_status(system_flags_delayed.in_air);
|
||||
|
||||
set_is_fixed_wing(system_flags_delayed.is_fixed_wing);
|
||||
set_in_transition_to_fw(system_flags_delayed.in_transition_to_fw);
|
||||
|
||||
if (system_flags_delayed.gnd_effect) {
|
||||
set_gnd_effect();
|
||||
|
||||
@@ -200,6 +200,8 @@ public:
|
||||
// set vehicle is fixed wing status
|
||||
void set_is_fixed_wing(bool is_fixed_wing) { _control_status.flags.fixed_wing = is_fixed_wing; }
|
||||
|
||||
void set_in_transition_to_fw(bool in_transition) { _control_status.flags.in_transition_to_fw = in_transition; }
|
||||
|
||||
// set flag if static pressure rise due to ground effect is expected
|
||||
// use _params.ekf2_gnd_eff_dz to adjust for expected rise in static pressure
|
||||
// flag will clear after GNDEFFECT_TIMEOUT uSec
|
||||
|
||||
@@ -2622,6 +2622,7 @@ void EKF2::UpdateSystemFlagsSample(ekf2_timestamps_s &ekf2_timestamps)
|
||||
|
||||
// let the EKF know if the vehicle motion is that of a fixed wing (forward flight only relative to wind)
|
||||
flags.is_fixed_wing = (vehicle_status.vehicle_type == vehicle_status_s::VEHICLE_TYPE_FIXED_WING);
|
||||
flags.in_transition_to_fw = vehicle_status.in_transition_to_fw;
|
||||
|
||||
#if defined(CONFIG_EKF2_SIDESLIP)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user