aboutsummaryrefslogtreecommitdiff
path: root/src/modules/uORB/topics/manual_control_setpoint.h
diff options
context:
space:
mode:
authorAnton Babushkin <anton.babushkin@me.com>2014-04-03 17:26:07 +0400
committerAnton Babushkin <anton.babushkin@me.com>2014-04-03 17:26:07 +0400
commit1d5f62d890d1d85cef5e0f8e282d8e9e70717d46 (patch)
treec235ca7d98e1479ba48e1068e47c1e4e666808e1 /src/modules/uORB/topics/manual_control_setpoint.h
parent2c4792d48ee98cf46d9f9cf8ec43a759d6cc15d0 (diff)
downloadpx4-firmware-1d5f62d890d1d85cef5e0f8e282d8e9e70717d46.tar.gz
px4-firmware-1d5f62d890d1d85cef5e0f8e282d8e9e70717d46.tar.bz2
px4-firmware-1d5f62d890d1d85cef5e0f8e282d8e9e70717d46.zip
sensors: use enum for switches position and -1..1 for values in 'manual_control_setpoint' topic
Diffstat (limited to 'src/modules/uORB/topics/manual_control_setpoint.h')
-rw-r--r--src/modules/uORB/topics/manual_control_setpoint.h37
1 files changed, 20 insertions, 17 deletions
diff --git a/src/modules/uORB/topics/manual_control_setpoint.h b/src/modules/uORB/topics/manual_control_setpoint.h
index 5d1384380..985d3923f 100644
--- a/src/modules/uORB/topics/manual_control_setpoint.h
+++ b/src/modules/uORB/topics/manual_control_setpoint.h
@@ -44,6 +44,16 @@
#include "../uORB.h"
/**
+ * Switch position
+ */
+typedef enum {
+ SWITCH_POS_NONE = 0, /**< switch is not mapped */
+ SWITCH_POS_ON, /**< switch activated (value = 1) */
+ SWITCH_POS_MIDDLE, /**< middle position (value = 0) */
+ SWITCH_POS_OFF /**< switch not activated (value = -1) */
+} switch_pos_t;
+
+/**
* @addtogroup topics
* @{
*/
@@ -53,32 +63,25 @@ struct manual_control_setpoint_s {
bool signal_lost; /**< control signal lost, should be checked together with topic timeout */
- float roll; /**< ailerons roll / roll rate input */
- float pitch; /**< elevator / pitch / pitch rate */
- float yaw; /**< rudder / yaw rate / yaw */
- float throttle; /**< throttle / collective thrust / altitude */
-
- float mode_switch; /**< mode 3 position switch (mandatory): manual, assisted, auto */
- float return_switch; /**< land 2 position switch (mandatory): land, no effect */
- float assisted_switch; /**< assisted 2 position switch (optional): seatbelt, simple */
- float mission_switch; /**< mission 2 position switch (optional): mission, loiter */
-
/**
- * Any of the channels below may not be available and be set to NaN
+ * Any of the channels may not be available and be set to NaN
* to indicate that it does not contain valid data.
*/
-
- // XXX needed or parameter?
- //float auto_offboard_input_switch; /**< controller setpoint source (0 = onboard, 1 = offboard) */
-
- float flaps; /**< flap position */
-
+ float roll; /**< ailerons roll / roll rate input, -1..1 */
+ float pitch; /**< elevator / pitch / pitch rate, -1..1 */
+ float yaw; /**< rudder / yaw rate / yaw, -1..1 */
+ float throttle; /**< throttle / collective thrust / altitude, 0..1 */
+ float flaps; /**< flap position */
float aux1; /**< default function: camera yaw / azimuth */
float aux2; /**< default function: camera pitch / tilt */
float aux3; /**< default function: camera trigger */
float aux4; /**< default function: camera roll */
float aux5; /**< default function: payload drop */
+ switch_pos_t mode_switch; /**< mode 3 position switch (mandatory): manual, assisted, auto */
+ switch_pos_t return_switch; /**< land 2 position switch (mandatory): land, no effect */
+ switch_pos_t assisted_switch; /**< assisted 2 position switch (optional): seatbelt, simple */
+ switch_pos_t mission_switch; /**< mission 2 position switch (optional): mission, loiter */
}; /**< manual control inputs */
/**