aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Goppert <james.goppert@gmail.com>2013-01-17 12:18:20 -0500
committerJames Goppert <james.goppert@gmail.com>2013-01-17 12:18:20 -0500
commit13bb814f2015154cb5cadb814e37db1b6b2e634b (patch)
tree74473907e30f384a772b46d5c38d9d5f6658a402
parentc2c0baf843aa376681fcf7bf9dfcac480177b7fb (diff)
downloadpx4-firmware-13bb814f2015154cb5cadb814e37db1b6b2e634b.tar.gz
px4-firmware-13bb814f2015154cb5cadb814e37db1b6b2e634b.tar.bz2
px4-firmware-13bb814f2015154cb5cadb814e37db1b6b2e634b.zip
Prevented attitude correction from changing velocity when pos not init.
-rw-r--r--apps/examples/kalman_demo/KalmanNav.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/apps/examples/kalman_demo/KalmanNav.cpp b/apps/examples/kalman_demo/KalmanNav.cpp
index 15254f7c7..40166f3a1 100644
--- a/apps/examples/kalman_demo/KalmanNav.cpp
+++ b/apps/examples/kalman_demo/KalmanNav.cpp
@@ -590,9 +590,11 @@ int KalmanNav::correctAtt()
psi += xCorrect(PSI);
// attitude also affects nav velocities
- vN += xCorrect(VN);
- vE += xCorrect(VE);
- vD += xCorrect(VD);
+ if (_positionInitialized) {
+ vN += xCorrect(VN);
+ vE += xCorrect(VE);
+ vD += xCorrect(VD);
+ }
// update state covariance
// http://en.wikipedia.org/wiki/Extended_Kalman_filter