Hello,
I have set up an Luxonis OAK D pro Poe to trigger from the external input, this is done by the following code:
//ext trigger
camRgb->initialControl.setFrameSyncMode(dai::CameraControl::FrameSyncMode::INPUT);
camRgb->initialControl.setExternalTrigger(4, 4);
(same for the left and right channels)
and the OutputQue is configured as follows:
qRgb = device->getOutputQueue("rgb", 1, false);
qDepth = device->getOutputQueue("disparity", 1, false);
When I run the code (and the rest of my program) most times everything works fine. But sometimes after starting the software and thus setting up the camera all the frames lag by one, which causes the robot to miss.
The problem lies within the camera as I am constantly waiting on an image with the following code:
auto inRgb = qRgb->get
[dai::ImgFrame
](dai::ImgFrame)();
auto inDepth = qDepth->get<dai::ImgFrame>();
if (inDepth && inRgb) {
Color = inRgb->getCvFrame();
Depth = inDepth->getCvFrame();
}
Any ideas on what to do? Is ther a way to flush the output que?
It is hard to reproduce the fault as it happens about 1/5th of the time.
Kind regards,
Pim