mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-24 11:13:34 +08:00
do not return early in velocity reset method otherwise
some code will not be executed
This commit is contained in:
+2
-2
@@ -61,7 +61,6 @@ bool Ekf::resetVelocity()
|
|||||||
|
|
||||||
if (_time_last_imu - gps_newest.time_us < 2*GPS_MAX_INTERVAL) {
|
if (_time_last_imu - gps_newest.time_us < 2*GPS_MAX_INTERVAL) {
|
||||||
_state.vel = gps_newest.vel;
|
_state.vel = gps_newest.vel;
|
||||||
return true;
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// XXX use the value of the last known velocity
|
// XXX use the value of the last known velocity
|
||||||
@@ -69,7 +68,7 @@ bool Ekf::resetVelocity()
|
|||||||
}
|
}
|
||||||
} else if (_control_status.flags.opt_flow || _control_status.flags.ev_pos) {
|
} else if (_control_status.flags.opt_flow || _control_status.flags.ev_pos) {
|
||||||
_state.vel.setZero();
|
_state.vel.setZero();
|
||||||
return true;
|
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -91,6 +90,7 @@ bool Ekf::resetVelocity()
|
|||||||
_state_reset_status.velNE_counter++;
|
_state_reset_status.velNE_counter++;
|
||||||
_state_reset_status.velD_counter++;
|
_state_reset_status.velD_counter++;
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reset position states. If we have a recent and valid
|
// Reset position states. If we have a recent and valid
|
||||||
|
|||||||
Reference in New Issue
Block a user