diff --git a/python/gtsam/__init__.py b/python/gtsam/__init__.py index 0493a252f..92c2d1f65 100644 --- a/python/gtsam/__init__.py +++ b/python/gtsam/__init__.py @@ -2,4 +2,4 @@ import registernumpyeigen import noiseModel import geometry import nonlinear - +import slam diff --git a/python/gtsam/slam/.gitignore b/python/gtsam/slam/.gitignore new file mode 100644 index 000000000..4fbe984da --- /dev/null +++ b/python/gtsam/slam/.gitignore @@ -0,0 +1 @@ +/libslam_python.so diff --git a/python/gtsam/slam/__init__.py b/python/gtsam/slam/__init__.py new file mode 100644 index 000000000..8c327e67f --- /dev/null +++ b/python/gtsam/slam/__init__.py @@ -0,0 +1 @@ +from libslam_python import * \ No newline at end of file diff --git a/python/handwritten/slam_python.cpp b/python/handwritten/slam_python.cpp new file mode 100644 index 000000000..f2c56cae4 --- /dev/null +++ b/python/handwritten/slam_python.cpp @@ -0,0 +1,52 @@ +/* ---------------------------------------------------------------------------- + + * 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 + + * -------------------------------------------------------------------------- */ + +/** + * @file slam_python.cpp + * @brief wraps slam classes into the slam submodule of gtsam python + * @author Ellon Paiva Mendes (LAAS-CNRS) + **/ + + /** TODOs Summary: + * + */ + +#include + +#include +#include +#include +#include +#include + +using namespace boost::python; +using namespace gtsam; + +// Prototypes used to perform overloading +// See: http://www.boost.org/doc/libs/1_59_0/libs/python/doc/tutorial/doc/html/python/functions.html + +// Macro used to define a BetweenFactor given the type. +#define BETWEENFACTOR(VALUE) \ + class_< BetweenFactor >("BetweenFactor"#VALUE) \ + .def(init()) \ + .def("measured", &BetweenFactor::measured, return_internal_reference<>()) \ +; + +BOOST_PYTHON_MODULE(libslam_python) +{ + + BETWEENFACTOR(Point3) + + BETWEENFACTOR(Rot3) + + BETWEENFACTOR(Pose3) + +} \ No newline at end of file