39 #ifndef PCL_CYCLICAL_BUFFER_IMPL_H_ 40 #define PCL_CYCLICAL_BUFFER_IMPL_H_ 43 #include <pcl/gpu/kinfu_large_scale/tsdf_volume.h> 44 #include <pcl/gpu/kinfu_large_scale/tsdf_buffer.h> 47 #include <cuda_runtime.h> 48 #include <pcl/gpu/kinfu_large_scale/point_intensity.h> 50 #include <pcl/gpu/kinfu_large_scale/world_model.h> 53 #include <pcl/io/pcd_io.h> 75 CyclicalBuffer (
const double distance_threshold,
const double cube_size = 3.f,
const int nb_voxels_per_axis = 512)
77 distance_threshold_ = distance_threshold;
78 buffer_.volume_size.x = cube_size;
79 buffer_.volume_size.y = cube_size;
80 buffer_.volume_size.z = cube_size;
81 buffer_.voxels_size.x = nb_voxels_per_axis;
82 buffer_.voxels_size.y = nb_voxels_per_axis;
83 buffer_.voxels_size.z = nb_voxels_per_axis;
96 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)
98 distance_threshold_ = distance_threshold;
99 buffer_.volume_size.x = volume_size_x;
100 buffer_.volume_size.y = volume_size_y;
101 buffer_.volume_size.z = volume_size_z;
102 buffer_.voxels_size.x = nb_voxels_x;
103 buffer_.voxels_size.y = nb_voxels_y;
104 buffer_.voxels_size.z = nb_voxels_z;
118 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);
139 distance_threshold_ = threshold;
156 void setVolumeSize (
const double size_x,
const double size_y,
const double size_z)
158 buffer_.volume_size.x = size_x;
159 buffer_.volume_size.y = size_y;
160 buffer_.volume_size.z = size_z;
168 buffer_.volume_size.x = size;
169 buffer_.volume_size.y = size;
170 buffer_.volume_size.z = size;
179 void computeAndSetNewCubeMetricOrigin (
const pcl::PointXYZ &target_point,
int &shiftX,
int &shiftY,
int &shiftZ);
188 buffer_.tsdf_memory_start = &(localVolume.
ptr (0)[0]);
189 buffer_.tsdf_memory_end = &(localVolume.
ptr (buffer_.voxels_size.y * (buffer_.voxels_size.z - 1) + (buffer_.voxels_size.y - 1) )[buffer_.voxels_size.x - 1]);
190 buffer_.tsdf_rolling_buff_origin = buffer_.tsdf_memory_start;
198 buffer_.origin_GRID.x = 0; buffer_.origin_GRID.y = 0; buffer_.origin_GRID.z = 0;
199 buffer_.origin_GRID_global.x = 0.f; buffer_.origin_GRID_global.y = 0.f; buffer_.origin_GRID_global.z = 0.f;
200 buffer_.origin_metric.x = 0.f; buffer_.origin_metric.y = 0.f; buffer_.origin_metric.z = 0.f;
201 initBuffer (tsdf_volume);
209 return (&world_model_);
222 double distance_threshold_;
236 void shiftOrigin (
TsdfVolume::Ptr tsdf_volume,
const int offset_x,
const int offset_y,
const int offset_z)
274 #endif // PCL_CYCLICAL_BUFFER_IMPL_H_ short2 * tsdf_memory_start
Address of the first element of the TSDF volume in memory.
Structure to handle buffer addresses.
void setVolumeSize(const double size_x, const double size_y, const double size_z)
Set the physical size represented by the default TSDF volume.
float getDistanceThreshold()
Returns the distance threshold between cube's center and target point that triggers a shift.
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.
short2 * tsdf_memory_end
Address of the last element of the TSDF volume in memory.
Defines all the PCL implemented PointT point type structures.
A point structure representing Euclidean xyz coordinates.
void setDistanceThreshold(const double threshold)
Sets the distance threshold between cube's center and target point that triggers a shift.
boost::shared_ptr< TsdfVolume > Ptr
CyclicalBuffer(const double distance_threshold, const double cube_size=3.f, const int nb_voxels_per_axis=512)
Constructor for a cubic CyclicalBuffer.
void initBuffer(TsdfVolume::Ptr tsdf_volume)
Initializes memory pointers of the cyclical buffer (start, end, current origin)
pcl::kinfuLS::WorldModel< pcl::PointXYZI > * getWorldModel()
Return a pointer to the world model.
void resetBuffer(TsdfVolume::Ptr tsdf_volume)
Reset buffer structure.
void setVolumeSize(const double size)
Set the physical size represented by the default TSDF volume.
int3 origin_GRID
Internal cube origin for rollign buffer.
short2 * tsdf_rolling_buff_origin
Memory address of the origin of the rolling buffer.
int3 voxels_size
Number of voxels in the volume, per axis.
__PCL_GPU_HOST_DEVICE__ T * ptr(int y=0)
tsdf_buffer * getBuffer()
get a pointer to the tsdf_buffer structure.
CyclicalBuffer implements a cyclical TSDF buffer.
float3 origin_GRID_global
Cube origin in world coordinates.