commander: add support for DO_MOTOR_TEST

- add an optional timeout to test_motor
- enforce a timeout when receiving DO_MOTOR_TEST
- limitation: DO_MOTOR_TEST can only control the MAIN outputs
This commit is contained in:
Beat Küng
2019-10-21 12:12:07 +02:00
parent eb6a9bd488
commit 285ae608a5
7 changed files with 91 additions and 14 deletions
+5 -4
View File
@@ -1,12 +1,13 @@
uint64 timestamp # time since system start (microseconds)
uint8 NUM_MOTOR_OUTPUTS = 8
uint8 ACTION_STOP = 0 # stop motors (disable motor test mode)
uint8 ACTION_RUN = 1 # run motors (enable motor test mode)
uint8 ACTION_STOP = 0 # stop all motors (disable motor test mode)
uint8 ACTION_RUN = 1 # run motor(s) (enable motor test mode)
uint8 action # one of ACTION_* (applies to all motors)
uint32 motor_number # number of motor to spin
float32 value # output power, range [0..1]
uint32 motor_number # number of motor to spin [0..N-1]
float32 value # output power, range [0..1], -1 to stop individual motor
uint32 timeout_ms # timeout in ms after which to exit test mode (if 0, do not time out)
uint8 driver_instance # select output driver (for boards with multiple outputs, like IO+FMU)
+1
View File
@@ -51,6 +51,7 @@ uint16 VEHICLE_CMD_DO_MOUNT_CONTROL=205 # Mission command to control a camera
uint16 VEHICLE_CMD_DO_SET_CAM_TRIGG_DIST=206 # Mission command to set TRIG_DIST for this flight |Camera trigger distance (meters)| Shutter integration time (ms)| Empty| Empty| Empty| Empty| Empty|
uint16 VEHICLE_CMD_DO_FENCE_ENABLE=207 # Mission command to enable the geofence |enable? (0=disable, 1=enable)| Empty| Empty| Empty| Empty| Empty| Empty|
uint16 VEHICLE_CMD_DO_PARACHUTE=208 # Mission command to trigger a parachute |action (0=disable, 1=enable, 2=release, for some systems see PARACHUTE_ACTION enum, not in general message set.)| Empty| Empty| Empty| Empty| Empty| Empty|
uint16 VEHICLE_CMD_DO_MOTOR_TEST=209 # motor test command |Instance (1, ...)| throttle type| throttle| timeout [s]| Motor count | Test order| Empty|
uint16 VEHICLE_CMD_DO_INVERTED_FLIGHT=210 # Change to/from inverted flight |inverted (0=normal, 1=inverted)| Empty| Empty| Empty| Empty| Empty| Empty|
uint16 VEHICLE_CMD_DO_SET_CAM_TRIGG_INTERVAL=214 # Mission command to set TRIG_INTERVAL for this flight |Camera trigger distance (meters)| Shutter integration time (ms)| Empty| Empty| Empty| Empty| Empty|
uint16 VEHICLE_CMD_DO_MOUNT_CONTROL_QUAT=220 # Mission command to control a camera or antenna mount, using a quaternion as reference. |q1 - quaternion param #1, w (1 in null-rotation)| q2 - quaternion param #2, x (0 in null-rotation)| q3 - quaternion param #3, y (0 in null-rotation)| q4 - quaternion param #4, z (0 in null-rotation)| Empty| Empty| Empty|