heading update: do not update heading within NAV_ACC_RAD

This commit is contained in:
Dennis Mannhart
2018-08-10 15:35:36 +02:00
committed by ChristophTobler
parent 30fb82d9b4
commit 9a23295a40
@@ -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;