RTAB-Map 0.23.10
Real-Time Appearance-Based Mapping
Loading...
Searching...
No Matches
rtabmap::GlobalMap Class Referenceabstract

Abstract base for assembling per-node LocalGrid data into a global map. More...

#include <GlobalMap.h>

Inheritance diagram for rtabmap::GlobalMap:

Public Member Functions

bool fullUpdateNeeded (const std::map< int, Transform > &poses) const
 True if the map should be rebuilt from cache (loop closure or disjoint graph).
 
bool update (const std::map< int, Transform > &poses)
 Incrementally assemble new nodes from poses.
 
virtual void clear ()
 Clears assembled nodes and grid bounds; does not clear LocalGridCache.
 
float getCellSize () const
 
float getUpdateError () const
 
const std::map< int, Transform > & addedNodes () const
 
void getGridMin (double &x, double &y) const
 2D grid minimum (x, y) in meters.
 
void getGridMax (double &x, double &y) const
 2D grid maximum (x, y) in meters.
 
void getGridMin (double &x, double &y, double &z) const
 3D grid minimum (x, y, z) in meters.
 
void getGridMax (double &x, double &y, double &z) const
 3D grid maximum (x, y, z) in meters.
 
virtual unsigned long getMemoryUsed () const
 Approximate memory used by assembled-node bookkeeping (bytes).
 

Static Public Member Functions

static float logodds (double probability)
 Converts probability in (0, 1) to log-odds.
 
static double probability (double logodds)
 Converts log-odds back to probability in (0, 1).
 

Protected Member Functions

 GlobalMap (const LocalGridCache *cache, const ParametersMap &parameters=ParametersMap())
 Constructs the base map; subclasses call from their constructor.
 
virtual void assemble (const std::list< std::pair< int, Transform > > &newPoses)=0
 Subclass hook: merge newPoses into the global map; call addAssembledNode().
 
const std::map< int, LocalGrid > & cache () const
 
const std::map< int, Transform > & assembledNodes () const
 
bool isNodeAssembled (int id)
 
void addAssembledNode (int id, const Transform &pose)
 Records a successfully assembled node (ids <= 0 are ignored).
 

Protected Attributes

float cellSize_
 
float updateError_
 
float occupancyThr_
 
float logOddsHit_
 
float logOddsMiss_
 
float logOddsClampingMin_
 
float logOddsClampingMax_
 
double minValues_ [3]
 
double maxValues_ [3]
 

Detailed Description

Abstract base for assembling per-node LocalGrid data into a global map.

Subclasses (OccupancyGrid, OctoMap, GridMap, CloudMap) implement assemble() to merge new node poses from LocalGridCache into their representation.

update() decides which poses need assembly (not yet in addedNodes(), present in cache, id > 0) and may call clear() when fullUpdateNeeded() detects graph optimization or a disjoint pose set (see Parameters::kGridGlobalUpdateError()).

Log-odds helpers logodds() and probability() convert between occupancy probability and the internal log-odds representation used for global hit/miss/clamping parameters (GridGlobal/Prob*).

Definition at line 55 of file GlobalMap.h.

Constructor & Destructor Documentation

◆ GlobalMap()

rtabmap::GlobalMap::GlobalMap ( const LocalGridCache cache,
const ParametersMap parameters = ParametersMap() 
)
protected

Constructs the base map; subclasses call from their constructor.

Parameters
cacheNon-null cache of per-node local grids.
parametersOptional Grid/ and GridGlobal/ parameter overrides.

Member Function Documentation

◆ logodds()

static float rtabmap::GlobalMap::logodds ( double  probability)
inlinestatic

Converts probability in (0, 1) to log-odds.

Definition at line 59 of file GlobalMap.h.

◆ probability()

static double rtabmap::GlobalMap::probability ( double  logodds)
inlinestatic

Converts log-odds back to probability in (0, 1).

Definition at line 65 of file GlobalMap.h.

◆ fullUpdateNeeded()

bool rtabmap::GlobalMap::fullUpdateNeeded ( const std::map< int, Transform > &  poses) const

True if the map should be rebuilt from cache (loop closure or disjoint graph).

Compares poses to addedNodes() using getUpdateError(), which is set from Grid/GlobalUpdateError (Parameters::kGridGlobalUpdateError()): if any assembled node's pose moved farther than that threshold (meters), or if none of the assembled nodes appear in poses, returns true and update() will call clear() first.

Parameters
posesCurrent graph poses (node id → transform).

◆ update()

bool rtabmap::GlobalMap::update ( const std::map< int, Transform > &  poses)

Incrementally assemble new nodes from poses.

Parameters
posesGraph poses; ids > 0 with a cached LocalGrid are candidates.
Returns
True if assemble() was called (at least one new pose processed).

