Skip to content
Next Next commit
Ir brightness control based on normalized intensity, instead of current.
  • Loading branch information
zrezke committed Nov 6, 2023
commit 4a711692a43bae0e0173874a33376d4613a68d57
2 changes: 1 addition & 1 deletion examples/SpatialDetection/spatial_calculator_multi_roi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ int main() {

// Connect to device and start pipeline
dai::Device device(pipeline);
device.setIrLaserDotProjectorBrightness(1000);
device.setIrLaserDotProjectorBrightness(0.7f);

// Output queue will be used to get the depth frames from the outputs defined above
auto depthQueue = device.getOutputQueue("depth", 4, false);
Expand Down
15 changes: 8 additions & 7 deletions include/depthai/device/DeviceBase.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -485,27 +485,28 @@ class DeviceBase {
LogLevel getLogOutputLevel();

/**
* Sets the brightness of the IR Laser Dot Projector. Limits: up to 765mA at 30% duty cycle, up to 1200mA at 6% duty cycle.
* Sets the brightness of the IR Laser Dot Projector. Limits: up to 765mA at 30% frame time duty cycle when exposure time is longer than 30% frame time.
* Otherwise, duty cycle is 100% of exposure time, with increased current 765mA + linearly interpolated based on difference between 30% frame time and exposure time.
* The duty cycle is controlled by `left` camera STROBE, aligned to start of exposure.
* The emitter is turned off by default
*
* @param mA Current in mA that will determine brightness, 0 or negative to turn off
* @param intensity Intensity on range 0 to 1, that will determine brightness. 0 or negative to turn off
* @param mask Optional mask to modify only Left (0x1) or Right (0x2) sides on OAK-D-Pro-W-DEV
* @returns True on success, false if not found or other failure
*/
bool setIrLaserDotProjectorBrightness(float mA, int mask = -1);
bool setIrLaserDotProjectorBrightness(float intensity, int mask = -1);

/**
* Sets the brightness of the IR Flood Light. Limits: up to 1500mA at 30% duty cycle.
* Sets the brightness of the IR Flood Light. Limits: Intensity is directly normalized to 0 - 1500mA current.
* The duty cycle is 30% when exposure time is longer than 30% frame time. Otherwise, duty cycle is 100% of exposure time.
* The duty cycle is controlled by the `left` camera STROBE, aligned to start of exposure.
* If the dot projector is also enabled, its lower duty cycle limits take precedence.
* The emitter is turned off by default
*
* @param mA Current in mA that will determine brightness, 0 or negative to turn off
* @param intensity Intensity on range 0 to 1, that will determine brightness, 0 or negative to turn off
* @param mask Optional mask to modify only Left (0x1) or Right (0x2) sides on OAK-D-Pro-W-DEV
* @returns True on success, false if not found or other failure
*/
bool setIrFloodLightBrightness(float mA, int mask = -1);
bool setIrFloodLightBrightness(float intensity, int mask = -1);

/**
* Retrieves detected IR laser/LED drivers.
Expand Down
8 changes: 4 additions & 4 deletions src/device/DeviceBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1084,12 +1084,12 @@ LogLevel DeviceBase::getLogOutputLevel() {
return pimpl->getLogLevel();
}

bool DeviceBase::setIrLaserDotProjectorBrightness(float mA, int mask) {
return pimpl->rpcClient->call("setIrLaserDotProjectorBrightness", mA, mask);
bool DeviceBase::setIrLaserDotProjectorBrightness(float intensity, int mask) {
return pimpl->rpcClient->call("setIrLaserDotProjectorBrightness", intensity, mask);
}

bool DeviceBase::setIrFloodLightBrightness(float mA, int mask) {
return pimpl->rpcClient->call("setIrFloodLightBrightness", mA, mask);
bool DeviceBase::setIrFloodLightBrightness(float intensity, int mask) {
return pimpl->rpcClient->call("setIrFloodLightBrightness", intensity, mask);
}

std::vector<std::tuple<std::string, int, int>> DeviceBase::getIrDrivers() {
Expand Down