15 #include <mrpt/poses/Lie/SE.h>
19 using namespace mrpt::poses::Lie;
31 pp.ln_global = mrpt::math::TLine3D::FromTwoPoints({0, 0, 0}, {1, 0, 0});
32 pp.pt_local = groundTruth.inverseComposePoint({0.5, 0, 0});
35 auto& pp = p.paired_pt2ln.emplace_back();
36 pp.ln_global = mrpt::math::TLine3D::FromTwoPoints({0, 0, 0}, {0, 1, 0});
37 pp.pt_local = groundTruth.inverseComposePoint({0, 0.4, 0});
40 auto& pp = p.paired_pt2ln.emplace_back();
41 pp.ln_global = mrpt::math::TLine3D::FromTwoPoints({0, 0, 0}, {0, 0, 1});
42 pp.pt_local = groundTruth.inverseComposePoint({0, 0, 0.2});
45 std::cout <<
"Input pairings: " << p.contents_summary() << std::endl;
50 mrpt::containers::yaml solverParams;
51 solverParams[
"maxIterations"] = 25;
52 solverParams[
"innerLoopVerbose"] =
true;
62 std::cout <<
"Found optimalPose: " << result.
optimalPose << std::endl;
63 std::cout <<
"Expected optimalPose: " << groundTruth << std::endl;
66 mrpt::poses::Lie::SE<3>::log(result.
optimalPose - groundTruth).norm(),
75 int main([[maybe_unused]]
int argc, [[maybe_unused]]
char** argv)
77 using mrpt::poses::CPose3D;
92 test_opt_pt2ln(CPose3D::FromYawPitchRoll(20.0_deg, 0.0_deg, 0.0_deg));
93 test_opt_pt2ln(CPose3D::FromYawPitchRoll(-20.0_deg, 0.0_deg, 0.0_deg));
95 test_opt_pt2ln(CPose3D::FromYawPitchRoll(0.0_deg, 10.0_deg, 0.0_deg));
96 test_opt_pt2ln(CPose3D::FromYawPitchRoll(0.0_deg, -10.0_deg, 0.0_deg));
98 test_opt_pt2ln(CPose3D::FromYawPitchRoll(0.0_deg, 0.0_deg, 15.0_deg));
99 test_opt_pt2ln(CPose3D::FromYawPitchRoll(0.0_deg, 0.0_deg, -15.0_deg));
103 1.0, 2.0, 3.0, -10.0_deg, 5.0_deg, 30.0_deg));
105 catch (std::exception& e)
107 std::cerr << mrpt::exception_to_str(e) <<
"\n";