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

A simple class to accumulate points for a voxel and emit the centroid. More...

#include <voxel.hpp>

Inheritance diagram for autoware::perception::filters::voxel_grid::Voxel< PointT >:

Public Types

using point_t = PointT
 

Public Member Functions

 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...
 

Protected Member Functions

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::Voxel< PointT >

A simple class to accumulate points for a voxel and emit the centroid.

The VoxelGrid data structure assumes the voxel type subclasses from this class, and adds one additional function with the signature void add_observation(const PointT & pt);

Template Parameters
PointTThe point type, must have float32_t members x, y, and z

Member Typedef Documentation

◆ point_t

template<typename PointT >
using autoware::perception::filters::voxel_grid::Voxel< PointT >::point_t = PointT

Constructor & Destructor Documentation

◆ Voxel() [1/2]

template<typename PointT >
autoware::perception::filters::voxel_grid::Voxel< PointT >::Voxel ( )
inline

Default constructor, corresponds to an empty/uninitialized voxel.

◆ Voxel() [2/2]

template<typename PointT >
autoware::perception::filters::voxel_grid::Voxel< PointT >::Voxel ( const PointT &  pt)
inlineexplicit

Point constructor, voxel is assumed to be created based on this point.

Member Function Documentation

◆ clear()

template<typename PointT >
void autoware::perception::filters::voxel_grid::Voxel< PointT >::clear ( )
inline

Resets the centroid for incremental updating.

◆ count()

template<typename PointT >
uint32_t autoware::perception::filters::voxel_grid::Voxel< PointT >::count ( ) const
inline

Get the current number of points associated with this voxel.

Returns
The numbre of points

◆ get()

template<typename PointT >
const PointT& autoware::perception::filters::voxel_grid::Voxel< PointT >::get ( ) const
inline

Emit the centroid.

Returns
A const reference to the centroid
Exceptions
std::out_of_rangeIf voxel is not occupied

◆ occupied()

template<typename PointT >
bool autoware::perception::filters::voxel_grid::Voxel< PointT >::occupied ( ) const
inline

Whether or not this object has at least one point associated with it.

Returns
If the voxel has a point associated with it

◆ operator bool()

template<typename PointT >
autoware::perception::filters::voxel_grid::Voxel< PointT >::operator bool ( ) const
inlineexplicit

Conversion operator to bool, pass through to occupied.

Returns
Whether or not the object is occuped

◆ operator PointT()

template<typename PointT >
autoware::perception::filters::voxel_grid::Voxel< PointT >::operator PointT ( ) const
inlineexplicit

Conversion operator to PointT, pass through to get.

Returns
A copy of the underlying centroid
Exceptions
std::out_of_rangeIf voxel is not occupied

◆ set_centroid()

template<typename PointT >
void autoware::perception::filters::voxel_grid::Voxel< PointT >::set_centroid ( const PointT &  pt)
inlineprotected

Sets the centroid. This is to properly encapsulate the member variables. Intended to be used by child classes.

Parameters
[in]ptThe new centroid

◆ set_count()

template<typename PointT >
void autoware::perception::filters::voxel_grid::Voxel< PointT >::set_count ( const uint32_t  next)
inlineprotected

Sets the count. This is to properly encapsulate the member variables. Intended to be used by child classes.

Parameters
[in]nextThe new count to set the number points

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