diff --git a/cmake/Depthai/DepthaiDeviceSideConfig.cmake b/cmake/Depthai/DepthaiDeviceSideConfig.cmake index e651ba114..a2ce841a1 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 "6c0eed5cbc62fb423e96e4be9e720ab8033e02f5") +set(DEPTHAI_DEVICE_SIDE_COMMIT "7860565c090169995160ad19b69f36c34667e21b") # "version if applicable" set(DEPTHAI_DEVICE_SIDE_VERSION "") diff --git a/include/depthai/device.hpp b/include/depthai/device.hpp index 5945b3ee1..61efdf939 100644 --- a/include/depthai/device.hpp +++ b/include/depthai/device.hpp @@ -6,6 +6,7 @@ //shared #include "depthai-shared/xlink/xlink_wrapper.hpp" +#include "depthai-shared/metadata/camera_control.hpp" //project #include "nlohmann/json.hpp" @@ -47,6 +48,9 @@ class Device{ void request_af_trigger(); void request_af_mode(CaptureMetadata::AutofocusMode mode); void send_disparity_confidence_threshold(uint8_t confidence); + void send_camera_control(CameraControl::CamId camera_id, + CameraControl::Command command_id, + const std::string &extra_args); std::map get_nn_to_depth_bbox_mapping(); @@ -123,4 +127,4 @@ class Device{ XLinkHandler_t g_xlink_device_handler = {}; -}; \ No newline at end of file +}; diff --git a/include/depthai/host_capture_command.hpp b/include/depthai/host_capture_command.hpp index 8f29cfd43..6cfaf8e59 100644 --- a/include/depthai/host_capture_command.hpp +++ b/include/depthai/host_capture_command.hpp @@ -4,6 +4,7 @@ #include "depthai-shared/general/data_subject.hpp" #include "depthai-shared/stream/stream_data.hpp" #include "depthai-shared/metadata/capture_metadata.hpp" +#include "depthai-shared/metadata/camera_control.hpp" class HostCaptureCommand : public DataSubject @@ -15,6 +16,9 @@ class HostCaptureCommand void afTrigger(); void sendDisparityConfidenceThreshold(uint8_t confidence_thr); void sendCustomDeviceResetRequest(void); + void sendCameraControl(CameraControl::CamId camera_id, + CameraControl::Command command_id, + std::string extra_args = ""); private: StreamInfo stream; diff --git a/shared/depthai-shared b/shared/depthai-shared index d00fdd7ca..af72ef4dc 160000 --- a/shared/depthai-shared +++ b/shared/depthai-shared @@ -1 +1 @@ -Subproject commit d00fdd7ca68878978f0eeb2191dc295ff2da4189 +Subproject commit af72ef4dcbe3008dc58ac3565fbf7e851fd82929 diff --git a/src/device.cpp b/src/device.cpp index c9a2bbea1..21729edfc 100644 --- a/src/device.cpp +++ b/src/device.cpp @@ -1275,6 +1275,14 @@ void Device::send_disparity_confidence_threshold(uint8_t confidence){ } } +void Device::send_camera_control(CameraControl::CamId camera_id, + CameraControl::Command command_id, + const std::string &extra_args) { + if(g_host_capture_command != nullptr) { + g_host_capture_command->sendCameraControl(camera_id, command_id, extra_args.c_str()); + } +} + std::map Device::get_nn_to_depth_bbox_mapping(){ return nn_to_depth_mapping; } diff --git a/src/host_capture_command.cpp b/src/host_capture_command.cpp index 75afcf7d4..ec4859b87 100644 --- a/src/host_capture_command.cpp +++ b/src/host_capture_command.cpp @@ -27,6 +27,17 @@ void HostCaptureCommand::sendCustomDeviceResetRequest(void){ notifyObservers(stream, custom_reset); } +void HostCaptureCommand::sendCameraControl(CameraControl::CamId camera_id, + CameraControl::Command command_id, + std::string extra_args) { + std::string cmdfull = CameraControl::createCommandStr(camera_id, command_id, extra_args); + StreamData cmd_data; + cmd_data.packet_number = 0; + cmd_data.data = (void*)cmdfull.c_str(); + cmd_data.size = cmdfull.size() + 1 /*NULL terminator*/; + notifyObservers(stream, cmd_data); +} + void HostCaptureCommand::capture(){ sendCaptureMetadata(CaptureMetadata::createStillCapture()); }