37 #include <QApplication> 45 "dataRecorder [options] output.db\n" 47 " -hide Don't display the current cloud recorded.\n" 48 " -debug Set debug level for the logger.\n" 49 " -rate #.# Input rate Hz (default 0=inf)\n" 50 " -driver Driver number to use:\n" 51 " 0=OpenNI-PCL (Kinect)\n" 52 " 1=OpenNI2 (Kinect and Xtion PRO Live)\n" 53 " 2=Freenect (Kinect)\n" 54 " 3=OpenNI-CV (Kinect)\n" 55 " 4=OpenNI-CV-ASUS (Xtion PRO Live)\n" 56 " 5=Freenect2 (Kinect v2)\n" 57 " 6=DC1394 (Bumblebee2)\n" 58 " 7=FlyCapture2 (Bumblebee2)\n" 61 " 10=Kinect for Windows 2 SDK\n" 63 " 12=Kinect for Azure SDK\n" 65 " -device "" Device ID (default \"\")\n");
70 QApplication *
app = 0;
74 printf(
"\nSignal %d caught...\n", sig);
81 QMetaObject::invokeMethod(
app,
"quit");
101 for(
int i=1; i<argc-1; ++i)
103 if(strcmp(argv[i],
"-rate") == 0)
120 if(strcmp(argv[i],
"-debug") == 0)
125 if(strcmp(argv[i],
"-hide") == 0)
130 if(strcmp(argv[i],
"-driver") == 0)
135 driver = std::atoi(argv[i]);
136 if(driver < 0 || driver > 13)
147 if(strcmp(argv[i],
"-device") == 0)
161 printf(
"Unrecognized option : %s\n", argv[i]);
164 fileName = argv[argc-1];
168 printf(
"Database names must end with .db extension\n");
172 UINFO(
"Output = %s", fileName.toStdString().c_str());
173 UINFO(
"Show = %s", show?
"true":
"false");
174 UINFO(
"Rate =%f Hz", rate);
176 app =
new QApplication(argc, argv);
193 UERROR(
"Not built with OpenNI2 support...");
202 UERROR(
"Not built with Freenect support...");
211 UERROR(
"Not built with OpenNI from OpenCV support...");
220 UERROR(
"Not built with OpenNI from OpenCV support...");
229 UERROR(
"Not built with Freenect2 support...");
238 UERROR(
"Not built with dc1394 support...");
247 UERROR(
"Not built with FlyCapture2/Triclops support...");
256 UERROR(
"Not built with ZED sdk support...");
261 else if (driver == 9)
265 UERROR(
"Not built with RealSense support...");
270 else if (driver == 10)
274 UERROR(
"Not built with Kinect for Windows 2 SDK support...");
279 else if (driver == 11)
283 UERROR(
"Not built with RealSense2 SDK support...");
288 else if (driver == 12)
292 UERROR(
"Not built with Kinect for Azure SDK support...");
297 else if (driver == 13)
301 UERROR(
"Not built with Mynt Eye S support...");
308 UFATAL(
"Camera driver (%d) not found!", driver);
315 if(recorder.
init(fileName))
320 recorder.setWindowTitle(
"Data recorder");
321 recorder.setMinimumWidth(500);
322 recorder.setMinimumHeight(300);
323 recorder.showNormal();
324 app->processEvents();
339 UERROR(
"Cannot initialize the camera!");
344 UERROR(
"Cannot initialize the recorder! Maybe the path is wrong: \"%s\"", fileName.toStdString().c_str());
int UTILITE_EXP uStr2Int(const std::string &str)
rtabmap::CameraThread * cam
float UTILITE_EXP uStr2Float(const std::string &str)
Some conversion functions.
int main(int argc, char *argv[])
std::string getExtension()
static void setLevel(ULogger::Level level)
virtual bool init(const std::string &calibrationFolder=".", const std::string &cameraName="")=0
static void setType(Type type, const std::string &fileName=kDefaultLogFileName, bool append=true)
void registerToEventsManager()
ULogger class and convenient macros.
bool init(const QString &path, bool recordInRAM=true)
void join(bool killFirst=false)
void enableIMUFiltering(int filteringStrategy=1, const ParametersMap ¶meters=ParametersMap())