mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-25 22:33:34 +08:00
EKF: Add check for NaN's on attitude states
This commit is contained in:
@@ -307,6 +307,11 @@ bool Ekf::update()
|
|||||||
// the output observer always runs
|
// the output observer always runs
|
||||||
calculateOutputStates();
|
calculateOutputStates();
|
||||||
|
|
||||||
|
// check for NaN on attitude states
|
||||||
|
if (isnan(_state.quat_nominal(0)) || isnan(_output_new.quat_nominal(0))) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// We don't have valid data to output until tilt and yaw alignment is complete
|
// We don't have valid data to output until tilt and yaw alignment is complete
|
||||||
if (_control_status.flags.tilt_align && _control_status.flags.yaw_align) {
|
if (_control_status.flags.tilt_align && _control_status.flags.yaw_align) {
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Reference in New Issue
Block a user