diff --git a/sw/airborne/subsystems/ins/ins_int.c b/sw/airborne/subsystems/ins/ins_int.c index 4e10c36e24..a1334f3874 100644 --- a/sw/airborne/subsystems/ins/ins_int.c +++ b/sw/airborne/subsystems/ins/ins_int.c @@ -191,7 +191,7 @@ static void baro_cb(uint8_t __attribute__((unused)) sender_id, const float *pres ins_ltp_pos.z = POS_BFP_OF_REAL(vff_z); } else { - ins_baro_alt = pprz_isa_height_of_pressure(*pressure, ins_qfe); + ins_baro_alt = -pprz_isa_height_of_pressure(*pressure, ins_qfe); vff_update(ins_baro_alt); } INS_NED_TO_STATE(); diff --git a/sw/airborne/subsystems/ins/ins_int.h b/sw/airborne/subsystems/ins/ins_int.h index c9a861be8b..9de003ca96 100644 --- a/sw/airborne/subsystems/ins/ins_int.h +++ b/sw/airborne/subsystems/ins/ins_int.h @@ -50,7 +50,7 @@ extern struct NedCoor_i ins_gps_speed_cm_s_ned; /* barometer */ #if USE_VFF -extern float ins_baro_alt; ///< altitude calculated from baro in meters +extern float ins_baro_alt; ///< altitude calculated from baro in meters (z-down) extern float ins_qfe; extern bool_t ins_baro_initialised; #endif diff --git a/sw/airborne/subsystems/ins/ins_int_extended.c b/sw/airborne/subsystems/ins/ins_int_extended.c index 9c6677bd12..3470095461 100644 --- a/sw/airborne/subsystems/ins/ins_int_extended.c +++ b/sw/airborne/subsystems/ins/ins_int_extended.c @@ -214,7 +214,7 @@ static void baro_cb(uint8_t __attribute__((unused)) sender_id, const float *pres ins_ltp_pos.z = POS_BFP_OF_REAL(vff_z); } else { - ins_baro_alt = pprz_isa_height_of_pressure(*pressure, ins_qfe); + ins_baro_alt = -pprz_isa_height_of_pressure(*pressure, ins_qfe); vff_update_baro(ins_baro_alt); } INS_NED_TO_STATE();