/* ---------------------------------------------------------------------------- * GTSAM Copyright 2010, Georgia Tech Research Corporation, * Atlanta, Georgia 30332-0415 * All Rights Reserved * Authors: Frank Dellaert, et al. (see THANKS for the full author list) * See LICENSE for the license information * -------------------------------------------------------------------------- */ /** * @brief wraps GenericProjectionFactor for several values to python * @author Ellon Paiva Mendes (LAAS-CNRS) **/ #include #define NO_IMPORT_ARRAY #include #include "gtsam/slam/ProjectionFactor.h" #include "gtsam/geometry/Pose3.h" #include "gtsam/geometry/Point3.h" #include "gtsam/geometry/Cal3_S2.h" using namespace boost::python; using namespace gtsam; using namespace std; typedef GenericProjectionFactor GenericProjectionFactorCal3_S2; BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(print_overloads, GenericProjectionFactorCal3_S2::print, 0, 1) BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(equals_overloads, GenericProjectionFactorCal3_S2::equals, 1, 2) BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(evaluateError_overloads, GenericProjectionFactorCal3_S2::evaluateError, 2, 4) void exportGenericProjectionFactor() { class_ >("GenericProjectionFactorCal3_S2", init<>()) .def(init &, optional >()) .def(init &, bool, bool, optional >()) .def("print", &GenericProjectionFactorCal3_S2::print, print_overloads(args("s"))) .def("equals", &GenericProjectionFactorCal3_S2::equals, equals_overloads(args("q","tol"))) .def("evaluate_error", &GenericProjectionFactorCal3_S2::evaluateError, evaluateError_overloads()) .def("measured", &GenericProjectionFactorCal3_S2::measured, return_value_policy()) // TODO(Ellon): Find the right return policy when returning a 'const shared_ptr<...> &' // .def("calibration", &GenericProjectionFactorCal3_S2::calibration, return_value_policy()) .def("verbose_cheirality", &GenericProjectionFactorCal3_S2::verboseCheirality) .def("throw_cheirality", &GenericProjectionFactorCal3_S2::throwCheirality) ; }