Skip to content

Commit

Permalink
Sub: no need to fabs() get_default_speed_down() as it does fabs already
Browse files Browse the repository at this point in the history
  • Loading branch information
tridge authored and rmackay9 committed Sep 7, 2021
1 parent f7f63b7 commit fd75811
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ArduSub/GCS_Mavlink.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ void GCS_MAVLINK_Sub::handleMessage(const mavlink_message_t &msg)
climb_rate_cms = (packet.thrust - 0.5f) * 2.0f * sub.wp_nav.get_default_speed_up();
} else {
// descend at up to WPNAV_SPEED_DN
climb_rate_cms = (packet.thrust - 0.5f) * 2.0f * fabsf(sub.wp_nav.get_default_speed_down());
climb_rate_cms = (packet.thrust - 0.5f) * 2.0f * sub.wp_nav.get_default_speed_down();
}
sub.guided_set_angle(Quaternion(packet.q[0],packet.q[1],packet.q[2],packet.q[3]), climb_rate_cms);
break;
Expand Down
2 changes: 1 addition & 1 deletion ArduSub/control_guided.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ void Sub::guided_angle_control_run()
float yaw_in = wrap_180_cd(guided_angle_state.yaw_cd);

// constrain climb rate
float climb_rate_cms = constrain_float(guided_angle_state.climb_rate_cms, -fabsf(wp_nav.get_default_speed_down()), wp_nav.get_default_speed_up());
float climb_rate_cms = constrain_float(guided_angle_state.climb_rate_cms, -wp_nav.get_default_speed_down(), wp_nav.get_default_speed_up());

// check for timeout - set lean angles and climb rate to zero if no updates received for 3 seconds
uint32_t tnow = AP_HAL::millis();
Expand Down

0 comments on commit fd75811

Please sign in to comment.