1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-24 00:35:39 +03:00
This commit is contained in:
ahmedsalah52 2024-12-11 00:51:04 +01:00
parent c272555e39
commit 3758097e22

View file

@ -209,11 +209,11 @@ bool sensorUpdateIteration(sensorState_t *sensor) {
SensorMeasurement tempSensorMeas;
tempSensorMeas.value = sensor->currentAltReadingCm - sensor->zeroAltOffsetCm;
tempSensorMeas.variance = sensor->variance;
#ifdef USE_GPS
if (sensor->type == SF_GPS) { // ignore the GPS for now, TODO: add the gps to the fusion
return false;
}
#endif
kf_update(&kf, tempSensorMeas);
return true;
}
@ -237,9 +237,11 @@ bool altSensorFusionUpdate(void) {
altitudeState.velocityCm = (altitudeState.distCm - previousAltitude) * 1000 / deltaTimeMs;
previousAltitude = altitudeState.distCm;
DEBUG_SET(DEBUG_ALTITUDE, 0, lrintf(10000 - gpsSol.dop.pdop));
DEBUG_SET(DEBUG_ALTITUDE, 1, lrintf(altSenFusSources[SF_BARO].currentAltReadingCm - altSenFusSources[SF_BARO].zeroAltOffsetCm));
#ifdef USE_GPS
DEBUG_SET(DEBUG_ALTITUDE, 0, lrintf(10000 - gpsSol.dop.pdop));
DEBUG_SET(DEBUG_ALTITUDE, 2, lrintf(altSenFusSources[SF_GPS].currentAltReadingCm - altSenFusSources[SF_GPS].zeroAltOffsetCm));
#endif
DEBUG_SET(DEBUG_ALTITUDE, 3, lrintf(altSenFusSources[SF_ACC].velocityAltCmS));
DEBUG_SET(DEBUG_ALTITUDE, 5, lrintf(altSenFusSources[SF_BARO].zeroAltOffsetCm));
#ifdef USE_RANGEFINDER