aboutsummaryrefslogtreecommitdiff
path: root/apps/examples
diff options
context:
space:
mode:
authorLorenz Meier <lm@inf.ethz.ch>2013-01-19 17:11:12 +0100
committerLorenz Meier <lm@inf.ethz.ch>2013-01-19 17:11:12 +0100
commit2542722102ce0ab3520dafe9ae695cf06caae675 (patch)
tree9827710c211fc31e463ffabb6002f4dda7cdab17 /apps/examples
parent4b2d1690d33c2ae9248abd9fb025e8a1a30fbe84 (diff)
downloadpx4-firmware-2542722102ce0ab3520dafe9ae695cf06caae675.tar.gz
px4-firmware-2542722102ce0ab3520dafe9ae695cf06caae675.tar.bz2
px4-firmware-2542722102ce0ab3520dafe9ae695cf06caae675.zip
Fixed selective publication update
Diffstat (limited to 'apps/examples')
-rw-r--r--apps/examples/kalman_demo/KalmanNav.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/apps/examples/kalman_demo/KalmanNav.cpp b/apps/examples/kalman_demo/KalmanNav.cpp
index a07280515..7e89dffb2 100644
--- a/apps/examples/kalman_demo/KalmanNav.cpp
+++ b/apps/examples/kalman_demo/KalmanNav.cpp
@@ -240,9 +240,7 @@ void KalmanNav::update()
if (newTimeStamp - _pubTimeStamp > 1e6 / 50) { // 50 Hz
_pubTimeStamp = newTimeStamp;
- if (_positionInitialized) _pos.update();
-
- if (_attitudeInitialized) _att.update();
+ updatePublications();
}
// output
@@ -294,8 +292,13 @@ void KalmanNav::updatePublications()
_att.q_valid = true;
_att.counter = _navFrames;
- // update publications
- SuperBlock::updatePublications();
+ // selectively update publications,
+ // do NOT call superblock do-all method
+ if (_positionInitialized)
+ _pos.update();
+
+ if (_attitudeInitialized)
+ _att.update();
}
int KalmanNav::predictState(float dt)