Skip to content
Snippets Groups Projects
Commit 66bb7adc authored by sanderux's avatar sanderux Committed by Sander Smeets
Browse files

simplify back transition throttle scaling

parent 6b9a8dac
No related branches found
No related tags found
No related merge requests found
......@@ -347,12 +347,10 @@ void Standard::update_transition_state()
_v_att_sp->q_d_valid = true;
// Handle throttle reversal for active breaking
if (_params_handles_standard.back_trans_throttle > FLT_EPSILON
|| _params_handles_standard.back_trans_throttle < -0.01f) {
_pusher_throttle = _params_standard.back_trans_throttle * (float)hrt_elapsed_time(&_vtol_schedule.transition_start) /
(_params_standard.front_trans_dur * 1000000.0f);
_pusher_throttle = math::constrain(_pusher_throttle, -1.0f, _params_standard.back_trans_throttle);
}
float thrscale = (float)hrt_elapsed_time(&_vtol_schedule.transition_start) / (_params_standard.front_trans_dur *
1000000.0f);
thrscale = math::constrain(thrscale, 0.0f, 1.0f);
_pusher_throttle = thrscale * _params_standard.back_trans_throttle;
// continually increase mc attitude control as we transition back to mc mode
if (_params_standard.back_trans_ramp > FLT_EPSILON) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment