20 template <
typename TargetPo
intCloud,
typename SourcePo
intCloud,
typename TargetTree,
typename CorrespondenceRejector,
typename Factor>
21 std::tuple<Eigen::Matrix<double, 6, 6>, Eigen::Matrix<double, 6, 1>,
double>
linearize(
22 const TargetPointCloud& target,
23 const SourcePointCloud& source,
24 const TargetTree& target_tree,
25 const CorrespondenceRejector& rejector,
26 const Eigen::Isometry3d& T,
27 std::vector<Factor>& factors)
const {
28 Eigen::Matrix<double, 6, 6> sum_H = Eigen::Matrix<double, 6, 6>::Zero();
29 Eigen::Matrix<double, 6, 1> sum_b = Eigen::Matrix<double, 6, 1>::Zero();
32 for (
size_t i = 0; i < factors.size(); i++) {
33 Eigen::Matrix<double, 6, 6> H;
34 Eigen::Matrix<double, 6, 1> b;
37 if (!factors[i].
linearize(target, source, target_tree, T, i, rejector, &H, &b, &e)) {
46 return {sum_H, sum_b, sum_e};
55 template <
typename TargetPo
intCloud,
typename SourcePo
intCloud,
typename Factor>
56 double error(
const TargetPointCloud& target,
const SourcePointCloud& source,
const Eigen::Isometry3d& T, std::vector<Factor>& factors)
const {
58 for (
size_t i = 0; i < factors.size(); i++) {
59 sum_e += factors[i].error(target, source, T);
Definition: flat_container.hpp:12
Single-thread reduction.
Definition: reduction.hpp:11
double error(const TargetPointCloud &target, const SourcePointCloud &source, const Eigen::Isometry3d &T, std::vector< Factor > &factors) const
Sum up evaluated errors.
Definition: reduction.hpp:56
std::tuple< Eigen::Matrix< double, 6, 6 >, Eigen::Matrix< double, 6, 1 >, double > linearize(const TargetPointCloud &target, const SourcePointCloud &source, const TargetTree &target_tree, const CorrespondenceRejector &rejector, const Eigen::Isometry3d &T, std::vector< Factor > &factors) const
Sum up linearized systems.
Definition: reduction.hpp:21