Fixed wing heading hold: Engage only after wings got close to level already

This commit is contained in:
Lorenz Meier
2015-06-05 22:45:07 +02:00
parent 21fde4b3f6
commit 46d969772c
2 changed files with 2 additions and 5 deletions
@@ -1411,12 +1411,9 @@ FixedwingPositionControl::control_position(const math::Vector<2> &current_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;