From 6b8d40d224339aa81b25e9b889a17e07b2f9dc29 Mon Sep 17 00:00:00 2001 From: Oleg Kalachev Date: Wed, 22 May 2019 00:13:28 +0300 Subject: [PATCH] lpe: fix checking for sane pitch/roll in flow correction --- src/modules/local_position_estimator/sensors/flow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/local_position_estimator/sensors/flow.cpp b/src/modules/local_position_estimator/sensors/flow.cpp index f087b782124a..a15cf27cf9de 100644 --- a/src/modules/local_position_estimator/sensors/flow.cpp +++ b/src/modules/local_position_estimator/sensors/flow.cpp @@ -34,7 +34,7 @@ void BlockLocalPositionEstimator::flowInit() int BlockLocalPositionEstimator::flowMeasure(Vector &y) { // check for sane pitch/roll - if (_eul(0) > 0.5f || _eul(1) > 0.5f) { + if (fabs(_eul(0)) > 0.5f || fabs(_eul(1)) > 0.5f) { return -1; }