mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-13 03:20:00 +03:00
spacing
This commit is contained in:
parent
7a2b1ce412
commit
e0ff8463c4
1 changed files with 1 additions and 2 deletions
|
@ -270,8 +270,7 @@ void updateSensorOffset(sensorState_t *sensor) {
|
|||
float newOffset = sensor->currentAltReadingCm - kf.estimatedValue;
|
||||
if (sensor->penalityIters > 0) {
|
||||
sensor->zeroAltOffsetCm = 0.5f * (newOffset + sensor->zeroAltOffsetCm);
|
||||
}
|
||||
else { // detect a ramp in the sensor readings by accumulating the error
|
||||
} else { // detect a ramp in the sensor readings by accumulating the error
|
||||
sensor->offsetError += newOffset - sensor->zeroAltOffsetCm;
|
||||
if (fabsf(sensor->offsetError) > SENSOR_MAX_OFFSET_ERROR) {
|
||||
sensor->zeroAltOffsetCm = 0.01f * newOffset + 0.99f * sensor->zeroAltOffsetCm;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue