38 #include <QtCore/QMetaType> 39 #include <QMessageBox> 40 #include <QtGui/QCloseEvent> 42 #include <QVBoxLayout> 51 label_(new QLabel(this)),
52 processingImages_(
false),
56 qRegisterMetaType<cv::Mat>(
"cv::Mat");
60 QVBoxLayout * layout =
new QVBoxLayout(
this);
64 layout->setStretch(0,1);
65 this->setLayout(layout);
73 customParameters.insert(
ParametersPair(Parameters::kMemRehearsalSimilarity(),
"1.0"));
74 customParameters.insert(
ParametersPair(Parameters::kKpMaxFeatures(),
"-1"));
75 customParameters.insert(
ParametersPair(Parameters::kMemBinDataKept(),
"true"));
76 customParameters.insert(
ParametersPair(Parameters::kMemMapLabelsAdded(),
"false"));
77 customParameters.insert(
ParametersPair(Parameters::kMemBadSignaturesIgnored(),
"true"));
78 customParameters.insert(
ParametersPair(Parameters::kMemIntermediateNodeDataKept(),
"true"));
81 customParameters.insert(
ParametersPair(Parameters::kDbSqlite3InMemory(),
"false"));
84 if(!
memory_->
init(path.toStdString(),
true, customParameters))
88 UERROR(
"Error initializing the memory.");
96 UERROR(
"Already initialized, close it first.");
108 UINFO(
"Data recorded to \"%s\".", this->
path().toStdString().c_str());
114 if(this->isVisible())
116 QMessageBox::information(
this, tr(
"Data recorder"), tr(
"Data recorded to \"%1\".").arg(this->
path()));
134 customParameters.insert(
ParametersPair(Parameters::kMemGenerateIds(),
"false"));
191 QMetaObject::invokeMethod(
this,
"showImage",
bool handleEvent(UEvent *event)
DataRecorder(QWidget *parent=0)
const cv::Mat & data() const
const LaserScan & laserScanCompressed() const
void showImage(const cv::Mat &image, const cv::Mat &depth)
virtual void closeEvent(QCloseEvent *event)
std::pair< std::string, std::string > ParametersPair
void addData(const rtabmap::SensorData &data, const Transform &pose=Transform(), const cv::Mat &infMatrix=cv::Mat::eye(6, 6, CV_64FC1))
std::map< std::string, std::string > ParametersMap
const QString & path() const
void setImage(const QImage &image)
const cv::Mat & imageRaw() const
const std::set< int > & getStMem() const
bool init(const std::string &dbUrl, bool dbOverwritten=false, const ParametersMap ¶meters=ParametersMap(), bool postInitClosingEvents=false)
const cv::Mat & depthOrRightCompressed() const
QImage uCvMat2QImage(const cv::Mat &image, bool isBgr=true, uCvQtDepthColorMap colorMap=uCvQtDepthWhiteToBlack)
virtual std::string getClassName() const =0
void setImageDepth(const cv::Mat &imageDepth)
bool update(const SensorData &data, Statistics *stats=0)
const cv::Mat & depthOrRightRaw() const
virtual void parseParameters(const ParametersMap ¶meters)
SensorData & sensorData()
const CameraInfo & info() const
const Signature * getLastWorkingSignature() const
ULogger class and convenient macros.
const cv::Mat & imageCompressed() const
bool init(const QString &path, bool recordInRAM=true)
const SensorData & data() const
void unregisterFromEventsManager()
void setImageDepthShown(bool shown)