35 #include <QApplication> 40 "rtabmap-calibration [options]\n" 42 " --driver # Driver number to use:-1=USB camera\n" 43 " 0=OpenNI-PCL (Kinect)\n" 44 " 1=OpenNI2 (Kinect and Xtion PRO Live)\n" 45 " 2=Freenect (Kinect)\n" 46 " 3=OpenNI-CV (Kinect)\n" 47 " 4=OpenNI-CV-ASUS (Xtion PRO Live)\n" 48 " 5=Freenect2 (Kinect v2)\n" 49 " 6=DC1394 (Bumblebee2)\n" 50 " 7=FlyCapture2 (Bumblebee2)\n" 51 " 11=RealSense2 (T265)\n" 52 " --device # Device id\n" 53 " --debug Debug log\n" 54 " --stereo Stereo: assuming device provides \n" 55 " side-by-side stereo images, otherwise \n" 56 " add also \"--device_r #\" for the right device.\n\n");
71 for(
int i=1; i<argc; ++i)
73 if(strcmp(argv[i],
"--driver") == 0)
78 driver = std::atoi(argv[i]);
90 if(strcmp(argv[i],
"--device") == 0)
95 device = std::atoi(argv[i]);
107 if(strcmp(argv[i],
"--device_r") == 0)
112 deviceRight = std::atoi(argv[i]);
124 if(strcmp(argv[i],
"--debug") == 0)
131 if(strcmp(argv[i],
"--stereo") == 0)
136 if(strcmp(argv[i],
"--help") == 0)
140 printf(
"Unrecognized option : %s\n", argv[i]);
143 if(driver < -1 || driver > 15)
145 UERROR(
"driver should be between -1 and 15.");
153 UINFO(
"Using driver %d", driver);
154 UINFO(
"Using device %d", device);
155 UINFO(
"Stereo: %s", stereo?
"true":
"false");
156 if(stereo && deviceRight >= 0)
158 UINFO(
"Using right device %d", deviceRight);
161 QApplication
app(argc, argv);
194 UERROR(
"Not built with OpenNI2 support...");
203 UERROR(
"Not built with Freenect support...");
212 UERROR(
"Not built with OpenNI from OpenCV support...");
221 UERROR(
"Not built with OpenNI from OpenCV support...");
230 UERROR(
"Not built with Freenect2 support...");
241 UERROR(
"Not built with DC1394 support...");
251 UERROR(
"Not built with FlyCapture2/Triclops support...");
257 else if(driver == 11)
261 UERROR(
"Not built with RealSense2 support...");
271 UFATAL(
"Calibration for driver %d not available.", driver);
278 if(!camera->
init(
""))
280 printf(
"Camera init failed!\n");
290 cameraThread->
start();
292 cameraThread->
join(
true);
Some conversion functions.
void setSwitchedImages(bool switched)
static void setLevel(ULogger::Level level)
virtual bool init(const std::string &calibrationFolder=".", const std::string &cameraName="")=0
static void setPrintTime(bool printTime)
static void setType(Type type, const std::string &fileName=kDefaultLogFileName, bool append=true)
static void setPrintWhere(bool printWhere)
void registerToEventsManager()
void setStereoMode(bool stereo, const QString &leftSuffix="left", const QString &rightSuffix="right")
int main(int argc, char *argv[])
ULogger class and convenient macros.
void join(bool killFirst=false)
void setFisheyeImages(bool enabled)