Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
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 "b3d7c6a54185ca2f91ec5d20743da3cee7f0e67e")
set(DEPTHAI_DEVICE_SIDE_COMMIT "c67b7323499f77cec598e0841535fe1880006220")

# "version if applicable"
set(DEPTHAI_DEVICE_SIDE_VERSION "")
2 changes: 1 addition & 1 deletion include/depthai/pipeline/node/Gate.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class Gate : public DeviceNodeCRTP<DeviceNode, Gate, GateProperties> {
* * Default queue size: 4
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update the comment as well

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done here: f9cc18a

* Blocking: False
*/
Input input{*this, {"input", DEFAULT_GROUP, false, 4, {{{DatatypeEnum::Buffer, true}}}, DEFAULT_WAIT_FOR_MESSAGE}};
Input input{*this, {"input", DEFAULT_GROUP, false, 1, {{{DatatypeEnum::Buffer, true}}}, DEFAULT_WAIT_FOR_MESSAGE}};

/**
* @brief Main data output.
Expand Down
53 changes: 53 additions & 0 deletions tests/src/ondevice_tests/pipeline/node/gate_node_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,3 +135,56 @@ TEST_CASE("Test Gate N Messages") {
}
}
}

TEST_CASE("Two Queue from one camera") {
dai::Pipeline pipeline;

auto camera = pipeline.create<dai::node::Camera>()->build();

auto cameraOutGate = camera->requestOutput(std::make_pair(640, 400), std::nullopt, dai::ImgResizeMode::CROP, 30);
auto cameraOut = camera->requestOutput(std::make_pair(640, 400), std::nullopt, dai::ImgResizeMode::CROP, 30);

auto gate = pipeline.create<dai::node::Gate>();

cameraOutGate->link(gate->input);

auto cameraGateQueue = gate->output.createOutputQueue(8, false);
auto cameraQueue = cameraOut->createOutputQueue();

auto gateControlQueue = gate->inputControl.createInputQueue();

gate->initialConfig->open = false;
gate->initialConfig->numMessages = -1;

pipeline.start();

int msgsFromGateCount = 0;
int msgsFromCameraCount = 0;

const double testDuration = 3.0; // Run for 3 seconds
auto startTime = std::chrono::steady_clock::now();

while(pipeline.isRunning()) {
auto now = std::chrono::steady_clock::now();
std::chrono::duration<double> elapsed = now - startTime;

if(elapsed.count() >= testDuration) {
break;
}

auto msgFromGate = cameraGateQueue->tryGet<dai::ImgFrame>();
auto msgFromCamera = cameraQueue->tryGet<dai::ImgFrame>();

if(msgFromGate) {
msgsFromGateCount += 1;
}
if(msgFromCamera) {
msgsFromCameraCount += 1;
}
}

CHECK(msgsFromGateCount == 0);
CHECK(msgsFromCameraCount > 60);

std::cout << "Gate frames: " << msgsFromGateCount << " | Camera frames: " << msgsFromCameraCount << std::endl;
}
Loading