AP_ADSB: fix SageTech MXS climbRate sign

This commit is contained in:
Tom Pittenger 2023-06-05 16:59:13 -07:00 committed by Peter Barker
parent 5984857751
commit d23d808f07
1 changed files with 4 additions and 4 deletions

View File

@ -337,7 +337,7 @@ void AP_ADSB_Sagetech_MXS::auto_config_operating()
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.climbRate = -1 * vertRateD * SAGETECH_SCALE_M_PER_SEC_TO_FT_PER_MIN;
mxs_state.op.climbValid = true;
} else {
mxs_state.op.climbValid = false;
@ -592,9 +592,9 @@ void AP_ADSB_Sagetech_MXS::send_operating_msg()
mxs_state.op.altitude = 0;
}
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)) {
mxs_state.op.climbRate = -1 * vertRateD * SAGETECH_SCALE_M_PER_SEC_TO_FT_PER_MIN;
mxs_state.op.climbValid = true;
} else {
mxs_state.op.climbValid = false;