add ground_alt to resulting altitude measurement of baro_ets, since baro gives you only altitude relative to starting point

This commit is contained in:
Felix Ruess
2011-01-12 15:16:35 +01:00
parent 97412d0a2e
commit 8a0f94c422
+3 -1
View File
@@ -40,6 +40,8 @@
#include "estimator.h"
#include <math.h>
#include "subsystems/nav.h"
#ifdef SITL
#include "gps.h"
#endif
@@ -133,7 +135,7 @@ void baro_ets_read_event( void ) {
}
// Convert raw to m/s
if (baro_ets_offset_init)
baro_ets_altitude = BARO_ETS_SCALE * (float)(baro_ets_offset-baro_ets_adc);
baro_ets_altitude = ground_alt + BARO_ETS_SCALE * (float)(baro_ets_offset-baro_ets_adc);
else
baro_ets_altitude = 0.0;
// New value available