aboutsummaryrefslogtreecommitdiff
path: root/src/modules/ekf_att_pos_estimator/ekf_att_pos_estimator_main.cpp
diff options
context:
space:
mode:
authorLorenz Meier <lm@inf.ethz.ch>2014-09-02 15:37:18 +0200
committerLorenz Meier <lm@inf.ethz.ch>2014-09-02 15:37:18 +0200
commit4c7cc10b6294c799798d05faad688d9dec2102f3 (patch)
tree19899057a5dcdfc0ee742de3c238bebe61526556 /src/modules/ekf_att_pos_estimator/ekf_att_pos_estimator_main.cpp
parent8729cf23277008cb12c53c7c529663fdc983339e (diff)
downloadpx4-firmware-4c7cc10b6294c799798d05faad688d9dec2102f3.tar.gz
px4-firmware-4c7cc10b6294c799798d05faad688d9dec2102f3.tar.bz2
px4-firmware-4c7cc10b6294c799798d05faad688d9dec2102f3.zip
Working and replay-tested altitude fusion
Diffstat (limited to 'src/modules/ekf_att_pos_estimator/ekf_att_pos_estimator_main.cpp')
-rw-r--r--src/modules/ekf_att_pos_estimator/ekf_att_pos_estimator_main.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/modules/ekf_att_pos_estimator/ekf_att_pos_estimator_main.cpp b/src/modules/ekf_att_pos_estimator/ekf_att_pos_estimator_main.cpp
index 87a20a775..97abb76a9 100644
--- a/src/modules/ekf_att_pos_estimator/ekf_att_pos_estimator_main.cpp
+++ b/src/modules/ekf_att_pos_estimator/ekf_att_pos_estimator_main.cpp
@@ -1370,7 +1370,7 @@ FixedwingEstimator::task_main()
_ekf->fuseRngData = true;
_ekf->useRangeFinder = true;
_ekf->RecallStates(_ekf->statesAtRngTime, (IMUmsec - 500.0f));
- _ekf->FuseRangeFinder();
+ _ekf->GroundEKF();
}
@@ -1487,7 +1487,7 @@ FixedwingEstimator::task_main()
}
/* terrain altitude */
- _global_pos.terrain_alt = _ekf->states[22];
+ _global_pos.terrain_alt = _ekf->hgtRef - _ekf->flowStates[1];
_global_pos.terrain_alt_valid = (_distance_last_valid > 0) &&
(hrt_elapsed_time(&_distance_last_valid) < 20 * 1000 * 1000);