aboutsummaryrefslogtreecommitdiff
path: root/src/modules/fw_att_control
diff options
context:
space:
mode:
authorMatt Beall <matt.beall@greypointcorp.com>2015-02-24 16:43:49 -0700
committerThomas Gubler <thomasgubler@gmail.com>2015-02-28 15:19:16 +0100
commite2de72b882d7c74cdaafcfc74ab7176ef94a4455 (patch)
tree2799a1bc7974749a4a5a05278c0aa1674c06c21a /src/modules/fw_att_control
parent5e199b3984e35e6a8078abbc36d9c9440e1cd7af (diff)
downloadpx4-firmware-e2de72b882d7c74cdaafcfc74ab7176ef94a4455.tar.gz
px4-firmware-e2de72b882d7c74cdaafcfc74ab7176ef94a4455.tar.bz2
px4-firmware-e2de72b882d7c74cdaafcfc74ab7176ef94a4455.zip
Added offboard actuator controls flags to offboard control mode and vehicle control mode to disable controls in att_control apps
Diffstat (limited to 'src/modules/fw_att_control')
-rw-r--r--src/modules/fw_att_control/fw_att_control_main.cpp28
1 files changed, 16 insertions, 12 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 5052b41c3..a7b563b0f 100644
--- a/src/modules/fw_att_control/fw_att_control_main.cpp
+++ b/src/modules/fw_att_control/fw_att_control_main.cpp
@@ -1077,20 +1077,24 @@ FixedwingAttitudeControl::task_main()
_actuators_airframe.timestamp = hrt_absolute_time();
_actuators_airframe.timestamp_sample = _att.timestamp;
- /* publish the actuator controls */
- if (_actuators_0_pub > 0) {
- orb_publish(_actuators_id, _actuators_0_pub, &_actuators);
- } else if (_actuators_id) {
- _actuators_0_pub= orb_advertise(_actuators_id, &_actuators);
- }
+ /* Only publish if actuator_control mode is not enabled */
+ if(!_vcontrol_mode.flag_control_offboard_actuator_control_enabled)
+ {
+ /* publish the actuator controls */
+ if (_actuators_0_pub > 0) {
+ orb_publish(_actuators_id, _actuators_0_pub, &_actuators);
+ } else if (_actuators_id) {
+ _actuators_0_pub= orb_advertise(_actuators_id, &_actuators);
+ }
- if (_actuators_2_pub > 0) {
- /* publish the actuator controls*/
- orb_publish(ORB_ID(actuator_controls_2), _actuators_2_pub, &_actuators_airframe);
+ if (_actuators_2_pub > 0) {
+ /* publish the actuator controls*/
+ orb_publish(ORB_ID(actuator_controls_2), _actuators_2_pub, &_actuators_airframe);
- } else {
- /* advertise and publish */
- _actuators_2_pub = orb_advertise(ORB_ID(actuator_controls_2), &_actuators_airframe);
+ } else {
+ /* advertise and publish */
+ _actuators_2_pub = orb_advertise(ORB_ID(actuator_controls_2), &_actuators_airframe);
+ }
}
}