29 #ifndef OCL_PROCESSING_HPP
30 #define OCL_PROCESSING_HPP
35 #include <CLUtils.hpp>
36 #include <GuidedFilter/algorithms.hpp>
37 #include <ICP/algorithms.hpp>
38 #include <eigen3/Eigen/Dense>
40 #include <octomap/octomap.h>
41 #include <octomap/OcTree.h>
58 void initGLMemObjects ();
75 template <ICP::ICPStepConfigT CR, ICP::ICPStepConfigW CW>
86 void registerPointCloud ();
88 void write (std::string filename = std::string (
"map.ot"));
90 void writeBinary (std::string filename = std::string (
"map.bt"));
97 void setSLAMStatus (
bool flag);
99 void toggleSLAMStatus ();
121 void setGFRGBRadius (
int radius) { gfRGBRadius = radius; gfRGB.setRadius (radius); }
125 void setGFRGBEps (
float eps) { gfRGBEps = eps; gfRGB.setEps (eps); }
129 void setGFDRadius (
int radius) { gfDRadius = radius; gfD.setRadius (radius); }
133 void setGFDEps (
float eps) { gfDEps = eps; gfD.setEps (eps); }
137 void setGFDScaling (
float scaling) { gfDScaling = scaling; gfD.setDScaling (scaling); }
155 void setICPMaxIterations (
unsigned int maxIter) { max_iterations = maxIter; icp.setMaxIterations (maxIter); }
197 unsigned int max_iterations;
198 double angle_threshold;
199 double translation_threshold;
202 volatile bool slamStatus;
203 volatile bool gfRGBStatus;
204 volatile bool gfDStatus;
205 volatile int rgbNorm;
207 size_t slamFuncHashCode;
215 clutils::CLEnvInfo<2> infoGF;
216 clutils::CLEnvInfo<1> infoRBC, infoICP, infoSLAM;
217 cl::Context &context;
218 cl::CommandQueue &queue0, &queue1;
223 cl::Buffer hBufferTg;
224 cl::Buffer hBufferRGB, hBufferD;
225 cl::Buffer dBufferRGB, dBufferD;
226 std::vector<cl::BufferGL> dBufferGL;
228 GF::Kinect::GuidedFilterRGB<GF::Kinect::GuidedFilterRGBConfig::SEPARATED> gfRGB;
229 GF::Kinect::GuidedFilterDepth gfD;
230 GF::SeparateRGB<GF::SeparateRGBConfig::UCHAR_FLOAT> sepRGB;
231 GF::Depth<GF::DepthConfig::USHORT_FLOAT> convD;
234 ICP::ICP<CR, CW> icp;
235 ICP::ICPTransform<ICP::ICPTransformConfig::QUATERNION> transform;
237 oclslam::SplitPC8D sp8DMap;
240 std::vector<cl::Event> waitListGL;
241 clutils::CPUTimer<double, std::milli> timer;
242 clutils::CPUTimer<double, std::milli> timerICP;
243 volatile double lICP;
246 octomap::point3d global_pos;
247 oclslam::PointCloud pc;
249 octomap::OcTree &
map;
253 #endif // OCL_PROCESSING_HPP
float getGFRGBEps()
Gets the variability threshold for the guided filter performed on the RGB frame. ...
Definition: ocl_processing.hpp:123
float getGFDEps()
Gets the variability threshold for the guided filter performed on the Depth frame.
Definition: ocl_processing.hpp:131
void setRGBNormalization(int flag)
Sets the status of the RGB normalization.
Definition: ocl_processing.hpp:115
void setGFDEps(float eps)
Sets the variability threshold for the guided filter performed on the Depth frame.
Definition: ocl_processing.hpp:133
Eigen::Vector3f t_g
Definition: ocl_processing.hpp:179
void setICPSScaling(float _c)
Sets the scaling applying to the deviations when computing matrix S in the ICP algorithm, for managing floating point arithmetic issues.
Definition: ocl_processing.hpp:151
const int width
Definition: glut_viewer.cpp:53
bool getSLAMStatus()
Gets the status of the automated SLAM process.
Definition: ocl_processing.hpp:95
void setGFDStatus(bool flag)
Sets the status of the Depth Guided Filter.
Definition: ocl_processing.hpp:109
int getRGBNormalization()
Gets the status of the RGB normalization.
Definition: ocl_processing.hpp:113
void setICPTranslationThreshold(double tt)
Sets the translation threshold (in mm) for the convergence check of the ICP.
Definition: ocl_processing.hpp:163
Declares classes that enhance the default octomap::Pointcloud.
void setICPAngleThreshold(double at)
Sets the angle threshold (in degrees) for the convergence check of the ICP.
Definition: ocl_processing.hpp:159
Declares classes that organize the execution of OpenCL kernels.
float getGFDScaling()
Gets the scaling applied to the depth frame for processing with the guided filter.
Definition: ocl_processing.hpp:135
void setGFRGBEps(float eps)
Sets the variability threshold for the guided filter performed on the RGB frame. ...
Definition: ocl_processing.hpp:125
void setSensorFocalLength(float f)
Sets the sensor's focal length.
Definition: ocl_processing.hpp:141
Offers classes which set up kernel execution parameters and provide interfaces for the handling of me...
Definition: algorithms.hpp:45
unsigned int getICPMaxIterations()
Gets the maximum number of iterations considered for an ICP registration.
Definition: ocl_processing.hpp:153
void setGFDScaling(float scaling)
Sets the scaling applied to the depth frame for processing with the guided filter.
Definition: ocl_processing.hpp:137
int getGFDRadius()
Gets the window radius for the guided filter performed on the Depth frame.
Definition: ocl_processing.hpp:127
int getGFRGBRadius()
Gets the window radius for the guided filter performed on the RGB frame.
Definition: ocl_processing.hpp:119
void toggleGFDStatus()
Toggles the status of the Depth Guided Filter.
Definition: ocl_processing.hpp:111
double getICPAngleThreshold()
Gets the angle threshold (in degrees) for the convergence check of the ICP.
Definition: ocl_processing.hpp:157
void setGFRGBStatus(bool flag)
Sets the status of the RGB Guided Filter.
Definition: ocl_processing.hpp:103
void setRBCAlpha(float _a)
Sets the parameter used in the distance function for the RBC data structure.
Definition: ocl_processing.hpp:145
volatile int timeStep
Definition: ocl_processing.hpp:171
float getICPSScaling()
Gets the scaling applying to the deviations when computing matrix S in the ICP algorithm, for managing floating point arithmetic issues.
Definition: ocl_processing.hpp:148
const int height
Definition: glut_viewer.cpp:54
Eigen::Matrix3f R_g
Definition: ocl_processing.hpp:174
Eigen::Quaternionf q_g
Definition: ocl_processing.hpp:176
void toggleRGBNormalization()
Toggles the status of the RGB normalization.
Definition: ocl_processing.hpp:117
A class that extends Freenect::FreenectDevice by defining the VideoCallback and DepthCallback functio...
Definition: freenect_rgbd.hpp:46
Creates an OpenCL environment with CL-GL interoperability.
Definition: ocl_processing.hpp:50
float getRBCAlpha()
Gets the parameter used in the distance function for the RBC data structure.
Definition: ocl_processing.hpp:143
Interface class for the SLAM pipeline.
Definition: ocl_processing.hpp:76
void setGFDRadius(int radius)
Sets the window radius for the guided filter performed on the Depth frame.
Definition: ocl_processing.hpp:129
Kinect * kinect
Definition: slam.cpp:46
float getSensorFocalLength()
Gets the sensor's focal length.
Definition: ocl_processing.hpp:139
Declares classes necessary for setting up the freenect library.
std::function< void()> slam
Performs the SLAM process.
Definition: ocl_processing.hpp:169
void toggleGFRGBStatus()
Toggles the status of the RGB Guided Filter.
Definition: ocl_processing.hpp:105
void setICPMaxIterations(unsigned int maxIter)
Sets the maximum number of iterations considered for an ICP registration.
Definition: ocl_processing.hpp:155
bool getGFDStatus()
Gets the status of the Depth Guided Filter.
Definition: ocl_processing.hpp:107
void setGFRGBRadius(int radius)
Sets the window radius for the guided filter performed on the RGB frame.
Definition: ocl_processing.hpp:121
double getICPTranslationThreshold()
Gets the translation threshold (in mm) for the convergence check of the ICP.
Definition: ocl_processing.hpp:161
bool getGFRGBStatus()
Gets the status of the RGB Guided Filter.
Definition: ocl_processing.hpp:101
cl_float s_g
Definition: ocl_processing.hpp:181