Browse Source

heading update: do not update heading within NAV_ACC_RAD

sbg
Dennis Mannhart 7 years ago committed by ChristophTobler
parent
commit
9a23295a40
  1. 10
      src/lib/FlightTasks/tasks/Auto/FlightTaskAuto.cpp

10
src/lib/FlightTasks/tasks/Auto/FlightTaskAuto.cpp

@ -255,10 +255,12 @@ void FlightTaskAuto::_set_heading_from_mode() @@ -255,10 +255,12 @@ void FlightTaskAuto::_set_heading_from_mode()
}
}
// We only adjust yaw if vehicle is outside of acceptance radius.
// This prevents excessive yawing.
if (PX4_ISFINITE(v.length()) && v.length() > NAV_ACC_RAD.get()) {
_compute_heading_from_2D_vector(_yaw_setpoint, v);
if (PX4_ISFINITE(v.length())) {
// We only adjust yaw if vehicle is outside of acceptance radius.
// This prevents excessive yawing.
if (v.length() > NAV_ACC_RAD.get()) {
_compute_heading_from_2D_vector(_yaw_setpoint, v);
}
} else {
_yaw_setpoint = NAN;

Loading…
Cancel
Save