|
RTAB-Map 0.23.10
Real-Time Appearance-Based Mapping
|
Collects and manages runtime statistics for RTAB-Map. More...
#include <Statistics.h>
Public Member Functions | |
| Statistics () | |
| Default constructor. | |
| virtual | ~Statistics () |
| Virtual destructor. | |
| void | addStatistic (const std::string &name, float value) |
| Adds a statistic value to the data map. | |
| void | setExtended (bool extended) |
| Sets whether extended statistics mode is enabled. | |
| void | setRefImageId (int id) |
| Sets the reference image ID (current/last processed signature ID) | |
| void | setRefImageMapId (int id) |
| Sets the reference image map ID. | |
| void | setLoopClosureId (int id) |
| Sets the loop closure detection ID. | |
| void | setLoopClosureMapId (int id) |
| Sets the loop closure map ID. | |
| void | setProximityDetectionId (int id) |
| Sets the proximity detection ID. | |
| void | setProximityDetectionMapId (int id) |
| Sets the proximity detection map ID. | |
| void | setStamp (double stamp) |
| Sets the timestamp for these statistics. | |
| RTABMAP_DEPRECATED void | setLastSignatureData (const Signature &data) |
| Sets the last signature data (deprecated) | |
| void | addSignatureData (const Signature &data) |
| Adds signature data to the statistics. | |
| void | setSignaturesData (const std::map< int, Signature > &data) |
| Sets all signature data at once. | |
| void | setPoses (const std::map< int, Transform > &poses) |
| Sets the pose graph (node poses) | |
| void | setConstraints (const std::multimap< int, Link > &constraints) |
| Sets the constraint graph (links between nodes) | |
| void | setMapCorrection (const Transform &mapCorrection) |
| Sets the map correction transform. | |
| void | setLoopClosureTransform (const Transform &loopClosureTransform) |
| Sets the loop closure transform. | |
| void | setLocalizationCovariance (const cv::Mat &covariance) |
| Sets the localization covariance matrix. | |
| void | setLabels (const std::map< int, std::string > &labels) |
| Sets node labels. | |
| void | setWeights (const std::map< int, int > &weights) |
| Sets node weights. | |
| void | setPosterior (const std::map< int, float > &posterior) |
| Sets posterior probabilities for loop closure hypotheses. | |
| void | setLikelihood (const std::map< int, float > &likelihood) |
| Sets likelihood values for loop closure hypotheses. | |
| void | setRawLikelihood (const std::map< int, float > &rawLikelihood) |
| Sets raw likelihood values (before normalization) | |
| void | setLocalPath (const std::vector< int > &localPath) |
| Sets the local path (sequence of node IDs) | |
| void | setCurrentGoalId (int goal) |
| Sets the current goal node ID. | |
| void | setReducedIds (const std::map< int, int > &reducedIds) |
| Sets the reduced IDs mapping. | |
| void | setWmState (const std::vector< int > &state) |
| Sets the working memory state. | |
| void | setOdomCachePoses (const std::map< int, Transform > &poses) |
| Sets odometry cache poses. | |
| void | setOdomCacheConstraints (const std::multimap< int, Link > &constraints) |
| Sets odometry cache constraints. | |
| bool | extended () const |
| Returns whether extended statistics mode is enabled. | |
| int | refImageId () const |
| Returns the reference image ID. | |
| int | refImageMapId () const |
| Returns the reference image map ID. | |
| int | loopClosureId () const |
| Returns the loop closure detection ID. | |
| int | loopClosureMapId () const |
| Returns the loop closure map ID. | |
| int | proximityDetectionId () const |
| Returns the proximity detection ID. | |
| int | proximityDetectionMapId () const |
| Returns the proximity detection map ID. | |
| double | stamp () const |
| Returns the timestamp. | |
| const Signature & | getLastSignatureData () const |
| Returns the last signature data. | |
| const std::map< int, Signature > & | getSignaturesData () const |
| Returns all signature data. | |
| const std::map< int, Transform > & | poses () const |
| Returns the pose graph. | |
| const std::multimap< int, Link > & | constraints () const |
| Returns the constraint graph. | |
| const Transform & | mapCorrection () const |
| Returns the map correction transform. | |
| const Transform & | loopClosureTransform () const |
| Returns the loop closure transform. | |
| const cv::Mat & | localizationCovariance () const |
| Returns the localization covariance matrix. | |
| const std::map< int, std::string > & | labels () const |
| Returns node labels. | |
| const std::map< int, int > & | weights () const |
| Returns node weights. | |
| const std::map< int, float > & | posterior () const |
| Returns posterior probabilities. | |
| const std::map< int, float > & | likelihood () const |
| Returns likelihood values. | |
| const std::map< int, float > & | rawLikelihood () const |
| Returns raw likelihood values. | |
| const std::vector< int > & | localPath () const |
| Returns the local path. | |
| int | currentGoalId () const |
| Returns the current goal node ID. | |
| const std::map< int, int > & | reducedIds () const |
| Returns the reduced IDs mapping. | |
| const std::vector< int > & | wmState () const |
| Returns the working memory state. | |
| const std::map< int, Transform > & | odomCachePoses () const |
| Returns odometry cache poses. | |
| const std::multimap< int, Link > & | odomCacheConstraints () const |
| Returns odometry cache constraints. | |
| const std::map< std::string, float > & | data () const |
| Returns the statistics data map. | |
Static Public Member Functions | |
| static const std::map< std::string, float > & | defaultData () |
| Returns the default statistics data map. | |
| static std::string | serializeData (const std::map< std::string, float > &data) |
| Serializes a statistics data map to a string. | |
| static std::map< std::string, float > | deserializeData (const std::string &data) |
| Deserializes a statistics data map from a string. | |
Collects and manages runtime statistics for RTAB-Map.
The Statistics class provides a comprehensive system for collecting, storing, and managing various runtime statistics about RTAB-Map's operation. Statistics are organized into groups such as:
Statistics are stored in a map with keys in the format "Group/Name/Unit" (e.g., "Timing/Total time/ms"). This hierarchical naming allows for easy categorization and plotting.
The class supports two modes:
extended() == false): Only stores loop closure and last signature ID fieldsextended() == true): Stores all available statistics including poses, constraints, likelihoods, posteriors, and detailed timing informationStatistics can be serialized to/from strings for storage in databases or transmission over networks.
Definition at line 107 of file Statistics.h.
| rtabmap::Statistics::Statistics | ( | ) |
Default constructor.
Creates a new Statistics object in basic mode (extended = false). Initializes all ID fields to 0 or -1, and timestamp to 0.0.
|
static |
Returns the default statistics data map.
Returns a map containing all predefined statistics with their default values (0.0). This map is initialized when the first Statistics object is constructed.
|
static |
Serializes a statistics data map to a string.
Converts a statistics data map into a serialized string format suitable for storage or transmission. The format is: "key1:value1;key2:value2;..." where values are formatted as numbers with dots (not commas) as decimal separators (independent of the system's locale).
| data | The statistics data map to serialize |
|
static |
Deserializes a statistics data map from a string.
Parses a serialized statistics string back into a data map. The string format should be: "key1:value1;key2:value2;..." as produced by serializeData().
| data | The serialized string to parse |
| void rtabmap::Statistics::addStatistic | ( | const std::string & | name, |
| float | value | ||
| ) |
Adds a statistic value to the data map.
Adds or updates a statistic in the internal data map. The name should follow the format "Group/Name/Unit" (e.g., "Timing/Total time/ms").
| name | The statistic name in the format "Group/Name/Unit" |
| value | The statistic value to store |
|
inline |
Sets whether extended statistics mode is enabled.
In basic mode (extended = false), only loop closure and last signature ID fields are filled. In extended mode (extended = true), all available statistics including poses, constraints, likelihoods, posteriors, and detailed timing information are stored.
| extended | True to enable extended mode, false for basic mode |
Definition at line 367 of file Statistics.h.
|
inline |
Sets the reference image ID (current/last processed signature ID)
| id | The signature ID |
Definition at line 373 of file Statistics.h.
|
inline |
Sets the reference image map ID.
| id | The map ID associated with the reference image |
Definition at line 379 of file Statistics.h.
|
inline |
Sets the loop closure detection ID.
| id | The signature ID where a loop closure was detected (0 if none) |
Definition at line 385 of file Statistics.h.
|
inline |
Sets the loop closure map ID.
| id | The map ID associated with the loop closure |
Definition at line 391 of file Statistics.h.
|
inline |
Sets the proximity detection ID.
| id | The signature ID where proximity was detected (0 if none) |
Definition at line 397 of file Statistics.h.
|
inline |
Sets the proximity detection map ID.
| id | The map ID associated with the proximity detection |
Definition at line 403 of file Statistics.h.
|
inline |
Sets the timestamp for these statistics.
| stamp | The timestamp (typically in seconds since epoch) |
Definition at line 409 of file Statistics.h.
| RTABMAP_DEPRECATED void rtabmap::Statistics::setLastSignatureData | ( | const Signature & | data | ) |
Sets the last signature data (deprecated)
This method is deprecated. Use addSignatureData() instead, which allows storing multiple signatures.
|
inline |
Adds signature data to the statistics.
Adds a signature to the internal signatures data map. Multiple signatures can be stored, indexed by their ID.
| data | The signature to add |
Definition at line 430 of file Statistics.h.
|
inline |
Sets all signature data at once.
| data | Map of signature IDs to Signature objects |
Definition at line 436 of file Statistics.h.
|
inline |
Sets the pose graph (node poses)
Sets the complete pose graph, mapping node IDs to their Transform poses. Used in extended mode for visualization and analysis.
| poses | Map of node IDs to their poses |
Definition at line 446 of file Statistics.h.
|
inline |
Sets the constraint graph (links between nodes)
Sets the complete constraint graph, mapping node IDs to their Link constraints. Used in extended mode for visualization and analysis.
| constraints | Multimap of node IDs to their links (a node can have multiple links) |
Definition at line 456 of file Statistics.h.
|
inline |
Sets the map correction transform.
The map correction transform represents the transformation from the map fixed frame to the odometry fixed frame. This transform is typically updated after graph optimization to transform the odometry pose in map frame.
| mapCorrection | The pose of odometry frame in map coordinate system |
Definition at line 467 of file Statistics.h.
|
inline |
Sets the loop closure transform.
The transform between the current pose and the loop closure pose.
| loopClosureTransform | The loop closure transform |
Definition at line 476 of file Statistics.h.
|
inline |
Sets the localization covariance matrix.
The covariance matrix representing the uncertainty in the current localization estimate.
| covariance | The covariance matrix (typically 6x6 for 3D pose) |
Definition at line 485 of file Statistics.h.
|
inline |
Sets node labels.
| labels | Map of node IDs to their string labels |
Definition at line 491 of file Statistics.h.
|
inline |
Sets node weights.
| weights | Map of node IDs to their integer weights |
Definition at line 497 of file Statistics.h.
|
inline |
Sets posterior probabilities for loop closure hypotheses.
| posterior | Map of node IDs to their posterior probabilities |
Definition at line 504 of file Statistics.h.
|
inline |
Sets likelihood values for loop closure hypotheses.
Likelihood values represent how well each hypothesis matches the current observation.
| likelihood | Map of node IDs to their likelihood values |
Definition at line 513 of file Statistics.h.
|
inline |
Sets raw likelihood values (before normalization)
| rawLikelihood | Map of node IDs to their raw likelihood values |
Definition at line 519 of file Statistics.h.
|
inline |
Sets the local path (sequence of node IDs)
The local path represents the sequence of next nodes to visit for path planning.
| localPath | Vector of node IDs in order of next nodes to visit |
Definition at line 528 of file Statistics.h.
|
inline |
Sets the current goal node ID.
| goal | The goal node ID (0 if no goal) |
Definition at line 534 of file Statistics.h.
|
inline |
Sets the reduced IDs mapping.
Maps original node IDs to reduced IDs, used for memory optimization.
| reducedIds | Map of original IDs to reduced IDs |
Definition at line 543 of file Statistics.h.
|
inline |
Sets the working memory state.
The working memory state is a vector of node IDs currently in working memory.
| state | Vector of node IDs in working memory |
Definition at line 552 of file Statistics.h.
|
inline |
Sets odometry cache poses.
Cached odometry poses during localization mode.
| poses | Map of node IDs to their cached odometry poses |
Definition at line 561 of file Statistics.h.
|
inline |
Sets odometry cache constraints.
Cached odometry constraints (links) between nodes.
| constraints | Multimap of node IDs to their cached odometry links |
Definition at line 570 of file Statistics.h.
|
inline |
Returns whether extended statistics mode is enabled.
Definition at line 578 of file Statistics.h.
|
inline |
Returns the reference image ID.
Definition at line 584 of file Statistics.h.
|
inline |
Returns the reference image map ID.
Definition at line 590 of file Statistics.h.
|
inline |
Returns the loop closure detection ID.
Definition at line 596 of file Statistics.h.
|
inline |
Returns the loop closure map ID.
Definition at line 602 of file Statistics.h.
|
inline |
Returns the proximity detection ID.
Definition at line 608 of file Statistics.h.
|
inline |
Returns the proximity detection map ID.
Definition at line 614 of file Statistics.h.
|
inline |
Returns the timestamp.
Definition at line 620 of file Statistics.h.
|
inline |
Returns the last signature data.
Returns the most recently added signature (by ID). If no signatures are stored, returns a dummy empty signature.
Definition at line 630 of file Statistics.h.
|
inline |
Returns all signature data.
Definition at line 636 of file Statistics.h.
|
inline |
Returns the pose graph.
Definition at line 642 of file Statistics.h.
|
inline |
Returns the constraint graph.
Definition at line 648 of file Statistics.h.
|
inline |
Returns the map correction transform.
Returns the transform from the map fixed frame to the odometry fixed frame.
Definition at line 657 of file Statistics.h.
|
inline |
Returns the loop closure transform.
Definition at line 663 of file Statistics.h.
|
inline |
Returns the localization covariance matrix.
Definition at line 669 of file Statistics.h.
|
inline |
Returns node labels.
Definition at line 675 of file Statistics.h.
|
inline |
Returns node weights.
Definition at line 681 of file Statistics.h.
|
inline |
Returns posterior probabilities.
Definition at line 687 of file Statistics.h.
|
inline |
Returns likelihood values.
Definition at line 693 of file Statistics.h.
|
inline |
Returns raw likelihood values.
Definition at line 699 of file Statistics.h.
|
inline |
Returns the local path.
Definition at line 705 of file Statistics.h.
|
inline |
Returns the current goal node ID.
Definition at line 711 of file Statistics.h.
|
inline |
Returns the reduced IDs mapping.
Definition at line 717 of file Statistics.h.
|
inline |
Returns the working memory state.
Definition at line 723 of file Statistics.h.
|
inline |
Returns odometry cache poses.
Definition at line 729 of file Statistics.h.
|
inline |
Returns odometry cache constraints.
Definition at line 735 of file Statistics.h.
|
inline |
Returns the statistics data map.
Returns the map containing all plottable statistics in the format "Group/Name/Unit" -> value. This is the main data structure for storing numeric statistics.
Definition at line 748 of file Statistics.h.