Multicopter rounded turns (#16376)

* AutoLineSmoothVel: Implement l1-style guidance in turns
This commit is contained in:
Mathieu Bresciani
2020-12-14 13:04:01 +01:00
committed by GitHub
parent 9b065b4975
commit fdd1d6d244
3 changed files with 163 additions and 60 deletions
@@ -451,11 +451,11 @@ State FlightTaskAuto::_getCurrentState()
// Target is behind.
return_state = State::target_behind;
} else if (u_prev_to_target * prev_to_pos < 0.0f && prev_to_pos.length() > _mc_cruise_speed) {
} else if (u_prev_to_target * prev_to_pos < 0.0f && prev_to_pos.length() > _target_acceptance_radius) {
// Current position is more than cruise speed in front of previous setpoint.
return_state = State::previous_infront;
} else if (Vector2f(Vector2f(_position) - _closest_pt).length() > _mc_cruise_speed) {
} else if (Vector2f(Vector2f(_position) - _closest_pt).length() > _target_acceptance_radius) {
// Vehicle is more than cruise speed off track.
return_state = State::offtrack;