mirror of
https://github.com/introlab/rtabmap_ros.git
synced 2026-10-04 08:47:45 +08:00
Generating Graph in the c++ example
Added png of the generated graph in doc git-svn-id: http://rtabmap.googlecode.com/svn/trunk/rtabmap@707 f169173b-cf89-36c8-b27e-44dbe73f0c83
This commit is contained in:
@@ -96,6 +96,7 @@ public:
|
|||||||
double getLastProcessTime() const {return _lastProcessTime;};
|
double getLastProcessTime() const {return _lastProcessTime;};
|
||||||
|
|
||||||
void setTimeThreshold(float maxTimeAllowed); // in ms
|
void setTimeThreshold(float maxTimeAllowed); // in ms
|
||||||
|
void generateGraph(const std::string & path) const;
|
||||||
|
|
||||||
void adjustLikelihood(std::map<int, float> & likelihood) const;
|
void adjustLikelihood(std::map<int, float> & likelihood) const;
|
||||||
std::pair<int, float> selectHypothesis(const std::map<int, float> & posterior,
|
std::pair<int, float> selectHypothesis(const std::map<int, float> & posterior,
|
||||||
|
|||||||
@@ -151,9 +151,6 @@ void Rtabmap::setupLogFiles(bool overwrite)
|
|||||||
_foutFloat = fopen((_wDir+LOG_F).c_str(), attributes.c_str());
|
_foutFloat = fopen((_wDir+LOG_F).c_str(), attributes.c_str());
|
||||||
_foutInt = fopen((_wDir+LOG_I).c_str(), attributes.c_str());
|
_foutInt = fopen((_wDir+LOG_I).c_str(), attributes.c_str());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
printf("addLogFHeader=%d\n", addLogFHeader?1:0);
|
|
||||||
|
|
||||||
// add header (column identification)
|
// add header (column identification)
|
||||||
if(addLogFHeader && _foutFloat)
|
if(addLogFHeader && _foutFloat)
|
||||||
{
|
{
|
||||||
@@ -597,6 +594,14 @@ void Rtabmap::mainLoop()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Rtabmap::generateGraph(const std::string & path) const
|
||||||
|
{
|
||||||
|
if(!this->isRunning() && _memory)
|
||||||
|
{
|
||||||
|
_memory->generateGraph(path);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void Rtabmap::resetMemory(bool dbOverwritten)
|
void Rtabmap::resetMemory(bool dbOverwritten)
|
||||||
{
|
{
|
||||||
if(_memory)
|
if(_memory)
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 179 KiB |
@@ -111,6 +111,10 @@ int main(int argc, char * argv[])
|
|||||||
|
|
||||||
printf("Processing images completed. Loop closures found = %d\n", countLoopDetected);
|
printf("Processing images completed. Loop closures found = %d\n", countLoopDetected);
|
||||||
|
|
||||||
|
// Generate a graph for visualization with Graphiz
|
||||||
|
rtabmap.generateGraph("Graph.dot");
|
||||||
|
printf("Generated graph \"Graph.dot\", viewable with Graphiz using \"neato -Tpdf Graph.dot -o out.pdf\"\n");
|
||||||
|
|
||||||
// Cleanup... save database and logs
|
// Cleanup... save database and logs
|
||||||
printf("Saving Long-Term Memory to \"LTM.db\"...\n");
|
printf("Saving Long-Term Memory to \"LTM.db\"...\n");
|
||||||
rtabmap.close();
|
rtabmap.close();
|
||||||
|
|||||||
Reference in New Issue
Block a user