From 832ef7725bd2ce0aacd1b2e570614a77a5ec59cf Mon Sep 17 00:00:00 2001 From: Varun Agrawal Date: Wed, 25 Sep 2024 11:28:38 -0400 Subject: [PATCH] wrap TriangulationFactor --- gtsam/slam/slam.i | 43 +++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 41 insertions(+), 2 deletions(-) diff --git a/gtsam/slam/slam.i b/gtsam/slam/slam.i index f054aaab42..97dcfcae7b 100644 --- a/gtsam/slam/slam.i +++ b/gtsam/slam/slam.i @@ -347,11 +347,50 @@ virtual class FrobeniusBetweenFactor : gtsam::NoiseModelFactor { gtsam::Vector evaluateError(const T& R1, const T& R2); }; - + +#include +template +virtual class TriangulationFactor : gtsam::NoiseModelFactor { + TriangulationFactor(); + TriangulationFactor(const CAMERA& camera, const gtsam::This::Measurement& measured, + const gtsam::noiseModel::Base* model, gtsam::Key pointKey, + bool throwCheirality = false, + bool verboseCheirality = false); + + void print(const string& s = "", const gtsam::KeyFormatter& keyFormatter = + gtsam::DefaultKeyFormatter) const; + bool equals(const This& p, double tol = 1e-9) const; + + gtsam::Vector evaluateError(const gtsam::Point3& point) const; + + const gtsam::This::Measurement& measured() const; +}; +typedef gtsam::TriangulationFactor> + TriangulationFactorCal3_S2; +typedef gtsam::TriangulationFactor> + TriangulationFactorCal3DS2; +typedef gtsam::TriangulationFactor> + TriangulationFactorCal3Bundler; +typedef gtsam::TriangulationFactor> + TriangulationFactorCal3Fisheye; +typedef gtsam::TriangulationFactor> + TriangulationFactorCal3Unified; + +typedef gtsam::TriangulationFactor> + TriangulationFactorPoseCal3_S2; +typedef gtsam::TriangulationFactor> + TriangulationFactorPoseCal3DS2; +typedef gtsam::TriangulationFactor> + TriangulationFactorPoseCal3Bundler; +typedef gtsam::TriangulationFactor> + TriangulationFactorPoseCal3Fisheye; +typedef gtsam::TriangulationFactor> + TriangulationFactorPoseCal3Unified; + #include namespace lago { gtsam::Values initialize(const gtsam::NonlinearFactorGraph& graph, bool useOdometricPath = true); gtsam::Values initialize(const gtsam::NonlinearFactorGraph& graph, const gtsam::Values& initialGuess); } - + } // namespace gtsam