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_