From 44269b67623069b576294eb8c545227bd56f7e09 Mon Sep 17 00:00:00 2001 From: Alessio Morale Date: Tue, 10 Dec 2013 02:02:30 +0100 Subject: [PATCH] OP-1139: export corrected pressure value to uavobject --- flight/modules/Altitude/revolution/altitude.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flight/modules/Altitude/revolution/altitude.c b/flight/modules/Altitude/revolution/altitude.c index 27a26278d..d46c7c5bb 100644 --- a/flight/modules/Altitude/revolution/altitude.c +++ b/flight/modules/Altitude/revolution/altitude.c @@ -164,9 +164,9 @@ static void altitudeTask(__attribute__((unused)) void *parameters) temp = PIOS_MS5611_GetTemperature(); press = PIOS_MS5611_GetPressure(); float temp2 = temp * temp; - float correction = baroCorrection.a + temp * baroCorrection.b + temp2 * baroCorrection.c + temp * temp2 * baroCorrection.d; + press = press - baroCorrection.a + temp * baroCorrection.b + temp2 * baroCorrection.c + temp * temp2 * baroCorrection.d; - float altitude = 44330.0f * (1.0f - powf((press - correction) / MS5611_P0, (1.0f / 5.255f))); + float altitude = 44330.0f * (1.0f - powf((press) / MS5611_P0, (1.0f / 5.255f))); if (!isnan(altitude)) { data.Altitude = altitude;