mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-02 03:49:12 +08:00
ekf2: remove landed flag and use control_status directly
This commit is contained in:
@@ -1413,7 +1413,7 @@ void EKF2::UpdateMagCalibration(const hrt_abstime ×tamp)
|
|||||||
_ekf.get_filter_fault_status(&fault_status.value);
|
_ekf.get_filter_fault_status(&fault_status.value);
|
||||||
|
|
||||||
// Check if conditions are OK for learning of magnetometer bias values
|
// Check if conditions are OK for learning of magnetometer bias values
|
||||||
if (!_landed && _armed &&
|
if (control_status.flags.in_air && _armed &&
|
||||||
!fault_status.value && // there are no filter faults
|
!fault_status.value && // there are no filter faults
|
||||||
control_status.flags.mag_3D) { // the EKF is operating in the correct mode
|
control_status.flags.mag_3D) { // the EKF is operating in the correct mode
|
||||||
|
|
||||||
|
|||||||
@@ -227,7 +227,6 @@ private:
|
|||||||
bool _distance_sensor_selected{false}; // because we can have several distance sensor instances with different orientations
|
bool _distance_sensor_selected{false}; // because we can have several distance sensor instances with different orientations
|
||||||
bool _armed{false};
|
bool _armed{false};
|
||||||
bool _standby{false}; // standby arming state
|
bool _standby{false}; // standby arming state
|
||||||
bool _landed{true};
|
|
||||||
bool _in_ground_effect{false};
|
bool _in_ground_effect{false};
|
||||||
|
|
||||||
uORB::PublicationMulti<ekf2_timestamps_s> _ekf2_timestamps_pub{ORB_ID(ekf2_timestamps)};
|
uORB::PublicationMulti<ekf2_timestamps_s> _ekf2_timestamps_pub{ORB_ID(ekf2_timestamps)};
|
||||||
|
|||||||
Reference in New Issue
Block a user