FlightTaskTransition: keep high decelration when overshooting the transition target

This commit is contained in:
Matthias Grob 2024-12-18 15:59:45 +01:00 committed by Silvan Fuhrer
parent 11d7dd41fd
commit 34bcc277a5

View File

@ -120,8 +120,12 @@ float FlightTaskTransition::computeBackTranstionPitchSetpoint()
if (dist_to_target_in_moving_direction > FLT_EPSILON) {
// Backtransition target point is ahead of the vehicle, compute the desired deceleration
deceleration_setpoint = velocity_xy.norm_squared() / (2.f * dist_to_target_in_moving_direction);
deceleration_setpoint = math::min(deceleration_setpoint, 2.f * _param_vt_b_dec_mss);
} else {
deceleration_setpoint = 2.f * _param_vt_b_dec_mss;
}
deceleration_setpoint = math::min(deceleration_setpoint, 2.f * _param_vt_b_dec_mss);
}
// Pitch up to reach a negative accel_in_flight_direction otherwise we decelerate too slow