diff --git a/ArduPlane/GCS_Mavlink.cpp b/ArduPlane/GCS_Mavlink.cpp index b5caf866ac..338d4c3503 100644 --- a/ArduPlane/GCS_Mavlink.cpp +++ b/ArduPlane/GCS_Mavlink.cpp @@ -1202,13 +1202,14 @@ void GCS_MAVLINK::handleMessage(mavlink_message_t* msg) break; case MAV_CMD_DO_DIGICAM_CONTROL: - plane.camera.control(packet.param1, - packet.param2, - packet.param3, - packet.param4, - packet.param5, - packet.param6); - + if (plane.camera.control(packet.param1, + packet.param2, + packet.param3, + packet.param4, + packet.param5, + packet.param6)) { + plane.log_picture(); + } result = MAV_RESULT_ACCEPTED; break; #endif // CAMERA == ENABLED diff --git a/ArduPlane/commands_logic.cpp b/ArduPlane/commands_logic.cpp index a49ae86e7c..a422e68f73 100644 --- a/ArduPlane/commands_logic.cpp +++ b/ArduPlane/commands_logic.cpp @@ -923,13 +923,14 @@ void Plane::do_digicam_configure(const AP_Mission::Mission_Command& cmd) void Plane::do_digicam_control(const AP_Mission::Mission_Command& cmd) { #if CAMERA == ENABLED - camera.control(cmd.content.digicam_control.session, - cmd.content.digicam_control.zoom_pos, - cmd.content.digicam_control.zoom_step, - cmd.content.digicam_control.focus_lock, - cmd.content.digicam_control.shooting_cmd, - cmd.content.digicam_control.cmd_id); - log_picture(); + if (camera.control(cmd.content.digicam_control.session, + cmd.content.digicam_control.zoom_pos, + cmd.content.digicam_control.zoom_step, + cmd.content.digicam_control.focus_lock, + cmd.content.digicam_control.shooting_cmd, + cmd.content.digicam_control.cmd_id)) { + log_picture(); + } #endif }