Copter: no need to fabs() get_default_speed_down() as it does fabs already

This commit is contained in:
Andrew Tridgell 2021-09-07 12:53:02 +10:00 committed by Randy Mackay
parent 9342ded2bb
commit f7f63b715f
2 changed files with 2 additions and 2 deletions

View File

@ -1075,7 +1075,7 @@ void GCS_MAVLINK_Copter::handleMessage(const mavlink_message_t &msg)
climb_rate_or_thrust = (packet.thrust - 0.5f) * 2.0f * copter.wp_nav->get_default_speed_up();
} else {
// descend at up to WPNAV_SPEED_DN
climb_rate_or_thrust = (0.5f - packet.thrust) * 2.0f * -fabsf(copter.wp_nav->get_default_speed_down());
climb_rate_or_thrust = (0.5f - packet.thrust) * 2.0f * -copter.wp_nav->get_default_speed_down();
}
}

View File

@ -820,7 +820,7 @@ void ModeGuided::angle_control_run()
float climb_rate_cms = 0.0f;
if (!guided_angle_state.use_thrust) {
// constrain climb rate
climb_rate_cms = constrain_float(guided_angle_state.climb_rate_cms, -fabsf(wp_nav->get_default_speed_down()), wp_nav->get_default_speed_up());
climb_rate_cms = constrain_float(guided_angle_state.climb_rate_cms, -wp_nav->get_default_speed_down(), wp_nav->get_default_speed_up());
// get avoidance adjusted climb rate
climb_rate_cms = get_avoidance_adjusted_climbrate(climb_rate_cms);