forked from Archive/PX4-Autopilot
EKF: Ensure we start with zero local altitude and zero GPS offset. Since the filter is not publishing any data at this point this is not relevant in operation, but might be important later if we publish a separate altitude estimate topic
This commit is contained in:
parent
45cd05b57a
commit
e8a9c20056
|
@ -631,7 +631,10 @@ void AttitudePositionEstimatorEKF::task_main()
|
|||
// gps sample rate is 5Hz and altitude is assumed accurate when averaged over 30 seconds
|
||||
// maintain heavily filtered values for both baro and gps altitude
|
||||
// Assume the filtered output should be identical for both sensors
|
||||
_baro_gps_offset = _baro_alt_filt - _gps_alt_filt;
|
||||
|
||||
if (_gpsIsGood) {
|
||||
_baro_gps_offset = _baro_alt_filt - _gps_alt_filt;
|
||||
}
|
||||
// if (hrt_elapsed_time(&_last_debug_print) >= 5e6) {
|
||||
// _last_debug_print = hrt_absolute_time();
|
||||
// perf_print_counter(_perf_baro);
|
||||
|
@ -658,6 +661,8 @@ void AttitudePositionEstimatorEKF::task_main()
|
|||
|
||||
_ekf->InitialiseFilter(initVelNED, 0.0, 0.0, 0.0f, 0.0f);
|
||||
|
||||
_filter_ref_offset = -_baro.altitude;
|
||||
|
||||
warnx("filter ref off: baro_alt: %8.4f", (double)_filter_ref_offset);
|
||||
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue