From 58580914271b181d7189c9172d389e6fe8d77f34 Mon Sep 17 00:00:00 2001 From: alex-luxonis Date: Sat, 30 Jul 2022 00:56:39 +0300 Subject: [PATCH] CameraControl: add `setControlMode`, `setCaptureIntent` --- cmake/Depthai/DepthaiDeviceSideConfig.cmake | 2 +- .../depthai/pipeline/datatype/CameraControl.hpp | 14 ++++++++++++++ shared/depthai-shared | 2 +- src/pipeline/datatype/CameraControl.cpp | 10 ++++++++++ 4 files changed, 26 insertions(+), 2 deletions(-) diff --git a/cmake/Depthai/DepthaiDeviceSideConfig.cmake b/cmake/Depthai/DepthaiDeviceSideConfig.cmake index e55bd821b..add681a8e 100644 --- a/cmake/Depthai/DepthaiDeviceSideConfig.cmake +++ b/cmake/Depthai/DepthaiDeviceSideConfig.cmake @@ -2,7 +2,7 @@ set(DEPTHAI_DEVICE_SIDE_MATURITY "snapshot") # "full commit hash of device side binary" -set(DEPTHAI_DEVICE_SIDE_COMMIT "ae8f3bcc5e17f57c8686ada8e103587437a54570") +set(DEPTHAI_DEVICE_SIDE_COMMIT "7e834339d54869a99f7934aa952a6892323341e8") # "version if applicable" set(DEPTHAI_DEVICE_SIDE_VERSION "") diff --git a/include/depthai/pipeline/datatype/CameraControl.hpp b/include/depthai/pipeline/datatype/CameraControl.hpp index c9606f817..4160d8361 100644 --- a/include/depthai/pipeline/datatype/CameraControl.hpp +++ b/include/depthai/pipeline/datatype/CameraControl.hpp @@ -40,6 +40,8 @@ class CameraControl : public Buffer { using AutoWhiteBalanceMode = RawCameraControl::AutoWhiteBalanceMode; using SceneMode = RawCameraControl::SceneMode; using EffectMode = RawCameraControl::EffectMode; + using ControlMode = RawCameraControl::ControlMode; + using CaptureIntent = RawCameraControl::CaptureIntent; using FrameSyncMode = RawCameraControl::FrameSyncMode; /// Construct CameraControl message @@ -254,6 +256,18 @@ class CameraControl : public Buffer { */ CameraControl& setEffectMode(EffectMode mode); + /** + * Set a command to specify control mode + * @param mode Control mode + */ + CameraControl& setControlMode(ControlMode mode); + + /** + * Set a command to specify capture intent mode + * @param mode Capture intent mode + */ + CameraControl& setCaptureIntent(CaptureIntent mode); + // Functions to retrieve properties /** * Check whether command to capture a still is set diff --git a/shared/depthai-shared b/shared/depthai-shared index 8bacf258a..2e8b3a4ea 160000 --- a/shared/depthai-shared +++ b/shared/depthai-shared @@ -1 +1 @@ -Subproject commit 8bacf258a2ccf507634da153a7166aec77af1ea7 +Subproject commit 2e8b3a4ea8dbe85a2b364119ca2b0b7405529110 diff --git a/src/pipeline/datatype/CameraControl.cpp b/src/pipeline/datatype/CameraControl.cpp index 8ec645a4f..d824a26a5 100644 --- a/src/pipeline/datatype/CameraControl.cpp +++ b/src/pipeline/datatype/CameraControl.cpp @@ -190,6 +190,16 @@ CameraControl& CameraControl::setEffectMode(EffectMode mode) { cfg.effectMode = mode; return *this; } +CameraControl& CameraControl::setControlMode(ControlMode mode) { + cfg.setCommand(RawCameraControl::Command::CONTROL_MODE); + cfg.controlMode = mode; + return *this; +} +CameraControl& CameraControl::setCaptureIntent(CaptureIntent mode) { + cfg.setCommand(RawCameraControl::Command::CAPTURE_INTENT); + cfg.captureIntent = mode; + return *this; +} bool CameraControl::getCaptureStill() const { return cfg.getCommand(RawCameraControl::Command::STILL_CAPTURE);