43 #include <pcl/common/utils.h>
44 #include <pcl/filters/voxel_grid_covariance.h>
45 #include <pcl/registration/registration.h>
46 #include <pcl/memory.h>
47 #include <pcl/pcl_macros.h>
49 #include <unsupported/Eigen/NonLinearOptimization>
65 template <
typename Po
intSource,
typename Po
intTarget,
typename Scalar =
float>
67 :
public Registration<PointSource, PointTarget, Scalar> {
94 shared_ptr<NormalDistributionsTransform<PointSource, PointTarget, Scalar>>;
96 shared_ptr<const NormalDistributionsTransform<PointSource, PointTarget, Scalar>>;
97 using Vector3 =
typename Eigen::Matrix<Scalar, 3, 1>;
99 using Affine3 =
typename Eigen::Transform<Scalar, 3, Eigen::Affine>;
206 "The method `getTransformationProbability` has been renamed to "
207 "`getTransformationLikelihood`.")
245 trans = Eigen::Translation<Scalar, 3>(x.head<3>().cast<Scalar>()) *
246 Eigen::AngleAxis<Scalar>(static_cast<Scalar>(x(3)), Vector3::UnitX()) *
247 Eigen::AngleAxis<Scalar>(static_cast<Scalar>(x(4)), Vector3::UnitY()) *
248 Eigen::AngleAxis<Scalar>(static_cast<Scalar>(x(5)), Vector3::UnitZ());
261 trans = _affine.matrix();
277 transformation_rotation_epsilon_;
309 PCL_DEBUG(
"[pcl::%s::init] Computed voxel structure, got %zu voxels with valid "
310 "normal distributions.\n",
329 Eigen::Matrix<double, 6, 6>& hessian,
331 const Eigen::Matrix<double, 6, 1>& transform,
332 bool compute_hessian =
true);
349 Eigen::Matrix<double, 6, 6>& hessian,
350 const Eigen::Vector3d& x_trans,
351 const Eigen::Matrix3d& c_inv,
352 bool compute_hessian =
true)
const;
362 bool compute_hessian =
true);
392 PCL_DEPRECATED(1, 15,
"Parameter `transform` is not required")
396 const
Eigen::Matrix<
double, 6, 1>& transform)
413 const Eigen::Vector3d& x_trans,
414 const Eigen::Matrix3d& c_inv)
const;
447 Eigen::Matrix<double, 6, 1>& step_dir,
452 Eigen::Matrix<double, 6, 1>& score_gradient,
453 Eigen::Matrix<double, 6, 6>& hessian,
550 double a,
double f_a,
double f_0,
double g_0,
double mu = 1.e-4)
const
552 return f_a - f_0 - mu * g_0 * a;
570 return g_a - mu * g_0;
596 "`trans_probability_` has been renamed to `trans_likelihood_`.")
630 #include <pcl/registration/impl/ndt.hpp>
void filter(PointCloud &output, bool searchable=false)
Filter cloud and initializes voxel structure.
int nr_iterations_
The number of iterations the internal optimization ran for (used internally).
#define PCL_MAKE_ALIGNED_OPERATOR_NEW
Macro to signal a class requires a custom allocator.
Eigen::Matrix< Scalar, 4, 4 > Matrix4
virtual void setInputTarget(const PointCloudTargetConstPtr &cloud)
Provide a pointer to the input target (e.g., the point cloud that we want to align the input source t...
shared_ptr< ::pcl::PointIndices > Ptr
const std::string & getClassName() const
Abstract class get name method.
void ignore(const T &...)
Utility function to eliminate unused variable warnings.
PointCloudTargetConstPtr target_
The input point cloud dataset target.
PointCloudPtr getCentroids()
Get a pointcloud containing the voxel centroids.
Registration represents the base registration class for general purpose, ICP-like methods...
virtual void setInputCloud(const PointCloudConstPtr &cloud)
Provide a pointer to the input dataset.
shared_ptr< const ::pcl::PointIndices > ConstPtr
PointCloudConstPtr input_
The input point cloud dataset.
void setMinPointPerVoxel(int min_points_per_voxel)
Set the minimum number of points required for a cell to be used (must be 3 or greater for covariance ...
const Leaf * LeafConstPtr
Const pointer to VoxelGridCovariance leaf structure.
void setLeafSize(const Eigen::Vector4f &leaf_size)
Set the voxel grid leaf size.