mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-05 05:01:36 +08:00
Fixed wing heading hold: Engage only after wings got close to level already
This commit is contained in:
@@ -1411,12 +1411,9 @@ FixedwingPositionControl::control_position(const math::Vector<2> ¤t_positi
|
||||
|
||||
/* heading control */
|
||||
|
||||
if (fabsf(_manual.y) < 0.01f) {
|
||||
if (fabsf(_manual.y) < 0.01f && fabsf(_att.roll) < 0.2f) {
|
||||
/* heading / roll is zero, lock onto current heading */
|
||||
|
||||
// XXX calculate a waypoint in some distance
|
||||
// and lock on to it
|
||||
|
||||
/* just switched back from non heading-hold to heading hold */
|
||||
if (!_hdg_hold_enabled) {
|
||||
_hdg_hold_enabled = true;
|
||||
|
||||
Reference in New Issue
Block a user