Point Cloud Library (PCL)  1.14.1-dev
List of all members | Public Member Functions
pcl::gpu::kinfuLS::CyclicalBuffer Class Reference

CyclicalBuffer implements a cyclical TSDF buffer. More...

#include </__w/1/s/gpu/kinfu_large_scale/include/pcl/gpu/kinfu_large_scale/cyclical_buffer.h>

Public Member Functions

 CyclicalBuffer (const double distance_threshold, const double cube_size=3.f, const int nb_voxels_per_axis=512)
 Constructor for a cubic CyclicalBuffer. More...
 
 CyclicalBuffer (const double distance_threshold, const double volume_size_x, const double volume_size_y, const double volume_size_z, const int nb_voxels_x, const int nb_voxels_y, const int nb_voxels_z)
 Constructor for a non-cubic CyclicalBuffer. More...
 
bool checkForShift (const TsdfVolume::Ptr volume, const Eigen::Affine3f &cam_pose, const double distance_camera_target, const bool perform_shift=true, const bool last_shift=false, const bool force_shift=false)
 Check if shifting needs to be performed, returns true if so. More...
 
void performShift (const TsdfVolume::Ptr volume, const pcl::PointXYZ &target_point, const bool last_shift=false)
 Perform shifting operations: Compute offsets. More...
 
void setDistanceThreshold (const double threshold)
 Sets the distance threshold between cube's center and target point that triggers a shift. More...
 
float getDistanceThreshold ()
 Returns the distance threshold between cube's center and target point that triggers a shift. More...
 
tsdf_buffergetBuffer ()
 get a pointer to the tsdf_buffer structure. More...
 
void setVolumeSize (const double size_x, const double size_y, const double size_z)
 Set the physical size represented by the default TSDF volume. More...
 
void setVolumeSize (const double size)
 Set the physical size represented by the default TSDF volume. More...
 
void computeAndSetNewCubeMetricOrigin (const pcl::PointXYZ &target_point, int &shiftX, int &shiftY, int &shiftZ)
 Computes and set the origin of the new cube (relative to the world), centered around a the target point. More...
 
void initBuffer (TsdfVolume::Ptr tsdf_volume)
 Initializes memory pointers of the cyclical buffer (start, end, current origin) More...
 
void resetBuffer (TsdfVolume::Ptr tsdf_volume)
 Reset buffer structure. More...
 
pcl::kinfuLS::WorldModel< pcl::PointXYZI > * getWorldModel ()
 Return a pointer to the world model. More...
 

Detailed Description

CyclicalBuffer implements a cyclical TSDF buffer.

The class offers a simple interface, by handling shifts and maintaining the world autonomously.

Author
Raphael Favier, Francisco Heredia

Definition at line 63 of file cyclical_buffer.h.

Constructor & Destructor Documentation

◆ CyclicalBuffer() [1/2]

pcl::gpu::kinfuLS::CyclicalBuffer::CyclicalBuffer ( const double  distance_threshold,
const double  cube_size = 3.f,
const int  nb_voxels_per_axis = 512 
)
inline

Constructor for a cubic CyclicalBuffer.

Parameters
[in]distance_thresholddistance between cube center and target point at which we decide to shift.
[in]cube_sizephysical size (in meters) of the volume (here, a cube) represented by the TSDF buffer.
[in]nb_voxels_per_axisnumber of voxels per axis of the volume represented by the TSDF buffer.

Definition at line 73 of file cyclical_buffer.h.

◆ CyclicalBuffer() [2/2]

pcl::gpu::kinfuLS::CyclicalBuffer::CyclicalBuffer ( const double  distance_threshold,
const double  volume_size_x,
const double  volume_size_y,
const double  volume_size_z,
const int  nb_voxels_x,
const int  nb_voxels_y,
const int  nb_voxels_z 
)
inline

Constructor for a non-cubic CyclicalBuffer.

Parameters
[in]distance_thresholddistance between cube center and target point at which we decide to shift.
[in]volume_size_xphysical size (in meters) of the volume, X axis.
[in]volume_size_yphysical size (in meters) of the volume, Y axis.
[in]volume_size_zphysical size (in meters) of the volume, Z axis.
[in]nb_voxels_xnumber of voxels for X axis of the volume represented by the TSDF buffer.
[in]nb_voxels_ynumber of voxels for Y axis of the volume represented by the TSDF buffer.
[in]nb_voxels_znumber of voxels for Z axis of the volume represented by the TSDF buffer.

Definition at line 94 of file cyclical_buffer.h.

Member Function Documentation

◆ checkForShift()

bool pcl::gpu::kinfuLS::CyclicalBuffer::checkForShift ( const TsdfVolume::Ptr  volume,
const Eigen::Affine3f &  cam_pose,
const double  distance_camera_target,
const bool  perform_shift = true,
const bool  last_shift = false,
const bool  force_shift = false 
)

