From 30e867d4de7d1d759dbc8258ca20564b9aa6fb41 Mon Sep 17 00:00:00 2001 From: Claudio Micheli Date: Fri, 20 May 2022 02:05:44 -0400 Subject: [PATCH] navigator_main: use camera_trigger driver for single captures Signed-off-by: Claudio Micheli --- src/modules/navigator/navigator_main.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/modules/navigator/navigator_main.cpp b/src/modules/navigator/navigator_main.cpp index 380052ba7a..b414555c63 100644 --- a/src/modules/navigator/navigator_main.cpp +++ b/src/modules/navigator/navigator_main.cpp @@ -1500,8 +1500,20 @@ void Navigator::publish_vehicle_cmd(vehicle_command_s *vcmd) switch (vcmd->command) { case NAV_CMD_IMAGE_START_CAPTURE: - // We are only capturing multiple if param3 is 0 or > 1. - if (static_cast(vcmd->param3) != 1) { + if (static_cast(vcmd->param3) == 1) { + // When sending a single capture we need to include the sequence number, thus camera_trigger needs to handle this cmd + vcmd->param1 = 0.0f; + vcmd->param2 = 0.0f; + vcmd->param3 = 0.0f; + vcmd->param4 = 0.0f; + vcmd->param5 = 1.0; + vcmd->param6 = 0.0; + vcmd->param7 = 0.0f; + vcmd->command = vehicle_command_s::VEHICLE_CMD_DO_DIGICAM_CONTROL; + + } else { + // We are only capturing multiple if param3 is 0 or > 1. + // For multiple pictures the sequence number does not need to be included, thus there is no need to go through camera_trigger _is_capturing_images = true; }