diff options
author | Thomas Gubler <thomasgubler@gmail.com> | 2014-08-22 00:39:44 +0200 |
---|---|---|
committer | Thomas Gubler <thomasgubler@gmail.com> | 2014-08-22 00:39:44 +0200 |
commit | 1a14ff250e5a2ead69576762fd5b7f176c4b6fac (patch) | |
tree | d356ea43134d95f6255dbf6556f87d5a5682d87e /src | |
parent | c402ac28ecb1d59e1511ee90804a96ac47d7793e (diff) | |
download | px4-firmware-1a14ff250e5a2ead69576762fd5b7f176c4b6fac.tar.gz px4-firmware-1a14ff250e5a2ead69576762fd5b7f176c4b6fac.tar.bz2 px4-firmware-1a14ff250e5a2ead69576762fd5b7f176c4b6fac.zip |
fw att control: use RC only if in manual
Diffstat (limited to 'src')
-rw-r--r-- | src/modules/fw_att_control/fw_att_control_main.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/modules/fw_att_control/fw_att_control_main.cpp b/src/modules/fw_att_control/fw_att_control_main.cpp index 0cea13cc4..ee112a40e 100644 --- a/src/modules/fw_att_control/fw_att_control_main.cpp +++ b/src/modules/fw_att_control/fw_att_control_main.cpp @@ -717,7 +717,14 @@ FixedwingAttitudeControl::task_main() float pitch_sp = _parameters.pitchsp_offset_rad; float throttle_sp = 0.0f; - if (_vcontrol_mode.flag_control_velocity_enabled || _vcontrol_mode.flag_control_position_enabled) { + /* Read attitude setpoint from uorb if + * - velocity control or position control is enabled (pos controller is running) + * - manual control is disabled (another app may send the setpoint, but it should + * for sure not be set from the remote control values) + */ + if (_vcontrol_mode.flag_control_velocity_enabled || + _vcontrol_mode.flag_control_position_enabled || + !_vcontrol_mode.flag_control_manual_enabled) { /* read in attitude setpoint from attitude setpoint uorb topic */ roll_sp = _att_sp.roll_body + _parameters.rollsp_offset_rad; pitch_sp = _att_sp.pitch_body + _parameters.pitchsp_offset_rad; |