mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-06-05 23:49:00 +08:00
baro_ets: call EstimatorSetAlt only when offset already initialized
This commit is contained in:
@@ -134,12 +134,13 @@ void baro_ets_read_event( void ) {
|
||||
baro_ets_offset_tmp += baro_ets_adc;
|
||||
}
|
||||
// Convert raw to m/s
|
||||
if (baro_ets_offset_init)
|
||||
if (baro_ets_offset_init) {
|
||||
baro_ets_altitude = ground_alt + BARO_ETS_SCALE * (float)(baro_ets_offset-baro_ets_adc);
|
||||
else
|
||||
// New value available
|
||||
EstimatorSetAlt(baro_ets_altitude);
|
||||
} else {
|
||||
baro_ets_altitude = 0.0;
|
||||
// New value available
|
||||
EstimatorSetAlt(baro_ets_altitude);
|
||||
}
|
||||
} else {
|
||||
baro_ets_altitude = 0.0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user