mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-26 01:35:41 +03:00
ifdef
This commit is contained in:
parent
c272555e39
commit
3758097e22
1 changed files with 5 additions and 3 deletions
|
@ -209,11 +209,11 @@ bool sensorUpdateIteration(sensorState_t *sensor) {
|
||||||
SensorMeasurement tempSensorMeas;
|
SensorMeasurement tempSensorMeas;
|
||||||
tempSensorMeas.value = sensor->currentAltReadingCm - sensor->zeroAltOffsetCm;
|
tempSensorMeas.value = sensor->currentAltReadingCm - sensor->zeroAltOffsetCm;
|
||||||
tempSensorMeas.variance = sensor->variance;
|
tempSensorMeas.variance = sensor->variance;
|
||||||
|
#ifdef USE_GPS
|
||||||
if (sensor->type == SF_GPS) { // ignore the GPS for now, TODO: add the gps to the fusion
|
if (sensor->type == SF_GPS) { // ignore the GPS for now, TODO: add the gps to the fusion
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
kf_update(&kf, tempSensorMeas);
|
kf_update(&kf, tempSensorMeas);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -237,9 +237,11 @@ bool altSensorFusionUpdate(void) {
|
||||||
altitudeState.velocityCm = (altitudeState.distCm - previousAltitude) * 1000 / deltaTimeMs;
|
altitudeState.velocityCm = (altitudeState.distCm - previousAltitude) * 1000 / deltaTimeMs;
|
||||||
previousAltitude = altitudeState.distCm;
|
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));
|
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));
|
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, 3, lrintf(altSenFusSources[SF_ACC].velocityAltCmS));
|
||||||
DEBUG_SET(DEBUG_ALTITUDE, 5, lrintf(altSenFusSources[SF_BARO].zeroAltOffsetCm));
|
DEBUG_SET(DEBUG_ALTITUDE, 5, lrintf(altSenFusSources[SF_BARO].zeroAltOffsetCm));
|
||||||
#ifdef USE_RANGEFINDER
|
#ifdef USE_RANGEFINDER
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue