aboutsummaryrefslogtreecommitdiff
path: root/apps/examples
diff options
context:
space:
mode:
authorJames Goppert <james.goppert@gmail.com>2013-01-18 10:21:20 -0500
committerJames Goppert <james.goppert@gmail.com>2013-01-18 10:21:20 -0500
commit4b2d1690d33c2ae9248abd9fb025e8a1a30fbe84 (patch)
tree94932a34a784821a41212978700ed5474c9b49db /apps/examples
parentdc5ddb937039fd3481009caeb2a472955986e2e4 (diff)
downloadpx4-firmware-4b2d1690d33c2ae9248abd9fb025e8a1a30fbe84.tar.gz
px4-firmware-4b2d1690d33c2ae9248abd9fb025e8a1a30fbe84.tar.bz2
px4-firmware-4b2d1690d33c2ae9248abd9fb025e8a1a30fbe84.zip
Set kalman_demo to only publish when it has valid info.
Diffstat (limited to 'apps/examples')
-rw-r--r--apps/examples/kalman_demo/KalmanNav.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/apps/examples/kalman_demo/KalmanNav.cpp b/apps/examples/kalman_demo/KalmanNav.cpp
index 40166f3a1..a07280515 100644
--- a/apps/examples/kalman_demo/KalmanNav.cpp
+++ b/apps/examples/kalman_demo/KalmanNav.cpp
@@ -239,7 +239,10 @@ void KalmanNav::update()
// publication
if (newTimeStamp - _pubTimeStamp > 1e6 / 50) { // 50 Hz
_pubTimeStamp = newTimeStamp;
- updatePublications();
+
+ if (_positionInitialized) _pos.update();
+
+ if (_attitudeInitialized) _att.update();
}
// output
@@ -589,6 +592,7 @@ int KalmanNav::correctAtt()
}
psi += xCorrect(PSI);
+
// attitude also affects nav velocities
if (_positionInitialized) {
vN += xCorrect(VN);