ekf: use `std::isfinite` instead of `isnan`

This commit is contained in:
Julian Oes 2016-04-27 12:58:22 +02:00
parent b295f9050c
commit 46e207106b
1 changed files with 2 additions and 2 deletions

View File

@ -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;
}