Autoware.Auto
autoware::perception::filters::voxel_grid::CentroidVoxel< PointT > Class Template Reference

A specialization of the Voxel class, accumulates points to a moving centroid. More...

#include <voxels.hpp>

Inheritance diagram for autoware::perception::filters::voxel_grid::CentroidVoxel< PointT >:
Collaboration diagram for autoware::perception::filters::voxel_grid::CentroidVoxel< PointT >:

Public Member Functions

void add_observation (const PointT &pt)
 Update the state of this voxel by incrementally updating the mean. More...
 
void configure (const Config &cfg, const uint64_t idx)
 Use Config and index to set up any important information, in this case no-op. More...
 
- Public Member Functions inherited from autoware::perception::filters::voxel_grid::Voxel< PointT >
 Voxel ()
 Default constructor, corresponds to an empty/uninitialized voxel. More...
 
 Voxel (const PointT &pt)
 Point constructor, voxel is assumed to be created based on this point. More...
 
 operator bool () const
 Conversion operator to bool, pass through to occupied. More...
 
 operator PointT () const
 Conversion operator to PointT, pass through to get. More...
 
bool occupied () const
 Whether or not this object has at least one point associated with it. More...
 
void clear ()
 Resets the centroid for incremental updating. More...
 
const PointT & get () const
 Emit the centroid. More...
 
uint32_t count () const
 Get the current number of points associated with this voxel. More...
 

Additional Inherited Members

- Public Types inherited from autoware::perception::filters::voxel_grid::Voxel< PointT >
using point_t = PointT
 
- Protected Member Functions inherited from autoware::perception::filters::voxel_grid::Voxel< PointT >
void set_count (const uint32_t next)
 Sets the count. This is to properly encapsulate the member variables. Intended to be used by child classes. More...
 
void set_centroid (const PointT &pt)
 Sets the centroid. This is to properly encapsulate the member variables. Intended to be used by child classes. More...
 

Detailed Description

template<typename PointT>
class autoware::perception::filters::voxel_grid::CentroidVoxel< PointT >

A specialization of the Voxel class, accumulates points to a moving centroid.

Template Parameters
PointTThe point type, must have operator+ and operator*(float32_t) defined, and float32_t members x, y, and z

A note on extending this to point types with additional fields: The default behavior only updates the x, y, and z fields of the points. To get proper behavior for other types, you can define operator+(PointT, PointT) and operator*(PointT, float32_t), in this namespace or the global namespace to get proper resolution.

Member Function Documentation

◆ add_observation()

template<typename PointT >
void autoware::perception::filters::voxel_grid::CentroidVoxel< PointT >::add_observation ( const PointT &  pt)
inline

Update the state of this voxel by incrementally updating the mean.

Parameters
[in]ptThe observed point

◆ configure()

template<typename PointT >
void autoware::perception::filters::voxel_grid::CentroidVoxel< PointT >::configure ( const Config cfg,
const uint64_t  idx 
)
inline

Use Config and index to set up any important information, in this case no-op.

Parameters
[in]cfgThe configuration object for the parent voxel grid
[in]idxThe index for this particular voxel

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