rgbd_camera: fixed crash on Windows when using Openni2 driver

This commit is contained in:
Mathieu Labbé
2015-04-02 23:05:31 -04:00
parent 51131e9feb
commit 2e644c4b05
2 changed files with 6 additions and 6 deletions
+1 -1
View File
@@ -134,7 +134,7 @@ IF("${VTK_MAJOR_VERSION}" EQUAL 5)
ENDIF("${VTK_MAJOR_VERSION}" EQUAL 5) ENDIF("${VTK_MAJOR_VERSION}" EQUAL 5)
FIND_PACKAGE(ZLIB REQUIRED) FIND_PACKAGE(ZLIB REQUIRED)
FIND_PACKAGE(Freenect) FIND_PACKAGE(Freenect)
FIND_PACKAGE(freenect2) FIND_PACKAGE(freenect2 QUIET)
FIND_PACKAGE(OpenNI2) FIND_PACKAGE(OpenNI2)
FIND_PACKAGE(G2O) FIND_PACKAGE(G2O)
+5 -5
View File
@@ -69,7 +69,7 @@ int main(int argc, char * argv[])
rtabmap::CameraRGBD * camera = 0; rtabmap::CameraRGBD * camera = 0;
if(driver == 0) if(driver == 0)
{ {
camera = new rtabmap::CameraOpenni("", 0); camera = new rtabmap::CameraOpenni();
} }
else if(driver == 1) else if(driver == 1)
{ {
@@ -78,7 +78,7 @@ int main(int argc, char * argv[])
UERROR("Not built with OpenNI2 support..."); UERROR("Not built with OpenNI2 support...");
exit(-1); exit(-1);
} }
camera = new rtabmap::CameraOpenNI2(0); camera = new rtabmap::CameraOpenNI2();
} }
else if(driver == 2) else if(driver == 2)
{ {
@@ -87,7 +87,7 @@ int main(int argc, char * argv[])
UERROR("Not built with Freenect support..."); UERROR("Not built with Freenect support...");
exit(-1); exit(-1);
} }
camera = new rtabmap::CameraFreenect(0, 0); camera = new rtabmap::CameraFreenect();
} }
else if(driver == 3) else if(driver == 3)
{ {
@@ -96,7 +96,7 @@ int main(int argc, char * argv[])
UERROR("Not built with OpenNI from OpenCV support..."); UERROR("Not built with OpenNI from OpenCV support...");
exit(-1); exit(-1);
} }
camera = new rtabmap::CameraOpenNICV(false, 0); camera = new rtabmap::CameraOpenNICV(false);
} }
else if(driver == 4) else if(driver == 4)
{ {
@@ -105,7 +105,7 @@ int main(int argc, char * argv[])
UERROR("Not built with OpenNI from OpenCV support..."); UERROR("Not built with OpenNI from OpenCV support...");
exit(-1); exit(-1);
} }
camera = new rtabmap::CameraOpenNICV(true, 0); camera = new rtabmap::CameraOpenNICV(true);
} }
else if(driver == 5) else if(driver == 5)
{ {