AP_ADSB: correct climbRate in SageTechMXS

down vs up issue
This commit is contained in:
Peter Barker 2023-05-31 17:28:57 +10:00 committed by Peter Barker
parent 030c34345d
commit 5984857751

View File

@ -334,9 +334,10 @@ void AP_ADSB_Sagetech_MXS::auto_config_operating()
mxs_state.op.identOn = false;
float vertRate;
if (AP::ahrs().get_vert_pos_rate_D(vertRate)) {
mxs_state.op.climbRate = vertRate * SAGETECH_SCALE_M_PER_SEC_TO_FT_PER_MIN;
float vertRateD;
if (AP::ahrs().get_vert_pos_rate_D(vertRateD)) {
// convert from down to up, and scale appropriately:
mxs_state.op.climbRate = -vertRateD * SAGETECH_SCALE_M_PER_SEC_TO_FT_PER_MIN;
mxs_state.op.climbValid = true;
} else {
mxs_state.op.climbValid = false;