Go to the documentation of this file.
42 void CHMTSLAM::generateLogFiles(
unsigned int nIteration)
56 std::lock_guard<std::mutex> lock(m_LMHs_cs);
62 string filLocalAreas =
format(
63 "%s/LSLAM_3D/mostLikelyLMH_LSLAM_%05u.3Dscene",
64 m_options.LOG_OUTPUT_DIR.c_str(), nIteration);
66 mrpt::make_aligned_shared<COpenGLScene>();
69 for (
auto& m : m_LMHs)
75 else if (m.second.m_log_w > bestLMH->
m_log_w)
82 bestHypoID = bestLMH->
m_ID;
85 std::lock_guard<std::mutex> lockerLMH(
91 mrpt::make_aligned_shared<opengl::CSetOfObjects>();
92 maps3D->setName(
"metric-maps");
94 ->d->metricMaps.getAs3DObject(maps3D);
95 sceneLSLAM->insert(maps3D);
99 mrpt::make_aligned_shared<opengl::CSetOfObjects>();
100 LSLAM_3D->setName(
"LSLAM_3D");
102 sceneLSLAM->insert(LSLAM_3D);
104 sceneLSLAM->enableFollowCamera(
true);
115 string filSSO =
format(
"%s/ASSO/mostLikelyLMH_ASSO_%05u.3Dscene", m_options.LOG_OUTPUT_DIR.c_str(), nIteration );
129 A.saveToTextFile(
format(
"%s/ASSO/mostLikelyLMH_ASSO_%05u.txt", m_options.LOG_OUTPUT_DIR.c_str(), nIteration ) );
130 CImage(A,
true).
saveToFile(
format(
"%s/ASSO/mostLikelyLMH_ASSO_%05u.png", m_options.LOG_OUTPUT_DIR.c_str(), nIteration ) );
145 if ((CNT++ % 20) == 0)
149 "%s/HMTSLAM_state/state_%05u.hmtslam",
150 m_options.LOG_OUTPUT_DIR.c_str(), nIteration));
162 if ((CNT++ % 5) == 0)
164 std::lock_guard<std::mutex> lockerLMH(bestLMH->
threadLocks.m_lock);
173 std::lock_guard<std::mutex> lock(m_map_cs);
175 "[LOG] HMT-map: " << m_map.nodeCount() <<
" nodes/ "
176 << m_map.arcCount() <<
" arcs");
180 m_map.getFirstNode()->getID(),
188 "%s/HMAP_3D/mostLikelyHMT_MAP_%05u.3Dscene",
189 m_options.LOG_OUTPUT_DIR.c_str(), nIteration));
201 format(
"%s/log_MemoryUsage.txt", m_options.LOG_OUTPUT_DIR.c_str())
206 os::fprintf(f,
"%u\t%f\n", nIteration, memUsage / (1024.0 * 1024.0));
210 double t_log = tictac.Tac();
unsigned long getMemoryUsage()
Returns the memory occupied by this process, in bytes.
This class is used in HMT-SLAM to represent each of the Local Metric Hypotheses (LMHs).
const CParticleData * getMostLikelyParticle() const
Returns the particle with the highest weight.
THypothesisID m_ID
The unique ID of the hypothesis (Used for accessing mrpt::slam::CHierarchicalMHMap).
const Scalar * const_iterator
int void fclose(FILE *f)
An OS-independent version of fclose.
void getAs3DScene(mrpt::opengl::CSetOfObjects::Ptr &objs, const std::map< uint32_t, int64_t > *renameIndexes=NULL) const
Return a 3D representation of the graph: poses & links between them.
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...
void insert(const CRenderizable::Ptr &newObject, const std::string &viewportName=std::string("main"))
Insert a new object into the scene, in the given viewport (by default, into the "main" viewport).
A high-performance stopwatch, with typical resolution of nanoseconds.
This class allows the user to create, load, save, and render 3D scenes using OpenGL primitives.
mrpt::slam::CIncrementalMapPartitioner partitioner
#define ASSERT_(f)
Defines an assertion mechanism.
Classes for 2D/3D geometry representation, both of single values and probability density distribution...
mrpt::io::CFileGZOutputStream CFileGZOutputStream
struct mrpt::hmtslam::CLocalMetricHypothesis::TRobotPosesPartitioning m_robotPosesGraph
Classes related to the implementation of Hybrid Metric Topological (HMT) SLAM.
std::map< uint32_t, TPoseID > idx2pose
For the poses in "partitioner".
std::string format(const char *fmt,...) MRPT_printf_format_check(1
A std::string version of C sprintf.
Saves data to a file and transparently compress the data using the given compression level.
TNodeIDSet m_neighbors
The list of all areas sourronding the current one (this includes the current area itself).
void Tic() noexcept
Starts the stopwatch.
std::mutex lock
CS to access the entire struct.
std::shared_ptr< CSetOfObjects > Ptr
std::string formatTimeInterval(const double timeSeconds)
Returns a formated string with the given time difference (passed as the number of seconds),...
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).
double m_log_w
Log-weight of this hypothesis.
int fprintf(FILE *fil, const char *format,...) noexcept MRPT_printf_format_check(2
An OS-independent version of fprintf.
CArchiveStreamBase< STREAM > archiveFrom(STREAM &s)
Helper function to create a templatized wrapper CArchive object for a: MRPT's CStream,...
int64_t THypothesisID
An integer number uniquely identifying each of the concurrent hypotheses for the robot topological pa...
FILE * fopen(const char *fileName, const char *mode) noexcept
An OS-independent version of fopen.
#define MRPT_LOG_INFO_STREAM(__CONTENTS)
std::shared_ptr< COpenGLScene > Ptr
void getAs3DScene(mrpt::opengl::CSetOfObjects::Ptr &objs) const
Returns a 3D representation of the the current robot pose, all the poses in the auxiliary graph,...
The namespace for 3D scene representation and rendering.
void getAdjacencyMatrix(MATRIX &outMatrix) const
Return a copy of the adjacency matrix.
This namespace provides a OS-independent interface to many useful functions: filenames manipulation,...
Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST | |