mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-24 07:09:48 +08:00
heading update: do not update heading within NAV_ACC_RAD
This commit is contained in:
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;
|
||||
|
||||
Reference in New Issue
Block a user