diff --git a/corelib/include/rtabmap/core/camera/CameraDepthAI.h b/corelib/include/rtabmap/core/camera/CameraDepthAI.h index cb3f27f3..588f3a79 100644 --- a/corelib/include/rtabmap/core/camera/CameraDepthAI.h +++ b/corelib/include/rtabmap/core/camera/CameraDepthAI.h @@ -104,8 +104,6 @@ private: std::map accBuffer_; std::map gyroBuffer_; UMutex imuMutex_; - - static std::string ProtocolToStr(XLinkProtocol_t val); #endif }; diff --git a/corelib/src/camera/CameraDepthAI.cpp b/corelib/src/camera/CameraDepthAI.cpp index 4634ba1d..fb17212a 100644 --- a/corelib/src/camera/CameraDepthAI.cpp +++ b/corelib/src/camera/CameraDepthAI.cpp @@ -327,7 +327,7 @@ bool CameraDepthAI::init(const std::string & calibrationFolder, const std::strin monoRight->out.link(stereo->right); // Using VideoEncoder on PoE devices, Subpixel is not supported - if(ProtocolToStr(deviceToUse.protocol) == "X_LINK_TCP_IP") + if(deviceToUse.protocol == X_LINK_TCP_IP) { auto leftEnc = p.create(); auto depthOrRightEnc = p.create(); @@ -560,7 +560,7 @@ SensorData CameraDepthAI::captureImage(CameraInfo * info) rectifRightOrDepth = rightOrDepthQueue_->get(); double stamp = std::chrono::duration(rectifL->getTimestampDevice(dai::CameraExposureOffset::MIDDLE).time_since_epoch()).count(); - if(ProtocolToStr(device_->getDeviceInfo().protocol) == "X_LINK_TCP_IP") + if(device_->getDeviceInfo().protocol == X_LINK_TCP_IP) { left = cv::imdecode(rectifL->getData(), cv::IMREAD_GRAYSCALE); depthOrRight = cv::imdecode(rectifRightOrDepth->getData(), cv::IMREAD_GRAYSCALE); @@ -703,30 +703,4 @@ SensorData CameraDepthAI::captureImage(CameraInfo * info) return data; } -#ifdef RTABMAP_DEPTHAI -std::string CameraDepthAI::ProtocolToStr(XLinkProtocol_t val) -{ - switch (val) - { - case X_LINK_USB_VSC: - return "X_LINK_USB_VSC"; - case X_LINK_USB_CDC: - return "X_LINK_USB_CDC"; - case X_LINK_PCIE: - return "X_LINK_PCIE"; - case X_LINK_IPC: - return "X_LINK_IPC"; - case X_LINK_TCP_IP: - return "X_LINK_TCP_IP"; - case X_LINK_NMB_OF_PROTOCOLS: - return "X_LINK_NMB_OF_PROTOCOLS"; - case X_LINK_ANY_PROTOCOL: - return "X_LINK_ANY_PROTOCOL"; - default: - return "INVALID_ENUM_VALUE"; - break; - } -} -#endif - } // namespace rtabmap