Check if shifting needs to be performed, returns true if so.

Shifting is considered needed if the target point is farther than distance_threshold_. The target point is located at distance_camera_point on the local Z axis of the camera.

Parameters
[in]volumepointer to the TSDFVolume living in GPU
[in]cam_poseglobal pose of the camera in the world
[in]distance_camera_targetdistance from the camera's origin to the target point
[in]perform_shiftif set to false, shifting is not performed. The function will return true if shifting is needed.
[in]last_shiftif set to true, the whole cube will be shifted. This is used to push the whole cube to the world model.
[in]force_shiftif set to true, shifting is forced.
Returns
true is the cube needs to be or has been shifted.

◆ computeAndSetNewCubeMetricOrigin()

void pcl::gpu::kinfuLS::CyclicalBuffer::computeAndSetNewCubeMetricOrigin ( const pcl::PointXYZ target_point,
int &  shiftX,
int &  shiftY,
int &  shiftZ 
)

Computes and set the origin of the new cube (relative to the world), centered around a the target point.

Parameters
[in]target_pointthe target point around which the new cube will be centered.
[out]shiftXshift on X axis (in indices).
[out]shiftYshift on Y axis (in indices).
[out]shiftZshift on Z axis (in indices).

◆ getBuffer()

tsdf_buffer* pcl::gpu::kinfuLS::CyclicalBuffer::getBuffer ( )
inline

get a pointer to the tsdf_buffer structure.

Returns
a pointer to the tsdf_buffer used by cyclical buffer object.

Definition at line 147 of file cyclical_buffer.h.

◆ getDistanceThreshold()

float pcl::gpu::kinfuLS::CyclicalBuffer::getDistanceThreshold ( )
inline

Returns the distance threshold between cube's center and target point that triggers a shift.

Definition at line 142 of file cyclical_buffer.h.

◆ getWorldModel()

pcl::kinfuLS::WorldModel<pcl::PointXYZI>* pcl::gpu::kinfuLS::CyclicalBuffer::getWorldModel ( )
inline

Return a pointer to the world model.

Definition at line 205 of file cyclical_buffer.h.

◆ initBuffer()

void pcl::gpu::kinfuLS::CyclicalBuffer::initBuffer ( TsdfVolume::Ptr  tsdf_volume)
inline

Initializes memory pointers of the cyclical buffer (start, end, current origin)

Parameters
[in]tsdf_volumepointer to the TSDF volume managed by this cyclical buffer

Definition at line 182 of file cyclical_buffer.h.

References pcl::gpu::DevPtr< T >::data, and pcl::gpu::PtrStep< T >::ptr().

◆ performShift()

void pcl::gpu::kinfuLS::CyclicalBuffer::performShift ( const TsdfVolume::Ptr  volume,
const pcl::PointXYZ target_point,
const bool  last_shift = false 
)

Perform shifting operations: Compute offsets.

Extract current slice from TSDF buffer. Extract existing data from world. Clear shifted slice in TSDF buffer. Push existing data into TSDF buffer. Update rolling buffer Update world model.

Parameters
[in]volumepointer to the TSDFVolume living in GPU
[in]target_pointtarget point around which the new cube will be centered
[in]last_shiftif set to true, the whole cube will be shifted. This is used to push the whole cube to the world model.

◆ resetBuffer()

void pcl::gpu::kinfuLS::CyclicalBuffer::resetBuffer ( TsdfVolume::Ptr  tsdf_volume)
inline

Reset buffer structure.

Parameters
[in]tsdf_volumepointer to the TSDF volume managed by this cyclical buffer

Definition at line 194 of file cyclical_buffer.h.

◆ setDistanceThreshold()

void pcl::gpu::kinfuLS::CyclicalBuffer::setDistanceThreshold ( const double  threshold)
inline

Sets the distance threshold between cube's center and target point that triggers a shift.

Parameters
[in]thresholdthe distance in meters at which to trigger shift.

Definition at line 135 of file cyclical_buffer.h.

◆ setVolumeSize() [1/2]

void pcl::gpu::kinfuLS::CyclicalBuffer::setVolumeSize ( const double  size)
inline

Set the physical size represented by the default TSDF volume.

Parameters
[in]sizesize of the volume on all axis, in meters.

Definition at line 164 of file cyclical_buffer.h.

◆ setVolumeSize() [2/2]

void pcl::gpu::kinfuLS::CyclicalBuffer::setVolumeSize ( const double  size_x,
const double  size_y,
const double  size_z 
)
inline

Set the physical size represented by the default TSDF volume.

Parameters
[in]size_xsize of the volume on X axis, in meters.
[in]size_ysize of the volume on Y axis, in meters.
[in]size_zsize of the volume on Z axis, in meters.

Definition at line 154 of file cyclical_buffer.h.


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