Loading...
Searching...
No Matches
pcl::gpu::kinfuLS::CyclicalBuffer Class Reference

CyclicalBuffer implements a cyclical TSDF buffer. More...

`#include </build/pcl-oe1NcQ/pcl-1.14.0+dfsg/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.
| 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.
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.
void | performShift (const TsdfVolume::Ptr volume, const pcl::PointXYZ &target_point, const bool last_shift=false)
| Perform shifting operations: Compute offsets.
void | setDistanceThreshold (const double threshold)
| Sets the distance threshold between cube's center and target point that triggers a shift.
float | getDistanceThreshold ()
| Returns the distance threshold between cube's center and target point that triggers a shift.
tsdf_buffer * | getBuffer ()
| get a pointer to the tsdf_buffer structure.
void | setVolumeSize (const double size_x, const double size_y, const double size_z)
| Set the physical size represented by the default TSDF volume.
void | setVolumeSize (const double size)
| Set the physical size represented by the default TSDF volume.
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.
void | initBuffer (TsdfVolume::Ptr tsdf_volume)
| Initializes memory pointers of the cyclical buffer (start, end, current origin)
void | resetBuffer (TsdfVolume::Ptr tsdf_volume)
| Reset buffer structure.
pcl::kinfuLS::WorldModel< pcl::PointXYZI > * | getWorldModel ()
| Return a pointer to the world model.

## 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_threshold | distance between cube center and target point at which we decide to shift.
  [in] | cube_size | physical size (in meters) of the volume (here, a cube) represented by the TSDF buffer.
  [in] | nb_voxels_per_axis | number 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_threshold | distance between cube center and target point at which we decide to shift.
  [in] | volume_size_x | physical size (in meters) of the volume, X axis.
  [in] | volume_size_y | physical size (in meters) of the volume, Y axis.
  [in] | volume_size_z | physical size (in meters) of the volume, Z axis.
  [in] | nb_voxels_x | number of voxels for X axis of the volume represented by the TSDF buffer.
  [in] | nb_voxels_y | number of voxels for Y axis of the volume represented by the TSDF buffer.
  [in] | nb_voxels_z | number 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] | volume | pointer to the TSDFVolume living in GPU
  [in] | cam_pose | global pose of the camera in the world
  [in] | distance_camera_target | distance from the camera's origin to the target point
  [in] | perform_shift | if set to false, shifting is not performed. The function will return true if shifting is needed.
  [in] | last_shift | if set to true, the whole cube will be shifted. This is used to push the whole cube to the world model.
  [in] | force_shift | if 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_point | the target point around which the new cube will be centered.
  [out] | shiftX | shift on X axis (in indices).
  [out] | shiftY | shift on Y axis (in indices).
  [out] | shiftZ | shift 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_volume | pointer 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] | volume | pointer to the TSDFVolume living in GPU
  [in] | target_point | target point around which the new cube will be centered
  [in] | last_shift | if 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_volume | pointer 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] | threshold | the 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] | size | size 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_x | size of the volume on X axis, in meters.
  [in] | size_y | size of the volume on Y axis, in meters.
  [in] | size_z | size 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:

- /build/pcl-oe1NcQ/pcl-1.14.0+dfsg/gpu/kinfu_large_scale/include/pcl/gpu/kinfu_large_scale/cyclical_buffer.h