Conscience Core
Public Member Functions | List of all members
conscience_core::lidar::CscSlam3dMap Class Reference

#include <CscSlamEngine.h>

Public Member Functions

 CscSlam3dMap ()
 
void appendLocalFrame (const std::vector< CscPoint3d > &localPointsCm, const CPose3D &pose, size_t decimationStep, double minPointDistanceMeters, double maxPointDistanceMeters)
 
vector< CscPoint3d * > pointsCopyPtrs (const CscPoint3d &entityStartPosition, const CscQuaternion &entityStartOrientation) const
 
vector< CscSlam3dMapVoxelKeygetAllVoxelsCopy () const
 
size_t probabilisticVoxelGridSize () const
 
CscSlam3dMapVoxelGrid buildVisibleVoxelGridFromProbabilisticState () const
 
void clear ()
 
bool isEmpty () const
 
uint64_t add3dMapVoxelChangesListener (function< void(const CscSlam3dMapVoxelChanges &changes)> callback, CscSlam3dMapVoxelChanges *changes=nullptr)
 
void remove3dMapVoxelChangesListener (uint64_t listenerId)
 
void withProbabilisticVoxelGridReadLock (const std::function< void(const CscSlam3dProbabilisticVoxelGrid &grid)> &callback) const
 
size_t visibleProbabilisticVoxelGridSize () const
 
void purgeFarNeighbors (int minNeighborCount=2, int minHits=3)
 Remove isolated voxels that have too few occupied neighbors. A voxel with too few neighbors can still be kept if it has enough hits. More...
 

Detailed Description

This structure holds the live SLAM map with the most relevant data format for high quality real time SLAM, and other structures acting as cache for more user-friendly representations such as downsmapled display voxels or point cloud.

Details: probabilisticVoxelGrid is the real time representation, and voxelGrid is the downsampled / display oriented version

Constructor & Destructor Documentation

◆ CscSlam3dMap()

conscience_core::lidar::CscSlam3dMap::CscSlam3dMap ( )

Builds optimized 3D SLAM map

Member Function Documentation

◆ add3dMapVoxelChangesListener()

uint64_t conscience_core::lidar::CscSlam3dMap::add3dMapVoxelChangesListener ( function< void(const CscSlam3dMapVoxelChanges &changes)>  callback,
CscSlam3dMapVoxelChanges changes = nullptr 
)

◆ appendLocalFrame()

void conscience_core::lidar::CscSlam3dMap::appendLocalFrame ( const std::vector< CscPoint3d > &  localPointsCm,
const CPose3D &  pose,
size_t  decimationStep,
double  minPointDistanceMeters,
double  maxPointDistanceMeters 
)

◆ buildVisibleVoxelGridFromProbabilisticState()

CscSlam3dMapVoxelGrid conscience_core::lidar::CscSlam3dMap::buildVisibleVoxelGridFromProbabilisticState ( ) const

◆ clear()

void conscience_core::lidar::CscSlam3dMap::clear ( )

◆ getAllVoxelsCopy()

vector<CscSlam3dMapVoxelKey> conscience_core::lidar::CscSlam3dMap::getAllVoxelsCopy ( ) const
inline
Returns
return voxels of current SLAM 3D map
See also
CscSlam3dMapVoxelKey

◆ isEmpty()

bool conscience_core::lidar::CscSlam3dMap::isEmpty ( ) const

◆ pointsCopyPtrs()

std::vector< CscPoint3d * > conscience_core::lidar::CscSlam3dMap::pointsCopyPtrs ( const CscPoint3d entityStartPosition,
const CscQuaternion entityStartOrientation 
) const
Parameters
entityStartPositioninitial position when cartography started
entityStartOrientationinitial orientation when cartography started
Returns
a owned copy of SLAM 3D MAP points (from voxelGrid), transformed for Csc world ref frame (that's why it needs initial pos/rot)

◆ probabilisticVoxelGridSize()

size_t conscience_core::lidar::CscSlam3dMap::probabilisticVoxelGridSize ( ) const

◆ purgeFarNeighbors()

void conscience_core::lidar::CscSlam3dMap::purgeFarNeighbors ( int  minNeighborCount = 2,
int  minHits = 3 
)

Remove isolated voxels that have too few occupied neighbors. A voxel with too few neighbors can still be kept if it has enough hits.

◆ remove3dMapVoxelChangesListener()

void conscience_core::lidar::CscSlam3dMap::remove3dMapVoxelChangesListener ( uint64_t  listenerId)

◆ visibleProbabilisticVoxelGridSize()

size_t conscience_core::lidar::CscSlam3dMap::visibleProbabilisticVoxelGridSize ( ) const
Returns
visible voxels count in probalistic grid
See also
CscSlam3dProbabilisticVoxel::getVisibleThreshold()

◆ withProbabilisticVoxelGridReadLock()

void conscience_core::lidar::CscSlam3dMap::withProbabilisticVoxelGridReadLock ( const std::function< void(const CscSlam3dProbabilisticVoxelGrid &grid)> &  callback) const

Gives read-only access to the probabilistic voxel grid while holding updateMutex.

Warning:

  • callback is executed under shared lock
  • do not call back into CscSlam3dMap from the callback
  • keep the callback short

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