mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-02 12:11:37 +08:00
EKF: When commencing GPS aiding, don't reset local position and velocity if using optical flow
This commit is contained in:
+6
-3
@@ -121,12 +121,15 @@ void Ekf::controlFusionModes()
|
|||||||
_control_status.flags.yaw_align = resetMagHeading(_mag_sample_delayed.mag);
|
_control_status.flags.yaw_align = resetMagHeading(_mag_sample_delayed.mag);
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the heading is valid, reset the positon and velocity and start using gps aiding
|
// If the heading is valid start using gps aiding
|
||||||
if (_control_status.flags.yaw_align) {
|
if (_control_status.flags.yaw_align) {
|
||||||
resetPosition();
|
|
||||||
resetVelocity();
|
|
||||||
_control_status.flags.gps = true;
|
_control_status.flags.gps = true;
|
||||||
_time_last_gps = _time_last_imu;
|
_time_last_gps = _time_last_imu;
|
||||||
|
// if we are not already aiding with optical flow, then we need to reset the position and velocity
|
||||||
|
if (!_control_status.flags.opt_flow) {
|
||||||
|
_control_status.flags.gps = resetPosition();
|
||||||
|
_control_status.flags.gps = resetVelocity();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user