diff --git a/libraries/AP_Mount/AP_Mount_Backend.cpp b/libraries/AP_Mount/AP_Mount_Backend.cpp index de48c467c7..80b4215f9d 100644 --- a/libraries/AP_Mount/AP_Mount_Backend.cpp +++ b/libraries/AP_Mount/AP_Mount_Backend.cpp @@ -123,7 +123,8 @@ void AP_Mount_Backend::update_targets_from_rc() // returns the angle (degrees*100) that the RC_Channel input is receiving int32_t AP_Mount_Backend::angle_input(RC_Channel* rc, int16_t angle_min, int16_t angle_max) { - return (rc->get_reverse() ? -1 : 1) * (rc->radio_in - rc->radio_min) * (int32_t)(angle_max - angle_min) / (rc->radio_max - rc->radio_min) + (rc->get_reverse() ? angle_max : angle_min); + return (rc->get_reverse() ? -1 : 1) * (rc->get_radio_in() - rc->get_radio_min()) + * (int32_t)(angle_max - angle_min) / (rc->get_radio_max() - rc->get_radio_min()) + (rc->get_reverse() ? angle_max : angle_min); } // returns the angle (radians) that the RC_Channel input is receiving