Skip to content

Commit

Permalink
APM_Control: Correct use of _throttle_decel_max
Browse files Browse the repository at this point in the history
  • Loading branch information
stephendade committed Oct 24, 2024
1 parent 4a7eed0 commit 5bed9ff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libraries/APM_Control/AR_AttitudeControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1046,7 +1046,7 @@ float AR_AttitudeControl::get_desired_speed_accel_limited(float desired_speed, f

// acceleration limit desired speed
float speed_change_max;
if (fabsf(desired_speed) < fabsf(_desired_speed) && is_positive(_throttle_decel_max)) {
if (fabsf(desired_speed) < fabsf(speed_prev) && is_positive(_throttle_decel_max)) {
speed_change_max = _throttle_decel_max * dt;
} else {
speed_change_max = _throttle_accel_max * dt;
Expand Down

0 comments on commit 5bed9ff

Please sign in to comment.