mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-10 06:39:25 +08:00
fix(ekf2): disable mag fusion while constant_pos is active
This commit is contained in:
committed by
Marco Hauswirth
parent
df05252c74
commit
bcbb529339
@@ -190,11 +190,13 @@ void Ekf::controlMagFusion(const imuSample &imu_sample)
|
||||
|
||||
_control_status.flags.mag_3D = common_conditions_passing
|
||||
&& (_params.ekf2_mag_type == static_cast<int32_t>(MagFuseType::AUTO))
|
||||
&& _control_status.flags.mag_aligned_in_flight;
|
||||
&& _control_status.flags.mag_aligned_in_flight
|
||||
&& !_control_status.flags.constant_pos;
|
||||
|
||||
_control_status.flags.mag_hdg = common_conditions_passing
|
||||
&& ((_params.ekf2_mag_type == static_cast<int32_t>(MagFuseType::HEADING))
|
||||
|| (_params.ekf2_mag_type == static_cast<int32_t>(MagFuseType::AUTO) && !_control_status.flags.mag_3D));
|
||||
|| (_params.ekf2_mag_type == static_cast<int32_t>(MagFuseType::AUTO) && !_control_status.flags.mag_3D))
|
||||
&& !_control_status.flags.constant_pos;
|
||||
}
|
||||
|
||||
if (_control_status.flags.mag_3D && !_control_status_prev.flags.mag_3D) {
|
||||
|
||||
Reference in New Issue
Block a user