From 46e207106b99f4f4a252ab11185f133584e4948e Mon Sep 17 00:00:00 2001 From: Julian Oes Date: Wed, 27 Apr 2016 12:58:22 +0200 Subject: [PATCH] ekf: use `std::isfinite` instead of `isnan` --- EKF/ekf.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/EKF/ekf.cpp b/EKF/ekf.cpp index 74a9562dc8..89e9f3fbbb 100644 --- a/EKF/ekf.cpp +++ b/EKF/ekf.cpp @@ -337,8 +337,8 @@ bool Ekf::update() // the output observer always runs calculateOutputStates(); - // check for NaN on attitude states - if (isnan(_state.quat_nominal(0)) || isnan(_output_new.quat_nominal(0))) { + // check for NaN or inf on attitude states + if (!std::isfinite(_state.quat_nominal(0)) || !std::isfinite(_output_new.quat_nominal(0))) { return false; }