FlightTaskAutoLine: ensure that desired speed along track does not exceed maximum speed at threshold to target

This commit is contained in:
Dennis Mannhart 2018-11-29 09:55:18 +01:00 committed by Lorenz Meier
parent d76aec4eb2
commit 370371767f
1 changed files with 3 additions and 0 deletions

View File

@ -155,6 +155,9 @@ void FlightTaskAutoLine::_generateXYsetpoints()
// accelerate towards target
speed_sp_track = acc_max * _deltatime + speed_sp_prev_track;
}
// ensure that desired speed does not exceed speed at threshold
speed_sp_track = math::min(speed_threshold, speed_sp_track);
}
speed_sp_track = math::constrain(speed_sp_track, 0.0f, _mc_cruise_speed);