Skip to content

Commit e9ea271

Browse files
committed
FlightTaskTransition: keep high decelration when overshooting the transition target
1 parent 26377b9 commit e9ea271

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/modules/flight_mode_manager/tasks/Transition/FlightTaskTransition.cpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,12 @@ float FlightTaskTransition::computeBackTranstionPitchSetpoint()
119119
if (dist_to_target_in_moving_direction > FLT_EPSILON) {
120120
// Backtransition target point is ahead of the vehicle, compute the desired deceleration
121121
deceleration_setpoint = velocity_xy.norm_squared() / (2.f * dist_to_target_in_moving_direction);
122-
deceleration_setpoint = math::min(deceleration_setpoint, 2.f * _param_vt_b_dec_mss);
122+
123+
} else {
124+
deceleration_setpoint = 2.f * _param_vt_b_dec_mss;
123125
}
126+
127+
deceleration_setpoint = math::min(deceleration_setpoint, 2.f * _param_vt_b_dec_mss);
124128
}
125129

126130
// Pitch up to reach a negative accel_in_flight_direction otherwise we decelerate too slow

0 commit comments

Comments
 (0)