mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-06-06 07:53:43 +08:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user