mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-02 09:30:25 +08:00
Add options to enable IR featues on OAK Pro models
This commit is contained in:
@@ -58,6 +58,8 @@ public:
|
||||
void setOutputDepth(bool enabled, int confidence = 200);
|
||||
void setIMUFirmwareUpdate(bool enabled);
|
||||
void setIMUPublished(bool published);
|
||||
void setLaserDotBrightness(float dotProjectormA = 0.0f);
|
||||
void setFloodLightBrightness(float floodLightmA = 200.0f);
|
||||
|
||||
virtual bool init(const std::string & calibrationFolder = ".", const std::string & cameraName = "");
|
||||
virtual bool isCalibrated() const;
|
||||
@@ -76,6 +78,8 @@ private:
|
||||
int resolution_;
|
||||
bool imuFirmwareUpdate_;
|
||||
bool imuPublished_;
|
||||
float dotProjectormA_;
|
||||
float floodLightmA_;
|
||||
std::shared_ptr<dai::Device> device_;
|
||||
std::shared_ptr<dai::DataOutputQueue> leftQueue_;
|
||||
std::shared_ptr<dai::DataOutputQueue> rightOrDepthQueue_;
|
||||
|
||||
@@ -106,6 +106,24 @@ void CameraDepthAI::setIMUPublished(bool published)
|
||||
#endif
|
||||
}
|
||||
|
||||
void CameraDepthAI::setLaserDotBrightness(float dotProjectormA)
|
||||
{
|
||||
#ifdef RTABMAP_DEPTHAI
|
||||
dotProjectormA_ = dotProjectormA;
|
||||
#else
|
||||
UERROR("CameraDepthAI: RTAB-Map is not built with depthai-core support!");
|
||||
#endif
|
||||
}
|
||||
|
||||
void CameraDepthAI::setFloodLightBrightness(float floodLightmA)
|
||||
{
|
||||
#ifdef RTABMAP_DEPTHAI
|
||||
floodLightmA_ = floodLightmA;
|
||||
#else
|
||||
UERROR("CameraDepthAI: RTAB-Map is not built with depthai-core support!");
|
||||
#endif
|
||||
}
|
||||
|
||||
bool CameraDepthAI::init(const std::string & calibrationFolder, const std::string & cameraName)
|
||||
{
|
||||
UDEBUG("");
|
||||
@@ -268,6 +286,13 @@ bool CameraDepthAI::init(const std::string & calibrationFolder, const std::strin
|
||||
leftQueue_ = device_->getOutputQueue("rectified_left", 1, false);
|
||||
rightOrDepthQueue_ = device_->getOutputQueue(outputDepth_?"depth":"rectified_right", 1, false);
|
||||
|
||||
std::vector<std::tuple<std::string, int, int>> irDrivers = device_->getIrDrivers();
|
||||
if(!irDrivers.empty())
|
||||
{
|
||||
device_->setIrLaserDotProjectorBrightness(dotProjectormA_);
|
||||
device_->setIrFloodLightBrightness(floodLightmA_);
|
||||
}
|
||||
|
||||
uSleep(2000); // avoid bad frames on start
|
||||
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user