forked from Archive/PX4-Autopilot
Fixed wing heading hold: Engage only after wings got close to level already
This commit is contained in:
parent
21fde4b3f6
commit
46d969772c
|
@ -858,7 +858,7 @@ FixedwingAttitudeControl::task_main()
|
|||
/* the pilot does not want to change direction,
|
||||
* take straight attitude setpoint from position controller
|
||||
*/
|
||||
if (fabsf(_manual.y) < 0.01f) {
|
||||
if (fabsf(_manual.y) < 0.01f && fabsf(_att.roll) < 0.2f) {
|
||||
roll_sp = _att_sp.roll_body + _parameters.rollsp_offset_rad;
|
||||
} else {
|
||||
roll_sp = (_manual.y * _parameters.man_roll_max - _parameters.trim_roll)
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue