Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,6 @@
# Directories
.ipynb_checkpoints/*
**/build/*
example/__pycache__
example/__pycache__

**/.DS_Store
2 changes: 1 addition & 1 deletion python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ set_target_properties(
# can now access the wrapped module as an installed library.
add_custom_target(
python-install
COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_PY_MODULE_PATH}/setup.py install
COMMAND ${PYTHON_EXECUTABLE} -m pip install --user .
DEPENDS ${PROJECT_NAME}_py
WORKING_DIRECTORY ${PROJECT_PY_MODULE_PATH})

Expand Down
14 changes: 0 additions & 14 deletions wrapper/preamble/gtsam_example.h
Original file line number Diff line number Diff line change
@@ -1,15 +1 @@
/**
* This is a type caster for `boost::optional` so we can use optionals in Python.
*
* Example:
* In C++: void foo(boost::optional<Bar> &opt);
* In Python:
* - foo(None)
* - foo(bar_instance)
*/
#include <pybind11/stl.h>

namespace pybind11 { namespace detail {
template <typename T>
struct type_caster<boost::optional<T>> : optional_caster<boost::optional<T>> {};
}}
8 changes: 2 additions & 6 deletions wrapper/pybind_wrapper.tpl.example
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
{include_boost}

#include <pybind11/eigen.h>
#include <pybind11/stl_bind.h>
#include <pybind11/pybind11.h>
#include <pybind11/operators.h>
#include <pybind11/functional.h>
#include <pybind11/iostream.h>
#include <pybind11/functional.h>
#include "gtsam/base/serialization.h"
#include "gtsam/base/utilities.h" // for RedirectCout.

{includes}
#include <boost/serialization/export.hpp>

{boost_class_export}

{holder_type}

#include "gtsam_example/preamble/{module_name}.h"

using namespace std;
Expand Down
2 changes: 1 addition & 1 deletion wrapper/specializations/gtsam_example.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
// py::bind_vector<std::vector<gtsam::Key> >(m_, "KeyVector");
// py::bind_vector<std::vector<gtsam::Point2> >(m_, "Point2Vector");
// py::bind_vector<std::vector<gtsam::Pose3> >(m_, "Pose3Vector");
// py::bind_vector<std::vector<boost::shared_ptr<gtsam::BetweenFactor<gtsam::Pose3> > > >(m_, "BetweenFactorPose3s");
// py::bind_vector<std::vector<std::shared_ptr<gtsam::BetweenFactor<gtsam::Pose3> > > >(m_, "BetweenFactorPose3s");