Hi,
I'm using the OAK line to do some CV. I tried this using the USB and PoE cams - but end up with this same error. The other behavior I have noticed is depth fps dropping to 0. Here's my setup: (Apologies for the bad formatting)
Oak_pipeline::Oak_pipeline(std::string config_file_path) {
std::string detectorNNPath("/home/thiru/Documents/models/yolov6nr3_coco_640x352.blob");
std::string embedderNNPath("/home/thiru/Documents/models/mobilenetv2_imagenet_embedder_224x224.blob");
// Define sources and outputs
camRgb = pipeline_.create<dai::node::ColorCamera>();
auto monoLeft = pipeline_.create<dai::node::MonoCamera>();
auto monoRight = pipeline_.create<dai::node::MonoCamera>();
auto depth = pipeline_.create<dai::node::StereoDepth>();
auto detectionNetwork = pipeline_.create<dai::node::YoloDetectionNetwork>();
auto scriptNode = pipeline_.create<dai::node::Script>();
auto imageManipNode = pipeline_.create<dai::node::ImageManip>();
auto embeddingNetwork = pipeline_.create<dai::node::NeuralNetwork>();
auto xoutRgb = pipeline_.create<dai::node::XLinkOut>();
auto xoutDepth = pipeline_.create<dai::node::XLinkOut>();
auto xoutDetections = pipeline_.create<dai::node::XLinkOut>();
auto xoutEmbeddings = pipeline_.create<dai::node::XLinkOut>();
auto xoutAlgo = pipeline_.create<dai::node::XLinkOut>();
// Properties
camRgb->setPreviewSize(640, 352);
previewSize_ = camRgb->getPreviewSize();
camRgb->setResolution(dai::ColorCameraProperties::SensorResolution::THE_1080_P);
resolutionSize_ = camRgb->getResolutionSize();
camRgb->setInterleaved(false);
camRgb->setColorOrder(dai::ColorCameraProperties::ColorOrder::BGR);
camRgb->setBoardSocket(dai::CameraBoardSocket::CAM_A);
camRgb->setFps(10);
camRgb->inputConfig.setBlocking(false);
camRgb->inputControl.setBlocking(false);
monoLeft->setResolution(dai::MonoCameraProperties::SensorResolution::THE_400_P);
monoLeft->setBoardSocket(dai::CameraBoardSocket::CAM_B);
monoLeft->inputControl.setBlocking(false);
monoRight->setResolution(dai::MonoCameraProperties::SensorResolution::THE_400_P);
monoRight->setBoardSocket(dai::CameraBoardSocket::CAM_C);
monoRight->inputControl.setBlocking(false);
depth->initialConfig.setConfidenceThreshold(200);
depth->setRectifyEdgeFillColor(0);
depth->setSubpixel(true);
depth->setOutputSize(640, 480);
depth->setLeftRightCheck(true);
depth->setDepthAlign(dai::CameraBoardSocket::CAM_A);
depth->initialConfig.setMedianFilter(dai::MedianFilter(7));
depth->initialConfig.setLeftRightCheckThreshold(5);
depth->inputConfig.setBlocking(false);
detectionNetwork->setBlobPath(detectorNNPath);
embeddingNetwork->setBlobPath(embedderNNPath);
imageManipNode->initialConfig.setResize(224, 224);
imageManipNode->inputConfig.setBlocking(false);
// Network specific settings
detectionNetwork->setConfidenceThreshold(0.6);
detectionNetwork->setNumClasses(80);
detectionNetwork->setCoordinateSize(4);
detectionNetwork->setNumPoolFrames(4);
detectionNetwork->setAnchors({10, 14, 23, 27, 37, 58, 81, 82, 135, 169, 344, 319});
detectionNetwork->setAnchorMasks({{"side26", {1, 2, 3}}, {"side13", {3, 4, 5}}});
detectionNetwork->setIouThreshold(0.5);
detectionNetwork->setNumInferenceThreads(2);
detectionNetwork->input.setBlocking(false);
embeddingNetwork->setNumInferenceThreads(2);
embeddingNetwork->input.setBlocking(false);xoutRgb->setStreamName("_rgb");
xoutRgb->input.setBlocking(false);
xoutDepth->setStreamName("_depth");
xoutDepth->input.setBlocking(false);
xoutDetections->setStreamName("_detections");
xoutDetections->input.setBlocking(false);
xoutEmbeddings->setStreamName("_embeddings");
xoutEmbeddings->input.setBlocking(false);
xoutAlgo->setStreamName("_algo");
xoutAlgo->input.setBlocking(false);
// Linking
camRgb->preview.link(scriptNode->inputs["scriptInRgb"]); //
camRgb->preview.link(xoutRgb->input);
camRgb->preview.link(detectionNetwork->input);
monoLeft->out.link(depth->left);
monoRight->out.link(depth->right);
depth->depth.link(xoutDepth->input);
depth->depth.link(scriptNode->inputs["scriptInDepth"]); //
detectionNetwork->passthrough.link(xoutDetections->input);
detectionNetwork->out.link(scriptNode->inputs["scriptInDetections"]); //
embeddingNetwork->passthrough.link(xoutEmbeddings->input);
scriptNode->setScript(R"( n=0 while True: node.warn("node"+str(n)) n+=1 sRgb = node.io["scriptInRgb"].tryGet() if sRgb is None: continue #node.warn("depth try") sDepth = node.io["scriptInDepth"].tryGet() #node.warn("det try") sDetection = node.io["scriptInDetections"].tryGet() if sDepth is None: node.warn("depth prob") #sDepth = ImgFrame(ImgFrame.Type.NONE) sDepth = sRgb #node.warn("set config") sConfig = ImageManipConfig() #node.warn("set config224") sConfig.setResize(224, 224) #node.warn("create group") sOutMessage = MessageGroup() #node.warn("set rgb") sOutMessage['rgb'] = sRgb #node.warn("set dep") sOutMessage['depth'] = sDepth #node.warn("set det") sOutMessage['detections'] = sDetection #node.warn(str(sDetection)) if sDetection is not None and len(sDetection.detections)>0: num_det = 0 #node.warn("detssss"+str(len(sDetection.detections))) for det in sDetection.detections: # SEND IMAGE AND GET THE CROPPED DETECTION sConfig.setCropRect(det.xmin, det.ymin, det.xmax, det.ymax) node.io["sOutManipConfig"].send(sConfig) node.io["sOutForCrop"].send(sRgb) #node.warn("crop wait") sCrop = node.io['sInCropped'].get() # SEND THE CROPPED DETECTION AND GET THE CORRESPONDING EMBEDDING node.io['sOutCropped'].send(sCrop) num_det+=1 sOutMessage[f'crop_{num_det}'] = sCrop #4, 6, #node.warn("embed wait") sEmbedding = node.io['sInEmbedding'].get() sOutMessage[f'embedding_{num_det}'] = sEmbedding #5, 7, #node.warn("sending") node.io['sOutFin'].send(sOutMessage))");
scriptNode->outputs["sOutManipConfig"].link(imageManipNode->inputConfig);
scriptNode->outputs["sOutForCrop"].link(imageManipNode->inputImage);
imageManipNode->out.link(scriptNode->inputs["sInCropped"]);
scriptNode->outputs["sOutCropped"].link(embeddingNetwork->input);
embeddingNetwork->out.link(scriptNode->inputs["sInEmbedding"]);
scriptNode->outputs["sOutFin"].link(xoutAlgo->input);}
Gave me the following error after processing few frames:
[18443010F1939C0F00] [192.168.5.150] [11.001] [system] [critical] Fatal error. Please report to developers. Log: 'Fatal error on MSS CPU: trap: 09, address: 802BD2D0' '0'
terminate called after throwing an instance of 'std::runtime_error'
what(): Communication exception - possible device error/misconfiguration. Original message 'Couldn't read data from stream: '_algo' (X_LINK_ERROR)'
[ros2run]: Aborted
Thanks in advance!