/*
* Copyright (C) 2010-2011, Mathieu Labbe and IntRoLab - Universite de Sherbrooke
*
* This file is part of RTAB-Map.
*
* RTAB-Map is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* RTAB-Map is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with RTAB-Map. If not, see .
*/
#include "rtabmap/core/Rtabmap.h"
#include "rtabmap/core/Camera.h"
#include
#include
void showUsage()
{
printf("\nUsage:\n"
"rtabmap-bow_mapping [options] \"path\"\n"
" path Path to a directory of images\n "
" Options:"
" -l localization mode: use already built RTAB-Map database to localize\n ");
exit(1);
}
int main(int argc, char * argv[])
{
//ULogger::setType(ULogger::kTypeConsole);
//ULogger::setLevel(ULogger::kDebug);
std::string path;
bool localizationMode = false;
if(argc < 2)
{
showUsage();
}
for(int i=1; i%d*\n",
i,
rtabmap.getLastProcessTime(),
(int)rtabmap.getSTM().size(), // short-term memory
(int)rtabmap.getWM().size(), // working memory
rtabmap.getLoopClosureId(),
rtabmap.getLcHypValue(),
nextIndex,
rtabmap.getLoopClosureId());
}
else
{
printf(" #%d ptime(%fs) STM(%d) WM(%d) hyp(%d) value(%.2f)\n",
i,
rtabmap.getLastProcessTime(),
(int)rtabmap.getSTM().size(), // short-term memory
(int)rtabmap.getWM().size(), // working memory
rtabmap.getRetrievedId(), // highest loop closure hypothesis
rtabmap.getLcHypValue());
}
++nextIndex;
//Get next image
img = camera.takeImage();
}
printf("Processing images completed. Loop closures found = %d\n", countLoopDetected);
// Generate a graph for visualization with Graphiz
rtabmap.generateDOTGraph("Graph.dot");
printf("Generated graph \"Graph.dot\", viewable with Graphiz using \"neato -Tpdf Graph.dot -o out.pdf\"\n");
// Cleanup... save database and logs
printf("Saving Long-Term Memory to \"rtabmap.db\"...\n");
rtabmap.close();
return 0;
}