30 #include <opencv2/core/core.hpp> 37 "rtabmap-bow_mapping [options] \"path\"\n" 38 " path Path to a directory of images\n " 40 " -l localization mode: use already built RTAB-Map database to localize\n ");
50 bool localizationMode =
false;
57 for(
int i=1; i<argc-1; ++i)
59 if(strcmp(argv[i],
"-l") == 0)
61 localizationMode =
true;
65 printf(
"Unrecognized option \"%s\"\n", argv[i]);
76 printf(
"Camera init failed, using path \"%s\"\n", path.c_str());
114 rtabmap.
init(parameters, databasePath);
117 printf(
"\nProcessing images... from directory \"%s\"\n", path.c_str());
119 int countLoopDetected=0;
136 printf(
" #%d ptime(%fs) STM(%d) WM(%d) hyp(%d) value(%.2f) *LOOP %d->%d*\n",
139 (int)rtabmap.
getSTM().size(),
140 (int)rtabmap.
getWM().size(),
148 printf(
" #%d ptime(%fs) STM(%d) WM(%d) hyp(%d) value(%.2f)\n",
151 (int)rtabmap.
getSTM().size(),
152 (int)rtabmap.
getWM().size(),
163 printf(
"Processing images completed. Loop closures found = %d\n", countLoopDetected);
167 printf(
"Generated graph \"Graph.dot\", viewable with Graphiz using \"neato -Tpdf Graph.dot -o out.pdf\"\n");
170 printf(
"Saving Long-Term Memory to \"rtabmap.db\"...\n");
double getLastProcessTime() const
int main(int argc, char *argv[])
std::set< int > getSTM() const
std::list< int > getWM() const
std::pair< std::string, std::string > ParametersPair
void generateDOTGraph(const std::string &path, int id=0, int margin=5)
static int erase(const std::string &filePath)
std::map< std::string, std::string > ParametersMap
void init(const ParametersMap ¶meters, const std::string &databasePath="", bool loadDatabaseParameters=false)
const cv::Mat & imageRaw() const
float getLoopClosureValue() const
int getHighestHypothesisId() const
SensorData takeImage(CameraInfo *info=0)
void close(bool databaseSaved=true, const std::string &ouputDatabasePath="")
int getLastLocationId() const
int getLoopClosureId() const
bool process(const SensorData &data, Transform odomPose, const cv::Mat &odomCovariance=cv::Mat::eye(6, 6, CV_64FC1), const std::vector< float > &odomVelocity=std::vector< float >(), const std::map< std::string, float > &externalStats=std::map< std::string, float >())
Main loop of rtabmap.
virtual bool init(const std::string &calibrationFolder=".", const std::string &cameraName="")
static std::string getDefaultDatabaseName()
void setTimeThreshold(float maxTimeAllowed)
static std::string createDefaultWorkingDirectory()