aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLorenz Meier <lm@inf.ethz.ch>2014-06-29 12:00:54 +0200
committerLorenz Meier <lm@inf.ethz.ch>2014-06-29 12:00:54 +0200
commitb64c64d5a3d71a085b603e6f86dfe785a03c6129 (patch)
tree96e19e64855209918904fdc5788447e5ee1b280d
parent092ede366a531ad68f7ccc2f372f83b8d2993242 (diff)
downloadpx4-firmware-b64c64d5a3d71a085b603e6f86dfe785a03c6129.tar.gz
px4-firmware-b64c64d5a3d71a085b603e6f86dfe785a03c6129.tar.bz2
px4-firmware-b64c64d5a3d71a085b603e6f86dfe785a03c6129.zip
Observation index cannot get negative.
-rw-r--r--src/modules/ekf_att_pos_estimator/estimator_23states.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/modules/ekf_att_pos_estimator/estimator_23states.cpp b/src/modules/ekf_att_pos_estimator/estimator_23states.cpp
index df319a93a..8c30521e3 100644
--- a/src/modules/ekf_att_pos_estimator/estimator_23states.cpp
+++ b/src/modules/ekf_att_pos_estimator/estimator_23states.cpp
@@ -1088,7 +1088,7 @@ void AttPosEKF::FuseVelposNED()
stateIndex = 4 + obsIndex;
// Calculate the measurement innovation, using states from a
// different time coordinate if fusing height data
- if (obsIndex >= 0 && obsIndex <= 2)
+ if (obsIndex <= 2)
{
innovVelPos[obsIndex] = statesAtVelTime[stateIndex] - observation[obsIndex];
}