diff options
author | Lorenz Meier <lm@inf.ethz.ch> | 2012-11-25 13:55:28 +0100 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2012-11-25 13:55:28 +0100 |
commit | faa672f8bb257ec0ee357ad55da3195b79aeb54b (patch) | |
tree | d20ffd7f403aab274652b016af49554128a472d1 /apps/sensors | |
parent | dc72d467d4abe3d18bbf02091eb4eaddb4f491d2 (diff) | |
download | px4-firmware-faa672f8bb257ec0ee357ad55da3195b79aeb54b.tar.gz px4-firmware-faa672f8bb257ec0ee357ad55da3195b79aeb54b.tar.bz2 px4-firmware-faa672f8bb257ec0ee357ad55da3195b79aeb54b.zip |
mode switching for all platforms, additional fixed wing modes
Diffstat (limited to 'apps/sensors')
-rw-r--r-- | apps/sensors/sensors.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/apps/sensors/sensors.cpp b/apps/sensors/sensors.cpp index 466284a1b..a633e012c 100644 --- a/apps/sensors/sensors.cpp +++ b/apps/sensors/sensors.cpp @@ -973,7 +973,7 @@ Sensors::ppm_poll() } /* yaw input - stick right is positive and positive rotation */ - manual_control.yaw = _rc.chan[_rc.function[YAW]].scaled * _parameters.rc_scale_yaw; + manual_control.yaw = _rc.chan[_rc.function[YAW]].scaled; if (manual_control.yaw < -1.0f) manual_control.yaw = -1.0f; if (manual_control.yaw > 1.0f) manual_control.yaw = 1.0f; if (!isnan(_parameters.rc_scale_yaw) || !isinf(_parameters.rc_scale_yaw)) { @@ -990,6 +990,21 @@ Sensors::ppm_poll() if (manual_control.override_mode_switch < -1.0f) manual_control.override_mode_switch = -1.0f; if (manual_control.override_mode_switch > 1.0f) manual_control.override_mode_switch = 1.0f; + /* aux inputs */ + manual_control.aux1_cam_pan_flaps = _rc.chan[_rc.function[FUNC_0]].scaled; + if (manual_control.aux1_cam_pan_flaps < -1.0f) manual_control.aux1_cam_pan_flaps = -1.0f; + if (manual_control.aux1_cam_pan_flaps > 1.0f) manual_control.aux1_cam_pan_flaps = 1.0f; + + /* aux inputs */ + manual_control.aux2_cam_tilt = _rc.chan[_rc.function[FUNC_1]].scaled; + if (manual_control.aux2_cam_tilt < -1.0f) manual_control.aux2_cam_tilt = -1.0f; + if (manual_control.aux2_cam_tilt > 1.0f) manual_control.aux2_cam_tilt = 1.0f; + + /* aux inputs */ + manual_control.aux3_cam_zoom = _rc.chan[_rc.function[FUNC_2]].scaled; + if (manual_control.aux3_cam_zoom < -1.0f) manual_control.aux3_cam_zoom = -1.0f; + if (manual_control.aux3_cam_zoom > 1.0f) manual_control.aux3_cam_zoom = 1.0f; + orb_publish(ORB_ID(rc_channels), _rc_pub, &_rc); orb_publish(ORB_ID(manual_control_setpoint), _manual_control_pub, &manual_control); } |