From 0ec322ee47e31b9c82d0e701753764aefa425895 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 11 Oct 2013 21:30:01 +1100 Subject: [PATCH] Plane: support MAV_CMD_DO_SET_CAM_TRIGG_DIST --- ArduPlane/GCS_Mavlink.pde | 9 +++++++++ ArduPlane/commands_logic.pde | 4 ++++ 2 files changed, 13 insertions(+) diff --git a/ArduPlane/GCS_Mavlink.pde b/ArduPlane/GCS_Mavlink.pde index 77e2dd8402..0c98ee5ad8 100644 --- a/ArduPlane/GCS_Mavlink.pde +++ b/ArduPlane/GCS_Mavlink.pde @@ -1385,6 +1385,10 @@ void GCS_MAVLINK::handleMessage(mavlink_message_t* msg) param2 = tell_command.alt; param1 = tell_command.p1; break; + + case MAV_CMD_DO_SET_CAM_TRIGG_DIST: + param1 = tell_command.alt; + break; } mavlink_msg_mission_item_send(chan,msg->sysid, @@ -1677,6 +1681,11 @@ void GCS_MAVLINK::handleMessage(mavlink_message_t* msg) case MAV_CMD_DO_DIGICAM_CONTROL: break; + case MAV_CMD_DO_SET_CAM_TRIGG_DIST: + // use alt so we can support 32 bit values + tell_command.alt = packet.param1; + break; + default: result = MAV_MISSION_UNSUPPORTED; break; diff --git a/ArduPlane/commands_logic.pde b/ArduPlane/commands_logic.pde index c930f8f218..ad740b204c 100644 --- a/ArduPlane/commands_logic.pde +++ b/ArduPlane/commands_logic.pde @@ -116,6 +116,10 @@ static void handle_process_do_command() case MAV_CMD_DO_DIGICAM_CONTROL: // Mission command to control an on-board camera controller system. |Session control e.g. show/hide lens| Zoom's absolute position| Zooming step value to offset zoom from the current position| Focus Locking, Unlocking or Re-locking| Shooting Command| Command Identity| Empty| do_take_picture(); break; + + case MAV_CMD_DO_SET_CAM_TRIGG_DIST: + camera.set_trigger_distance(next_nonnav_command.alt); + break; #endif #if MOUNT == ENABLED