Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ISP 3A camera controls #9

Merged
merged 5 commits into from
Oct 7, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmake/Depthai/DepthaiDeviceSideConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
set(DEPTHAI_DEVICE_SIDE_MATURITY "snapshot")

# "full commit hash of device side binary"
set(DEPTHAI_DEVICE_SIDE_COMMIT "2f9c918bc823a0fbeb4ce54696966045ca7cb13c")
set(DEPTHAI_DEVICE_SIDE_COMMIT "986dd413a954497ab76af4f9afdc5b2c8d404423")

# "version if applicable"
set(DEPTHAI_DEVICE_SIDE_VERSION "")
3 changes: 3 additions & 0 deletions include/depthai/device.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

//shared
#include "depthai-shared/xlink/xlink_wrapper.hpp"
#include "depthai-shared/metadata/camera_control.hpp"

//project
#include "nlohmann/json.hpp"
Expand Down Expand Up @@ -47,6 +48,8 @@ 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(Isp3A_CamId camera_id, Isp3A_Commands command_id,
const std::string &extra_args);

std::map<std::string, int> get_nn_to_depth_bbox_mapping();

Expand Down
1 change: 1 addition & 0 deletions include/depthai/host_capture_command.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class HostCaptureCommand
void afTrigger();
void sendDisparityConfidenceThreshold(uint8_t confidence_thr);
void sendCustomDeviceResetRequest(void);
void sendIsp3A(int camera_id, int command_id, const char *extra_args);

private:
StreamInfo stream;
Expand Down
2 changes: 1 addition & 1 deletion shared/depthai-shared
7 changes: 7 additions & 0 deletions src/device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1258,6 +1258,13 @@ void Device::send_disparity_confidence_threshold(uint8_t confidence){
}
}

void Device::send_camera_control(Isp3A_CamId camera_id, Isp3A_Commands command_id,
const std::string &extra_args) {
if(g_host_capture_command != nullptr) {
g_host_capture_command->sendIsp3A(camera_id, command_id, extra_args.c_str());
}
}

std::map<std::string, int> Device::get_nn_to_depth_bbox_mapping(){
return nn_to_depth_mapping;
}
10 changes: 10 additions & 0 deletions src/host_capture_command.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,16 @@ void HostCaptureCommand::sendCustomDeviceResetRequest(void){
notifyObservers(stream, custom_reset);
}

void HostCaptureCommand::sendIsp3A(int camera_id, int command_id, const char *extra_args) {
alex-luxonis marked this conversation as resolved.
Show resolved Hide resolved
StreamData cmd_data;
char cmdfull[256];
snprintf(cmdfull, sizeof cmdfull, "3A %d %d %s", command_id, camera_id, extra_args);
cmd_data.packet_number = 0;
cmd_data.data = cmdfull;
cmd_data.size = strlen(cmdfull) + 1;
notifyObservers(stream, cmd_data);
}

void HostCaptureCommand::capture(){
sendCaptureMetadata(CaptureMetadata::createStillCapture());
}
Expand Down