diff --git a/ArduCopter/GCS_Mavlink.cpp b/ArduCopter/GCS_Mavlink.cpp index 1784d200f6..c67cf996ac 100644 --- a/ArduCopter/GCS_Mavlink.cpp +++ b/ArduCopter/GCS_Mavlink.cpp @@ -1303,13 +1303,14 @@ void GCS_MAVLINK::handleMessage(mavlink_message_t* msg) break; case MAV_CMD_DO_DIGICAM_CONTROL: - copter.camera.control(packet.param1, - packet.param2, - packet.param3, - packet.param4, - packet.param5, - packet.param6); - + if (copter.camera.control(packet.param1, + packet.param2, + packet.param3, + packet.param4, + packet.param5, + packet.param6)) { + copter.log_picture(); + } result = MAV_RESULT_ACCEPTED; break; #endif // CAMERA == ENABLED diff --git a/ArduCopter/commands_logic.cpp b/ArduCopter/commands_logic.cpp index eaa2366b24..c2aa1fa229 100644 --- a/ArduCopter/commands_logic.cpp +++ b/ArduCopter/commands_logic.cpp @@ -873,13 +873,14 @@ void Copter::do_digicam_configure(const AP_Mission::Mission_Command& cmd) void Copter::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 }