mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-02 01:20:25 +08:00
fixed a crash after OpenNI2 initialization failure
This commit is contained in:
@@ -3558,17 +3558,19 @@ Camera * PreferencesDialog::createCamera(bool useRawImages)
|
|||||||
delete camera;
|
delete camera;
|
||||||
camera = 0;
|
camera = 0;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
//should be after initialization
|
|
||||||
if(driver == kSrcOpenNI2)
|
|
||||||
{
|
{
|
||||||
((CameraOpenNI2*)camera)->setAutoWhiteBalance(this->getSourceOpenni2AutoWhiteBalance());
|
//should be after initialization
|
||||||
((CameraOpenNI2*)camera)->setAutoExposure(this->getSourceOpenni2AutoExposure());
|
if(driver == kSrcOpenNI2)
|
||||||
((CameraOpenNI2*)camera)->setMirroring(this->getSourceOpenni2Mirroring());
|
|
||||||
if(CameraOpenNI2::exposureGainAvailable())
|
|
||||||
{
|
{
|
||||||
((CameraOpenNI2*)camera)->setExposure(this->getSourceOpenni2Exposure());
|
((CameraOpenNI2*)camera)->setAutoWhiteBalance(this->getSourceOpenni2AutoWhiteBalance());
|
||||||
((CameraOpenNI2*)camera)->setGain(this->getSourceOpenni2Gain());
|
((CameraOpenNI2*)camera)->setAutoExposure(this->getSourceOpenni2AutoExposure());
|
||||||
|
((CameraOpenNI2*)camera)->setMirroring(this->getSourceOpenni2Mirroring());
|
||||||
|
if(CameraOpenNI2::exposureGainAvailable())
|
||||||
|
{
|
||||||
|
((CameraOpenNI2*)camera)->setExposure(this->getSourceOpenni2Exposure());
|
||||||
|
((CameraOpenNI2*)camera)->setGain(this->getSourceOpenni2Gain());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user