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

Cache of LocalGrid entries keyed by map node id. More...

#include <LocalGrid.h>

Public Member Functions

void add (int nodeId, const cv::Mat &ground, const cv::Mat &obstacles, const cv::Mat &empty, float cellSize, const cv::Point3f &viewPoint=cv::Point3f(0, 0, 0))
 Inserts or replaces the grid for nodeId (from separate cell mats).
 
void add (int nodeId, const LocalGrid &localGrid)
 Inserts or replaces the grid for nodeId.
 
bool shareTo (int nodeId, LocalGridCache &anotherCache) const
 Copies a grid to anotherCache if present here and absent there.
 
unsigned long getMemoryUsed () const
 Approximate memory used by cached grids (bytes).
 
void clear (bool temporaryOnly=false)
 Removes cached grids.
 
size_t size () const
 
bool empty () const
 
const std::map< int, LocalGrid > & localGrids () const
 
std::map< int, LocalGrid >::const_iterator find (int nodeId) const
 
std::map< int, LocalGrid >::const_iterator begin () const
 
std::map< int, LocalGrid >::const_iterator end () const
 

Detailed Description

Cache of LocalGrid entries keyed by map node id.

Used by GlobalMap and its subclasses (e.g. OccupancyGrid) to hold per-node local grids before assembly. Node id 0 is stored as -1 (temporary grid). Negative ids passed to add() are rejected.

Definition at line 97 of file LocalGrid.h.

Constructor & Destructor Documentation

◆ LocalGridCache()

rtabmap::LocalGridCache::LocalGridCache ( )
inline

Definition at line 100 of file LocalGrid.h.

◆ ~LocalGridCache()

virtual rtabmap::LocalGridCache::~LocalGridCache ( )
inlinevirtual

Definition at line 101 of file LocalGrid.h.

Member Function Documentation

◆ shareTo()

bool rtabmap::LocalGridCache::shareTo ( int  nodeId,
LocalGridCache anotherCache 
) const

Copies a grid to anotherCache if present here and absent there.

Returns
True if a grid was shared.

◆ clear()

void rtabmap::LocalGridCache::clear ( bool  temporaryOnly = false)

Removes cached grids.

Parameters
temporaryOnlyIf true, removes only entries with negative ids (e.g. -1).

◆ size()

size_t rtabmap::LocalGridCache::size ( ) const
inline

Definition at line 129 of file LocalGrid.h.

◆ empty()

bool rtabmap::LocalGridCache::empty ( ) const
inline

Definition at line 130 of file LocalGrid.h.

◆ localGrids()

const std::map< int, LocalGrid > & rtabmap::LocalGridCache::localGrids ( ) const
inline

Definition at line 131 of file LocalGrid.h.

◆ find()

std::map< int, LocalGrid >::const_iterator rtabmap::LocalGridCache::find ( int  nodeId) const
inline

Definition at line 133 of file LocalGrid.h.

◆ begin()

std::map< int, LocalGrid >::const_iterator rtabmap::LocalGridCache::begin ( ) const
inline

Definition at line 134 of file LocalGrid.h.

◆ end()

std::map< int, LocalGrid >::const_iterator rtabmap::LocalGridCache::end ( ) const
inline

Definition at line 135 of file LocalGrid.h.


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