mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-23 17:37:34 +08:00
EKF: Fix GPS validity time check error
This commit is contained in:
committed by
Lorenz Meier
parent
0160aaa568
commit
092a8d8f21
+3
-2
@@ -1393,11 +1393,12 @@ void Ekf::controlMagFusion()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// If optical flow is the only aiding source and GPS checks are failing, then assume that we are operating
|
// If optical flow is the only aiding source and GPS checks are failing, then assume that we are operating
|
||||||
// indoors and the magnetometer is unreliable.
|
// indoors and the magnetometer is unreliable. Becasue the optical flow sensor is body fixed, absolute yaw
|
||||||
|
// wrt North is not required for navigation and it is safer not to use the magnetometer.
|
||||||
if (_control_status.flags.opt_flow
|
if (_control_status.flags.opt_flow
|
||||||
&& !_control_status.flags.gps
|
&& !_control_status.flags.gps
|
||||||
&& !_control_status.flags.ev_pos
|
&& !_control_status.flags.ev_pos
|
||||||
&& ((_last_gps_fail_us - _time_last_imu) < 5E6)) {
|
&& ((_time_last_imu - _last_gps_pass_us) > 5E6)) {
|
||||||
_mag_use_inhibit = true;
|
_mag_use_inhibit = true;
|
||||||
} else {
|
} else {
|
||||||
_mag_use_inhibit = false;
|
_mag_use_inhibit = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user