diff --git a/python/handwritten/base/FastVector.cpp b/python/handwritten/base/FastVector.cpp new file mode 100644 index 000000000..1c3582813 --- /dev/null +++ b/python/handwritten/base/FastVector.cpp @@ -0,0 +1,37 @@ + /* ---------------------------------------------------------------------------- + + * 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 FastVector instances to python + * @author Ellon Paiva Mendes (LAAS-CNRS) + **/ + +#include +#include + +#define NO_IMPORT_ARRAY +#include + +#include "gtsam/base/FastVector.h" +#include "gtsam/base/types.h" // for Key definition + +using namespace boost::python; +using namespace gtsam; + +void exportFastVectors(){ + + typedef FastVector KeyVector; + + class_("KeyVector") + .def(vector_indexing_suite()) + ; + +} \ No newline at end of file diff --git a/python/handwritten/exportgtsam.cpp b/python/handwritten/exportgtsam.cpp index 0f4ee48b5..2802a779c 100644 --- a/python/handwritten/exportgtsam.cpp +++ b/python/handwritten/exportgtsam.cpp @@ -20,12 +20,8 @@ #include -#include -#include - -using namespace boost::python; -using namespace gtsam; -using namespace std; +// Base +void exportFastVectors(); // Geometry void exportPoint2(); @@ -68,6 +64,8 @@ BOOST_PYTHON_MODULE(libgtsam_python){ registerNumpyEigenConversions(); + exportFastVectors(); + exportPoint2(); exportPoint3(); exportRot2(); diff --git a/python/handwritten/nonlinear/Values.cpp b/python/handwritten/nonlinear/Values.cpp index 021cf019f..0302abbe2 100644 --- a/python/handwritten/nonlinear/Values.cpp +++ b/python/handwritten/nonlinear/Values.cpp @@ -107,5 +107,6 @@ void exportValues(){ .def("rot3_at", &Values::at, return_value_policy()) .def("pose3_at", &Values::at, return_value_policy()) .def("exists", exists1) + .def("keys", &Values::keys) ; } \ No newline at end of file