luxonis / depthai-ros

Official ROS Driver for DepthAI Sensors.
MIT License
260 stars 189 forks source link

[BUG] RGBStereo fails for OAK-FFC-4P-POE with RGB camera on CAM_D (socket 3) #490

Closed andermi closed 9 months ago

andermi commented 9 months ago

RGBStereo fails for OAK-FFC-4P-POE with RGB camera on CAM_D (socket 3) with exception:

Failed to load node 'port_oak' of type 'depthai_ros_driver::Camera' in container '/port_oak_container': Component constructor threw an exception: _Map_base::at

Although, a second OAK-FFC-4P-POE with RGB camera on CAM_A (socket 0) works just fine.

andermi commented 9 months ago

after searching through the code, I discovered it's hardcoded in base_types.cpp:

std::vector<std::unique_ptr<dai_nodes::BaseNode>> RGBStereo::createPipeline(rclcpp::Node* node,
                                                                            std::shared_ptr<dai::Device> device,
                                                                            std::shared_ptr<dai::Pipeline> pipeline,
                                                                            const std::string& nnType) {
    std::string nTypeUpCase = utils::getUpperCaseStr(nnType);
    auto nType = utils::getValFromMap(nTypeUpCase, nnTypeMap);

    std::vector<std::unique_ptr<dai_nodes::BaseNode>> daiNodes;
    auto rgb = std::make_unique<dai_nodes::SensorWrapper>("rgb", node, pipeline, device, dai::CameraBoardSocket::CAM_A);
    auto left = std::make_unique<dai_nodes::SensorWrapper>("left", node, pipeline, device, dai::CameraBoardSocket::CAM_B);
    auto right = std::make_unique<dai_nodes::SensorWrapper>("right", node, pipeline, device, dai::CameraBoardSocket::CAM_C);
Serafadam commented 9 months ago

Hi, yeah, sockets are hardcoded in the pipeline creation although you should be able to change them using ROS parameter sensor.i_board_socket_id, please let us know if that doesn't work properly.

Serafadam commented 9 months ago

Closing due to inactivity, please reopen if you have further questions.