mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-02 05:04:08 +08:00
EKF: Fix bug preventing reset to GPS position when using optical flow
This commit is contained in:
parent
460c9e5250
commit
a776b2c549
@ -329,21 +329,21 @@ void Ekf::controlGpsFusion()
|
||||
|
||||
// If the heading is valid start using gps aiding
|
||||
if (_control_status.flags.yaw_align) {
|
||||
_control_status.flags.gps = true;
|
||||
_time_last_gps = _time_last_imu;
|
||||
|
||||
// if we are not already aiding with optical flow, then we need to reset the position and velocity
|
||||
// otherwise we only need to reset the position
|
||||
_control_status.flags.gps = true;
|
||||
if (!_control_status.flags.opt_flow) {
|
||||
if (resetPosition() && resetVelocity()) {
|
||||
_control_status.flags.gps = true;
|
||||
|
||||
} else {
|
||||
if (!resetPosition() || !resetVelocity()) {
|
||||
_control_status.flags.gps = false;
|
||||
|
||||
}
|
||||
} else if (!resetPosition()) {
|
||||
_control_status.flags.gps = false;
|
||||
|
||||
}
|
||||
if (_control_status.flags.gps) {
|
||||
ECL_INFO("EKF commencing GPS aiding");
|
||||
_time_last_gps = _time_last_imu;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user