◆ clear()

virtual void rtabmap::GlobalMap::clear ( )
virtual

Clears assembled nodes and grid bounds; does not clear LocalGridCache.

Reimplemented in rtabmap::CloudMap, rtabmap::GridMap, rtabmap::OccupancyGrid, and rtabmap::OctoMap.

◆ getCellSize()

float rtabmap::GlobalMap::getCellSize ( ) const
inline
Returns
Grid cell size in meters (Grid/CellSize).

Definition at line 96 of file GlobalMap.h.

◆ getUpdateError()

float rtabmap::GlobalMap::getUpdateError ( ) const
inline
Returns
Pose change threshold for full rebuild (Grid/GlobalUpdateError).

Definition at line 98 of file GlobalMap.h.

◆ addedNodes()

const std::map< int, Transform > & rtabmap::GlobalMap::addedNodes ( ) const
inline
Returns
Poses of nodes already assembled into the global map.

Definition at line 100 of file GlobalMap.h.

◆ getGridMin() [1/2]

void rtabmap::GlobalMap::getGridMin ( double &  x,
double &  y 
) const
inline

2D grid minimum (x, y) in meters.

Definition at line 103 of file GlobalMap.h.

◆ getGridMax() [1/2]

void rtabmap::GlobalMap::getGridMax ( double &  x,
double &  y 
) const
inline

2D grid maximum (x, y) in meters.

Definition at line 105 of file GlobalMap.h.

◆ getGridMin() [2/2]

void rtabmap::GlobalMap::getGridMin ( double &  x,
double &  y,
double &  z 
) const
inline

3D grid minimum (x, y, z) in meters.

Definition at line 107 of file GlobalMap.h.

◆ getGridMax() [2/2]

void rtabmap::GlobalMap::getGridMax ( double &  x,
double &  y,
double &  z 
) const
inline

3D grid maximum (x, y, z) in meters.

Definition at line 109 of file GlobalMap.h.

◆ getMemoryUsed()

virtual unsigned long rtabmap::GlobalMap::getMemoryUsed ( ) const
virtual

Approximate memory used by assembled-node bookkeeping (bytes).

Reimplemented in rtabmap::CloudMap, rtabmap::OccupancyGrid, and rtabmap::OctoMap.

◆ assemble()

virtual void rtabmap::GlobalMap::assemble ( const std::list< std::pair< int, Transform > > &  newPoses)
protectedpure virtual

Subclass hook: merge newPoses into the global map; call addAssembledNode().

Implemented in rtabmap::CloudMap, rtabmap::GridMap, rtabmap::OccupancyGrid, and rtabmap::OctoMap.

◆ cache()

const std::map< int, LocalGrid > & rtabmap::GlobalMap::cache ( ) const
inlineprotected
Returns
Cached local grids keyed by node id.

Definition at line 126 of file GlobalMap.h.

◆ assembledNodes()

const std::map< int, Transform > & rtabmap::GlobalMap::assembledNodes ( ) const
inlineprotected
Returns
Poses of nodes already assembled (same as addedNodes()).

Definition at line 129 of file GlobalMap.h.

◆ isNodeAssembled()

bool rtabmap::GlobalMap::isNodeAssembled ( int  id)
inlineprotected
Returns
True if id is already in the assembled set.

Definition at line 131 of file GlobalMap.h.

Member Data Documentation

◆ cellSize_

float rtabmap::GlobalMap::cellSize_
protected

Definition at line 136 of file GlobalMap.h.

◆ updateError_

float rtabmap::GlobalMap::updateError_
protected

Definition at line 137 of file GlobalMap.h.

◆ occupancyThr_

float rtabmap::GlobalMap::occupancyThr_
protected

Definition at line 139 of file GlobalMap.h.

◆ logOddsHit_

float rtabmap::GlobalMap::logOddsHit_
protected

Definition at line 140 of file GlobalMap.h.

◆ logOddsMiss_

float rtabmap::GlobalMap::logOddsMiss_
protected

Definition at line 141 of file GlobalMap.h.

◆ logOddsClampingMin_

float rtabmap::GlobalMap::logOddsClampingMin_
protected

Definition at line 142 of file GlobalMap.h.

◆ logOddsClampingMax_

float rtabmap::GlobalMap::logOddsClampingMax_
protected

Definition at line 143 of file GlobalMap.h.

◆ minValues_

double rtabmap::GlobalMap::minValues_[3]
protected

Definition at line 145 of file GlobalMap.h.

◆ maxValues_

double rtabmap::GlobalMap::maxValues_[3]
protected

Definition at line 146 of file GlobalMap.h.


The documentation for this class was generated from the following file: