43 #include <pcl/common/utils.h>
44 #include <pcl/filters/voxel_grid_covariance.h>
45 #include <pcl/registration/registration.h>
49 #include <unsupported/Eigen/NonLinearOptimization>
74 template <
typename Po
intSource,
typename Po
intTarget,
typename Scalar =
float>
76 :
public Registration<PointSource, PointTarget, Scalar> {
103 shared_ptr<NormalDistributionsTransform<PointSource, PointTarget, Scalar>>;
105 shared_ptr<const NormalDistributionsTransform<PointSource, PointTarget, Scalar>>;
106 using Vector3 =
typename Eigen::Matrix<Scalar, 3, 1>;
108 using Affine3 =
typename Eigen::Transform<Scalar, 3, Eigen::Affine>;
196 search_method_ = method;
213 "The method `getOulierRatio` has been renamed to "
214 "`getOutlierRatio`.")
232 "The method `setOulierRatio` has been renamed to "
233 "`setOutlierRatio`.")
257 "The method `getTransformationProbability` has been renamed to "
258 "`getTransformationLikelihood`.")
296 trans = Eigen::Translation<Scalar, 3>(x.head<3>().cast<Scalar>()) *
297 Eigen::AngleAxis<Scalar>(
static_cast<Scalar
>(x(3)), Vector3::UnitX()) *
298 Eigen::AngleAxis<Scalar>(
static_cast<Scalar
>(x(4)), Vector3::UnitY()) *
299 Eigen::AngleAxis<Scalar>(
static_cast<Scalar
>(x(5)), Vector3::UnitZ());
312 trans = _affine.matrix();
360 PCL_DEBUG(
"[pcl::%s::init] Computed voxel structure, got %zu voxels with valid "
361 "normal distributions.\n",
380 Eigen::Matrix<double, 6, 6>& hessian,
382 const Eigen::Matrix<double, 6, 1>& transform,
383 bool compute_hessian =
true);
404 Eigen::Matrix<double, 6, 6>& hessian,
405 const Eigen::Vector3d& x_trans,
406 const Eigen::Matrix3d& c_inv,
407 const Eigen::Matrix<double, 3, 6>& point_jacobian,
408 const Eigen::Matrix<double, 18, 6>* point_hessian)
const;
426 Eigen::Matrix<double, 6, 6>& hessian,
427 const Eigen::Vector3d& x_trans,
428 const Eigen::Matrix3d& c_inv,
429 bool compute_hessian =
true)
const;
439 bool compute_hessian =
true);
453 Eigen::Matrix<double, 3, 6>& point_jacobian,
454 Eigen::Matrix<double, 18, 6>* point_hessian)
const;
493 const Eigen::Vector3d& x_trans,
494 const Eigen::Matrix3d& c_inv,
495 const Eigen::Matrix<double, 3, 6>& point_jacobian,
496 const Eigen::Matrix<double, 18, 6>& point_hessian)
const;
510 const Eigen::Vector3d& x_trans,
511 const Eigen::Matrix3d& c_inv)
const;
544 Eigen::Matrix<double, 6, 1>& step_dir,
549 Eigen::Matrix<double, 6, 1>& score_gradient,
550 Eigen::Matrix<double, 6, 6>& hessian,
647 double a,
double f_a,
double f_0,
double g_0,
double mu = 1.e-4)
const
649 return f_a - f_0 - mu * g_0 * a;
667 return g_a - mu * g_0;
693 "`trans_probability_` has been renamed to `trans_likelihood_`.")
724 unsigned int threads_{1};
734 #include <pcl/registration/impl/ndt.hpp>
virtual void setInputCloud(const PointCloudConstPtr &cloud)
Provide a pointer to the input dataset.
Registration represents the base registration class for general purpose, ICP-like methods.
const std::string & getClassName() const
Abstract class get name method.
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...
int nr_iterations_
The number of iterations the internal optimization ran for (used internally).
Eigen::Matrix< Scalar, 4, 4 > Matrix4
double transformation_rotation_epsilon_
The maximum rotation difference between two consecutive transformations in order to consider converge...
PointCloudTargetConstPtr target_
The input point cloud dataset target.
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 ...
void filter(PointCloud &output, bool searchable=false)
Filter cloud and initializes voxel structure.
const Leaf * LeafConstPtr
Const pointer to VoxelGridCovariance leaf structure.
PointCloudPtr getCentroids()
Get a pointcloud containing the voxel centroids.
void setLeafSize(const Eigen::Vector4f &leaf_size)
Set the voxel grid leaf size.
#define PCL_MAKE_ALIGNED_OPERATOR_NEW
Macro to signal a class requires a custom allocator.
Defines functions, macros and traits for allocating and using memory.
Defines all the PCL and non-PCL macros used.
#define PCL_DEPRECATED(Major, Minor, Message)
macro for compatibility across compilers and help remove old deprecated items for the Major....
shared_ptr< ::pcl::PointIndices > Ptr
shared_ptr< const ::pcl::PointIndices > ConstPtr