MainWindow->start detection: fixed error msg on CameraOpenNI2::setExposure when exposure/gain parameters are not available

git-svn-id: http://rtabmap.googlecode.com/svn/trunk/rtabmap@2070 f169173b-cf89-36c8-b27e-44dbe73f0c83
This commit is contained in:
matlabbe
2014-11-21 21:36:00 +00:00
parent 5a3b6a6517
commit 08d0bc4ad5

View File

@@ -2242,8 +2242,11 @@ void MainWindow::startDetection()
{ {
((CameraOpenNI2*)camera)->setAutoWhiteBalance(_preferencesDialog->getSourceOpenni2AutoWhiteBalance()); ((CameraOpenNI2*)camera)->setAutoWhiteBalance(_preferencesDialog->getSourceOpenni2AutoWhiteBalance());
((CameraOpenNI2*)camera)->setAutoExposure(_preferencesDialog->getSourceOpenni2AutoExposure()); ((CameraOpenNI2*)camera)->setAutoExposure(_preferencesDialog->getSourceOpenni2AutoExposure());
((CameraOpenNI2*)camera)->setExposure(_preferencesDialog->getSourceOpenni2Exposure()); if(CameraOpenNI2::exposureGainAvailable())
((CameraOpenNI2*)camera)->setGain(_preferencesDialog->getSourceOpenni2Gain()); {
((CameraOpenNI2*)camera)->setExposure(_preferencesDialog->getSourceOpenni2Exposure());
((CameraOpenNI2*)camera)->setGain(_preferencesDialog->getSourceOpenni2Gain());
}
} }
_camera = new CameraThread(camera); _camera = new CameraThread(camera);