5 #include <pcl/point_cloud.h>
6 #include <pcl/registration/registration.h>
14 template <
typename Po
intSource,
typename Po
intTarget>
15 class RegistrationPCL :
public pcl::Registration<PointSource, PointTarget, float> {
18 using Matrix4 =
typename pcl::Registration<PointSource, PointTarget, Scalar>::Matrix4;
20 using PointCloudSource =
typename pcl::Registration<PointSource, PointTarget, Scalar>::PointCloudSource;
24 using PointCloudTarget =
typename pcl::Registration<PointSource, PointTarget, Scalar>::PointCloudTarget;
28 using Ptr = pcl::shared_ptr<RegistrationPCL<PointSource, PointTarget>>;
29 using ConstPtr = pcl::shared_ptr<const RegistrationPCL<PointSource, PointTarget>>;
32 using pcl::Registration<PointSource, PointTarget, Scalar>::reg_name_;
33 using pcl::Registration<PointSource, PointTarget, Scalar>::input_;
34 using pcl::Registration<PointSource, PointTarget, Scalar>::target_;
35 using pcl::Registration<PointSource, PointTarget, Scalar>::corr_dist_threshold_;
37 using pcl::Registration<PointSource, PointTarget, Scalar>::nr_iterations_;
38 using pcl::Registration<PointSource, PointTarget, Scalar>::max_iterations_;
39 using pcl::Registration<PointSource, PointTarget, Scalar>::final_transformation_;
41 using pcl::Registration<PointSource, PointTarget, Scalar>::transformation_epsilon_;
42 using pcl::Registration<PointSource, PointTarget, Scalar>::converged_;
PCL registration interfaces.
Definition: pcl_registration.hpp:15
typename PointCloudTarget::Ptr PointCloudTargetPtr
Definition: pcl_registration.hpp:25
void setVoxelResolution(double r)
Set the voxel resolution for VGICP.
Definition: pcl_registration_impl.hpp:161
RegistrationPCL()
Definition: pcl_registration_impl.hpp:23
void setVerbosity(bool verbose)
Set the verbosity flag.
Definition: pcl_registration_impl.hpp:187
std::shared_ptr< KdTree< pcl::PointCloud< PointSource > > > source_tree_
KdTree for source point cloud.
Definition: pcl_registration.hpp:103
typename PointCloudSource::ConstPtr PointCloudSourceConstPtr
Definition: pcl_registration.hpp:22
typename pcl::Registration< PointSource, PointTarget, Scalar >::Matrix4 Matrix4
Definition: pcl_registration.hpp:18
bool verbose_
Verbosity flag.
Definition: pcl_registration.hpp:100
const std::vector< Eigen::Matrix4d > & getTargetCovariances() const
Get target point covariances.
Definition: pcl_registration_impl.hpp:104
std::shared_ptr< KdTree< pcl::PointCloud< PointSource > > > target_tree_
KdTree for target point cloud.
Definition: pcl_registration.hpp:102
double rotation_epsilon_
Rotation epsilon for convergence check.
Definition: pcl_registration.hpp:97
std::string registration_type_
Registration type ("GICP" or "VGICP").
Definition: pcl_registration.hpp:99
virtual ~RegistrationPCL()
Definition: pcl_registration_impl.hpp:38
const std::vector< Eigen::Matrix4d > & getSourceCovariances() const
Get source point covariances.
Definition: pcl_registration_impl.hpp:95
void setCorrespondenceRandomness(int k)
Set the number of neighbors for covariance estimation.
Definition: pcl_registration_impl.hpp:147
void setNumThreads(int n)
Set the number of threads to use.
Definition: pcl_registration_impl.hpp:137
void setSourceCovariances(const std::vector< Eigen::Matrix4d > &covs)
Set source point covariances.
Definition: pcl_registration_impl.hpp:65
typename pcl::Registration< PointSource, PointTarget, Scalar >::PointCloudSource PointCloudSource
Definition: pcl_registration.hpp:20
const Eigen::Matrix< double, 6, 6 > & getFinalHessian() const
Get the final Hessian matrix ([rx, ry, rz, tx, ty, tz]).
Definition: pcl_registration_impl.hpp:192
pcl::shared_ptr< const RegistrationPCL< PointSource, PointTarget > > ConstPtr
Definition: pcl_registration.hpp:29
std::vector< Eigen::Matrix4d > target_covs_
Covariances of target points.
Definition: pcl_registration.hpp:108
std::shared_ptr< GaussianVoxelMap > target_voxelmap_
VoxelMap for target point cloud.
Definition: pcl_registration.hpp:105
virtual void computeTransformation(PointCloudSource &output, const Matrix4 &guess) override
Definition: pcl_registration_impl.hpp:202
const RegistrationResult & getRegistrationResult() const
Get the detailed registration result.
Definition: pcl_registration_impl.hpp:197
void clearSource()
Clear source point cloud.
Definition: pcl_registration_impl.hpp:121
pcl::shared_ptr< RegistrationPCL< PointSource, PointTarget > > Ptr
Definition: pcl_registration.hpp:28
int num_threads_
Number of threads to use.
Definition: pcl_registration.hpp:95
std::shared_ptr< GaussianVoxelMap > source_voxelmap_
VoxelMap for source point cloud.
Definition: pcl_registration.hpp:106
void clearTarget()
Clear target point cloud.
Definition: pcl_registration_impl.hpp:129
RegistrationResult result_
Registration result.
Definition: pcl_registration.hpp:111
void setTargetCovariances(const std::vector< Eigen::Matrix4d > &covs)
Set target point covariances.
Definition: pcl_registration_impl.hpp:80
typename PointCloudTarget::ConstPtr PointCloudTargetConstPtr
Definition: pcl_registration.hpp:26
float Scalar
Definition: pcl_registration.hpp:17
int k_correspondences_
Number of neighbors for covariance estimation.
Definition: pcl_registration.hpp:96
typename PointCloudSource::Ptr PointCloudSourcePtr
Definition: pcl_registration.hpp:21
void swapSourceAndTarget()
Swap source and target point clouds and their augmented data (KdTrees, covariances,...
Definition: pcl_registration_impl.hpp:113
void setRegistrationType(const std::string &type)
Set registration type ("GICP" or "VGICP").
Definition: pcl_registration_impl.hpp:176
double voxel_resolution_
Voxel resolution for VGICP.
Definition: pcl_registration.hpp:98
std::vector< Eigen::Matrix4d > source_covs_
Covariances of source points.
Definition: pcl_registration.hpp:109
void setRotationEpsilon(double eps)
Set rotation epsilon for convergence check.
Definition: pcl_registration_impl.hpp:171
void setInputSource(const PointCloudSourceConstPtr &cloud) override
Set the input source (aligned) point cloud.
Definition: pcl_registration_impl.hpp:41
void setNumNeighborsForCovariance(int k)
Set the number of neighbors for covariance estimation.
Definition: pcl_registration_impl.hpp:152
void setInputTarget(const PointCloudTargetConstPtr &cloud) override
Set the input target (fixed) point cloud.
Definition: pcl_registration_impl.hpp:53
typename pcl::Registration< PointSource, PointTarget, Scalar >::PointCloudTarget PointCloudTarget
Definition: pcl_registration.hpp:24
Definition: flat_container.hpp:12
Registration result.
Definition: registration_result.hpp:11