6 #include <Eigen/Geometry>
25 const double e_abs = std::abs(e);
26 return e_abs <
c ? 1.0 :
c / e_abs;
47 double weight(
double e)
const {
return c / (
c + e * e); }
56 template <
typename Kernel,
typename Factor>
69 template <
typename TargetPo
intCloud,
typename SourcePo
intCloud,
typename TargetTree,
typename CorrespondenceRejector>
71 const TargetPointCloud& target,
72 const SourcePointCloud& source,
73 const TargetTree& target_tree,
74 const Eigen::Isometry3d& T,
76 const CorrespondenceRejector& rejector,
77 Eigen::Matrix<double, 6, 6>* H,
78 Eigen::Matrix<double, 6, 1>* b,
80 if (!
factor.linearize(target, source, target_tree, T, source_index, rejector, H, b, e)) {
94 template <
typename TargetPo
intCloud,
typename SourcePo
intCloud>
95 double error(
const TargetPointCloud& target,
const SourcePointCloud& source,
const Eigen::Isometry3d& T)
const {
96 const double e =
factor.error(target, source, T);
Definition: flat_container.hpp:12
Huber robust kernel setting.
Definition: robust_kernel.hpp:37
double c
Kernel width.
Definition: robust_kernel.hpp:38
Cauchy robust kernel.
Definition: robust_kernel.hpp:34
const double c
Kernel width.
Definition: robust_kernel.hpp:50
double weight(double e) const
Compute the weight for an error.
Definition: robust_kernel.hpp:47
Cauchy(const Setting &setting)
Constructor.
Definition: robust_kernel.hpp:42
Huber robust kernel setting.
Definition: robust_kernel.hpp:14
double c
Kernel width.
Definition: robust_kernel.hpp:15
Huber robust kernel.
Definition: robust_kernel.hpp:11
Huber(const Setting &setting)
Constructor.
Definition: robust_kernel.hpp:19
double weight(double e) const
Compute the weight for an error.
Definition: robust_kernel.hpp:24
const double c
Kernel width.
Definition: robust_kernel.hpp:30
Robust factor setting.
Definition: robust_kernel.hpp:60
Kernel::Setting robust_kernel
Robust kernel setting.
Definition: robust_kernel.hpp:61
Factor::Setting factor
Factor setting.
Definition: robust_kernel.hpp:62
Robustify a factor with a robust kernel.
Definition: robust_kernel.hpp:57
bool inlier() const
Check if the factor is inlier.
Definition: robust_kernel.hpp:101
bool linearize(const TargetPointCloud &target, const SourcePointCloud &source, const TargetTree &target_tree, const Eigen::Isometry3d &T, size_t source_index, const CorrespondenceRejector &rejector, Eigen::Matrix< double, 6, 6 > *H, Eigen::Matrix< double, 6, 1 > *b, double *e)
Linearize the factor.
Definition: robust_kernel.hpp:70
double error(const TargetPointCloud &target, const SourcePointCloud &source, const Eigen::Isometry3d &T) const
Evaluate error.
Definition: robust_kernel.hpp:95
Factor factor
Factor.
Definition: robust_kernel.hpp:105
RobustFactor(const Setting &setting=Setting())
Constructor.
Definition: robust_kernel.hpp:66
Kernel robust_kernel
Robust kernel.
Definition: robust_kernel.hpp:104