mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-02 09:30:25 +08:00
💄
This commit is contained in:
@@ -519,21 +519,24 @@ bool CameraOpenNI2::init(const std::string & calibrationFolder)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(UFile::getExtension(_deviceId).compare("oni")!=0 &&
|
if(UFile::getExtension(_deviceId).compare("oni")==0)
|
||||||
!_device->isImageRegistrationModeSupported(openni::IMAGE_REGISTRATION_DEPTH_TO_COLOR))
|
{
|
||||||
|
if(_device->getPlaybackControl() &&
|
||||||
|
_device->getPlaybackControl()->setRepeatEnabled(false) != openni::STATUS_OK)
|
||||||
|
{
|
||||||
|
UERROR("CameraOpenNI2: Cannot set repeat mode to false.");
|
||||||
|
_device->close();
|
||||||
|
openni::OpenNI::shutdown();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(!_device->isImageRegistrationModeSupported(openni::IMAGE_REGISTRATION_DEPTH_TO_COLOR))
|
||||||
{
|
{
|
||||||
UERROR("CameraOpenNI2: Device doesn't support depth/color registration.");
|
UERROR("CameraOpenNI2: Device doesn't support depth/color registration.");
|
||||||
_device->close();
|
_device->close();
|
||||||
openni::OpenNI::shutdown();
|
openni::OpenNI::shutdown();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else if(_device->getPlaybackControl() && _device->getPlaybackControl()->setRepeatEnabled(false) != openni::STATUS_OK)
|
|
||||||
{
|
|
||||||
UERROR("CameraOpenNI2: Cannot set repeat mode to false.");
|
|
||||||
_device->close();
|
|
||||||
openni::OpenNI::shutdown();
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(_device->getSensorInfo(openni::SENSOR_DEPTH) == NULL ||
|
if(_device->getSensorInfo(openni::SENSOR_DEPTH) == NULL ||
|
||||||
_device->getSensorInfo(openni::SENSOR_COLOR) == NULL)
|
_device->getSensorInfo(openni::SENSOR_COLOR) == NULL)
|
||||||
|
|||||||
Reference in New Issue
Block a user