39 void CHMTSLAM::generateLogFiles(
unsigned int nIteration)
59 string filLocalAreas =
format(
"%s/LSLAM_3D/mostLikelyLMH_LSLAM_%05u.3Dscene", m_options.LOG_OUTPUT_DIR.c_str(), nIteration );
60 COpenGLScenePtr sceneLSLAM = COpenGLScene::Create();
64 for ( it = m_LMHs.begin();it!=m_LMHs.end();it++)
68 bestLMH = & it->second;
70 else if ( it->second.m_log_w > bestLMH->
m_log_w)
72 bestLMH = & it->second;
77 bestHypoID = bestLMH->
m_ID;
85 maps3D->setName(
"metric-maps");
87 sceneLSLAM->insert( maps3D );
91 LSLAM_3D->setName(
"LSLAM_3D");
93 sceneLSLAM->insert( LSLAM_3D );
95 sceneLSLAM->enableFollowCamera(
true);
106 string filSSO =
format(
"%s/ASSO/mostLikelyLMH_ASSO_%05u.3Dscene", m_options.LOG_OUTPUT_DIR.c_str(), nIteration );
110 sceneSSO.insert(sso3D);
117 if (A.getColCount()>0)
120 A.saveToTextFile(
format(
"%s/ASSO/mostLikelyLMH_ASSO_%05u.txt", m_options.LOG_OUTPUT_DIR.c_str(), nIteration ) );
121 CImage(A,
true).
saveToFile(
format(
"%s/ASSO/mostLikelyLMH_ASSO_%05u.png", m_options.LOG_OUTPUT_DIR.c_str(), nIteration ) );
137 if ((CNT++ % 20) == 0)
139 string hmtmap_file(
format(
"%s/HMTSLAM_state/state_%05u.hmtslam", m_options.LOG_OUTPUT_DIR.c_str(), nIteration ) );
151 if ((CNT++ % 5) == 0)
162 MRPT_LOG_INFO_STREAM(
"[LOG] HMT-map: "<< m_map.nodeCount() <<
" nodes/ "<< m_map.arcCount() <<
" arcs");
166 m_map.getFirstNode()->getID(),
172 string hmtmap_file(
format(
"%s/HMAP_3D/mostLikelyHMT_MAP_%05u.3Dscene", m_options.LOG_OUTPUT_DIR.c_str(), nIteration ) );
183 FILE *f=
os::fopen(
format(
"%s/log_MemoryUsage.txt",m_options.LOG_OUTPUT_DIR.c_str()).c_str() ,
"at");
186 os::fprintf(f,
"%u\t%f\n",nIteration,memUsage/(1024.0*1024.0));
190 double t_log = tictac.Tac();
void getAdjacencyMatrix(MATRIX &outMatrix) const
Return a copy of the internal adjacency matrix.
FILE BASE_IMPEXP * fopen(const char *fileName, const char *mode) MRPT_NO_THROWS
An OS-independent version of fopen.
A class acquiring a CCriticalSection at its constructor, and releasing it at destructor.
Classes for serialization, sockets, ini-file manipulation, streams, list of properties-values, timewatch, extensions to STL.
THypothesisID m_ID
The unique ID of the hypothesis (Used for accessing mrpt::slam::CHierarchicalMHMap).
This namespace provides a OS-independent interface to many useful functions: filenames manipulation...
int BASE_IMPEXP void BASE_IMPEXP fclose(FILE *f)
An OS-independent version of fclose.
A class for storing images as grayscale or RGB bitmaps.
Classes related to the implementation of Hybrid Metric Topological (HMT) SLAM.
const CParticleData * getMostLikelyParticle() const
Returns the particle with the highest weight.
int BASE_IMPEXP fprintf(FILE *fil, const char *format,...) MRPT_NO_THROWS MRPT_printf_format_check(2
An OS-independent version of fprintf.
double m_log_w
Log-weight of this hypothesis.
const Scalar * const_iterator
std::string BASE_IMPEXP formatTimeInterval(const double timeSeconds)
Returns a formated string with the given time difference (passed as the number of seconds)...
void getAs3DScene(mrpt::opengl::CSetOfObjectsPtr &objs, const std::map< uint32_t, int64_t > *renameIndexes=NULL) const
Return a 3D representation of the current state: poses & links between them.
void Tic()
Starts the stopwatch.
Helper types for STL containers with Eigen memory allocators.
mrpt::slam::CIncrementalMapPartitioner partitioner
int64_t THypothesisID
An integer number uniquely identifying each of the concurrent hypotheses for the robot topological pa...
This class implements a high-performance stopwatch.
void getAs3DScene(mrpt::opengl::CSetOfObjectsPtr &objs) const
Returns a 3D representation of the the current robot pose, all the poses in the auxiliary graph...
std::string BASE_IMPEXP format(const char *fmt,...) MRPT_printf_format_check(1
A std::string version of C sprintf.
This namespace provides multitask, synchronization utilities.
This class is used in HMT-SLAM to represent each of the Local Metric Hypotheses (LMHs).
Classes for 2D/3D geometry representation, both of single values and probability density distribution...
struct mrpt::hmtslam::CLocalMetricHypothesis::TRobotPosesPartitioning m_robotPosesGraph
std::map< uint32_t, TPoseID > idx2pose
For the poses in "partitioner".
#define MRPT_LOG_INFO_STREAM(__CONTENTS)
#define CFileGZOutputStream
Saves data to a file and transparently compress the data using the given compression level...
unsigned long BASE_IMPEXP getMemoryUsage()
Returns the memory occupied by this process, in bytes.
synch::CCriticalSection m_lock
Critical section for threads signaling they are working with the LMH.
The namespace for 3D scene representation and rendering.
mrpt::utils::copy_ptr< T > d
The data associated with this particle. The use of copy_ptr<> allows relying on compiler-generated co...
This class allows the user to create, load, save, and render 3D scenes using OpenGL primitives...
bool saveToFile(const std::string &fileName, int jpeg_quality=95) const
Save the image to a file, whose format is determined from the extension (internally uses OpenCV)...
void updateAreaFromLMH(const CHMHMapNode::TNodeID areaID, bool eraseSFsFromLMH=false)
The corresponding node in the HMT map is updated with the robot poses & SFs in the LMH: the poses are ref...
synch::CCriticalSection lock
CS to access the entire struct.
TNodeIDSet m_neighbors
The list of all areas sourronding the current one (this includes the current area itself)...
static CSetOfObjectsPtr Create()