So I tried with a modified version of the example in the link, it still has the same issue
int main() {
// Create device
std::shared_ptr<dai::Device> device = std::make_shared<dai::Device>();
// Create pipeline
dai::Pipeline pipeline(device);
// Create nodes
auto cam = pipeline.create<dai::node::Camera>()->build(dai::CameraBoardSocket::CAM_A);
auto camQIn = cam->inputControl.createInputQueue();
// In some cases (IMX586), this requires an 8k screen to be able to see the full resolution at once
auto streamHighestRes = cam->requestFullResolutionOutput();
// Create script node for still capture
auto script = pipeline.create<dai::node::Script>();
streamHighestRes->link(script->inputs["in"]);
// Current workaround for OAK4 cameras, as Camera node doesn't yet support "still" frame capture
script->setScript(R"(
while True:
message = node.inputs["in"].tryGet()
if message is not None:
trigger = node.inputs["trigger"].tryGet()
if trigger is not None:
node.warn("Trigger received!")
node.io["highest_res"].trySend(message)
)");
// If 8k, we can only have 1 output stream, so we need to use ImageManip to downscale
auto imgManip = pipeline.create<dai::node::ImageManip>();
streamHighestRes->link(imgManip->inputImage);
imgManip->initialConfig->setOutputSize(1333, 1000);
imgManip->setMaxOutputFrameSize(1333 * 1000 * 3);
auto downscaledResQ = imgManip->out.createOutputQueue();
auto highestResQ = script->outputs["highest_res"].createOutputQueue();
auto qTrigger = script->inputs["trigger"].createInputQueue();
// Start pipeline
pipeline.start();
std::cout << "To capture an image, press 'c'" << std::endl;
int input;
while (true) {
auto imgHd = downscaledResQ->get<dai::ImgFrame>();
if (imgHd == nullptr) continue;
std::cin >> input;
if (input == 1)
break;
else if (input == 2)
qTrigger->send(std::make_shared<dai::Buffer>());
// Send a trigger message to the Script node
if (highestResQ->has()) {
auto highresImg = highestResQ->tryGet<dai::ImgFrame>();
}
}
return 0;
}
I still get exceptions thrown
Exception thrown at 0x00007FF868CB5369 in test-oak.exe: Microsoft C++ exception: dai::MessageQueue::QueueException at memory location 0x00000025E5CFF270.
Exception thrown at 0x00007FF868CB5369 in test-oak.exe: Microsoft C++ exception: dai::MessageQueue::QueueException at memory location 0x00000025E5EFE500.
Exception thrown at 0x00007FF868CB5369 in test-oak.exe: Microsoft C++ exception: dai::MessageQueue::QueueException at memory location 0x00000025E5DFE220.
Exception thrown at 0x00007FF868CB5369 in test-oak.exe: Microsoft C++ exception: dai::MessageQueue::QueueException at memory location 0x00000025E5BFF3C0.
The thread 20296 has exited with code 0 (0x0).
The thread 20652 has exited with code 0 (0x0).
The thread 8268 has exited with code 0 (0x0).
The thread 20832 has exited with code 0 (0x0).
Exception thrown at 0x00007FF868CB5369 in test-oak.exe: Microsoft C++ exception: dai::MessageQueue::QueueException at memory location 0x00000025E60FE5E8.
The thread 21948 has exited with code 0 (0x0).
The thread 'EventRead00Thr' (19576) has exited with code 0 (0x0).
Exception thrown at 0x00007FF868CB5369 in test-oak.exe: Microsoft C++ exception: dai::XLinkReadError at memory location 0x00000025E59FF070.
Exception thrown at 0x00007FF868CB5369 in test-oak.exe: Microsoft C++ exception: dai::XLinkReadError at memory location 0x00000025E5FFEAC0.
Exception thrown at 0x00007FF868CB5369 in test-oak.exe: Microsoft C++ exception: dai::XLinkReadError at memory location 0x00000025E5AFE940.
Im not sure its such a good idea to just catch all exceptions coming from your runtime and ignore them, is there truly no other way?