mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-02 05:04:08 +08:00
EKF: When commencing GPS aiding, don't reset local position and velocity if using optical flow
This commit is contained in:
parent
26238bc2f5
commit
109e0e6dfc
@ -121,12 +121,15 @@ void Ekf::controlFusionModes()
|
||||
_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) {
|
||||
resetPosition();
|
||||
resetVelocity();
|
||||
_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
|
||||
if (!_control_status.flags.opt_flow) {
|
||||
_control_status.flags.gps = resetPosition();
|
||||
_control_status.flags.gps = resetVelocity();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user