manual_contol_setpoint: fix mode slot numbering (#12578)

* This fix is necessary because usually uORB structs get initialized with
all zeros and then get filled with the fields that are actually in use.
 * The number 0 for the mode slot was already commanding to switch to the
mode in slot one even though for example the joystick input via mavlink
does not use this mechanism at all.
This commit is contained in:
Matthias Grob
2019-08-01 18:27:58 +02:00
committed by Daniel Agar
parent 5d986f2030
commit d0f1a551e9
3 changed files with 17 additions and 18 deletions
+9 -9
View File
@@ -4,14 +4,14 @@ uint8 SWITCH_POS_NONE = 0 # switch is not mapped
uint8 SWITCH_POS_ON = 1 # switch activated (value = 1)
uint8 SWITCH_POS_MIDDLE = 2 # middle position (value = 0)
uint8 SWITCH_POS_OFF = 3 # switch not activated (value = -1)
int8 MODE_SLOT_NONE = -1 # no mode slot assigned
int8 MODE_SLOT_1 = 0 # mode slot 1 selected
int8 MODE_SLOT_2 = 1 # mode slot 2 selected
int8 MODE_SLOT_3 = 2 # mode slot 3 selected
int8 MODE_SLOT_4 = 3 # mode slot 4 selected
int8 MODE_SLOT_5 = 4 # mode slot 5 selected
int8 MODE_SLOT_6 = 5 # mode slot 6 selected
int8 MODE_SLOT_MAX = 6 # number of slots plus one
uint8 MODE_SLOT_NONE = 0 # no mode slot assigned
uint8 MODE_SLOT_1 = 1 # mode slot 1 selected
uint8 MODE_SLOT_2 = 2 # mode slot 2 selected
uint8 MODE_SLOT_3 = 3 # mode slot 3 selected
uint8 MODE_SLOT_4 = 4 # mode slot 4 selected
uint8 MODE_SLOT_5 = 5 # mode slot 5 selected
uint8 MODE_SLOT_6 = 6 # mode slot 6 selected
uint8 MODE_SLOT_NUM = 6 # number of slots
uint8 SOURCE_RC = 1 # radio control
uint8 SOURCE_MAVLINK_0 = 2 # mavlink instance 0
uint8 SOURCE_MAVLINK_1 = 3 # mavlink instance 1
@@ -61,7 +61,7 @@ uint8 kill_switch # throttle kill: _NORMAL_, KILL
uint8 arm_switch # arm/disarm switch: _DISARMED_, ARMED
uint8 transition_switch # VTOL transition switch: _HOVER, FORWARD_FLIGHT
uint8 gear_switch # landing gear switch: _DOWN_, UP
int8 mode_slot # the slot a specific model selector is in
uint8 mode_slot # the slot a specific model selector is in
uint8 data_source # where this input is coming from
uint8 stab_switch # stabilize switch (only relevant for fixed wings, optional): _MANUAL, STABILIZED
uint8 man_switch # manual switch (only relevant for fixed wings, optional): _STABILIZED_, MANUAL