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" 59 " -device "" Device ID (default \"\")\n");
64 QApplication *
app = 0;
68 printf(
"\nSignal %d caught...\n", sig);
75 QMetaObject::invokeMethod(
app,
"quit");
79 int main (
int argc,
char * argv[])
95 for(
int i=1; i<argc-1; ++i)
97 if(strcmp(argv[i],
"-rate") == 0)
114 if(strcmp(argv[i],
"-debug") == 0)
119 if(strcmp(argv[i],
"-hide") == 0)
124 if(strcmp(argv[i],
"-driver") == 0)
129 driver = std::atoi(argv[i]);
130 if(driver < 0 || driver > 7)
141 if(strcmp(argv[i],
"-device") == 0)
155 printf(
"Unrecognized option : %s\n", argv[i]);
158 fileName = argv[argc-1];
162 printf(
"Database names must end with .db extension\n");
166 UINFO(
"Output = %s", fileName.toStdString().c_str());
167 UINFO(
"Show = %s", show?
"true":
"false");
168 UINFO(
"Rate =%f Hz", rate);
170 app =
new QApplication(argc, argv);
179 rtabmap::Transform t=
rtabmap::Transform(0,0,1,0, -1,0,0,0, 0,-1,0,0);
188 UERROR(
"Not built with OpenNI2 support...");
197 UERROR(
"Not built with Freenect support...");
206 UERROR(
"Not built with OpenNI from OpenCV support...");
215 UERROR(
"Not built with OpenNI from OpenCV support...");
224 UERROR(
"Not built with Freenect2 support...");
233 UERROR(
"Not built with dc1394 support...");
242 UERROR(
"Not built with FlyCapture2/Triclops support...");
249 UFATAL(
"Camera driver (%d) not found!", driver);
255 if(recorder.
init(fileName))
260 recorder.setWindowTitle(
"Data recorder");
261 recorder.setMinimumWidth(500);
262 recorder.setMinimumHeight(300);
263 recorder.showNormal();
264 app->processEvents();
279 UERROR(
"Cannot initialize the camera!");
284 UERROR(
"Cannot initialize the recorder! Maybe the path is wrong: \"%s\"", fileName.toStdString().c_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)