remove unnecessary conversion function

This commit is contained in:
Borong Yuan
2023-07-17 17:00:43 +08:00
parent 7d2272beb3
commit 0b4f5d2925
2 changed files with 2 additions and 30 deletions

View File

@@ -104,8 +104,6 @@ private:
std::map<double, cv::Vec3f> accBuffer_;
std::map<double, cv::Vec3f> gyroBuffer_;
UMutex imuMutex_;
static std::string ProtocolToStr(XLinkProtocol_t val);
#endif
};

View File

@@ -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<dai::node::VideoEncoder>();
auto depthOrRightEnc = p.create<dai::node::VideoEncoder>();
@@ -560,7 +560,7 @@ SensorData CameraDepthAI::captureImage(CameraInfo * info)
rectifRightOrDepth = rightOrDepthQueue_->get<dai::ImgFrame>();
double stamp = std::chrono::duration<double>(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