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 " --device # Device id\n" 52 " --debug Debug log\n" 53 " --stereo Stereo: assuming device provides \n" 54 " side-by-side stereo images, otherwise \n" 55 " add also \"--device_r #\" for the right device.\n\n");
70 for(
int i=1; i<argc; ++i)
72 if(strcmp(argv[i],
"--driver") == 0)
77 driver = std::atoi(argv[i]);
89 if(strcmp(argv[i],
"--device") == 0)
94 device = std::atoi(argv[i]);
106 if(strcmp(argv[i],
"--device_r") == 0)
111 deviceRight = std::atoi(argv[i]);
123 if(strcmp(argv[i],
"--debug") == 0)
130 if(strcmp(argv[i],
"--stereo") == 0)
135 if(strcmp(argv[i],
"--help") == 0)
139 printf(
"Unrecognized option : %s\n", argv[i]);
142 if(driver < -1 || driver > 7)
144 UERROR(
"driver should be between -1 and 7.");
148 UINFO(
"Using driver %d", driver);
149 UINFO(
"Using device %d", device);
150 UINFO(
"Stereo: %s", stereo?
"true":
"false");
151 if(stereo && deviceRight >= 0)
153 UINFO(
"Using right device %d", deviceRight);
156 QApplication
app(argc, argv);
189 UERROR(
"Not built with OpenNI2 support...");
198 UERROR(
"Not built with Freenect support...");
207 UERROR(
"Not built with OpenNI from OpenCV support...");
216 UERROR(
"Not built with OpenNI from OpenCV support...");
225 UERROR(
"Not built with Freenect2 support...");
236 UERROR(
"Not built with DC1394 support...");
246 UERROR(
"Not built with FlyCapture2/Triclops support...");
261 if(!camera->
init(
""))
263 printf(
"Camera init failed!\n");
273 cameraThread->
start();
275 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)