Commit Graph

226 Commits (b30448733c66ec8194fa49e376834b1f4eb711d3)

Author SHA1 Message Date
Ellon Mendes 05f6237f71 Define NO_IMPORT_ARRAY in all cpp files before including NumpyEigenConverter.hpp
This fixes the segmentation fault when converting numpy and Eigen.

The reason is that NumpyEigenConverter.hpp includes numpy/arrayobject.h, and for
the numpy's C-API to work in multiple files we need to define NO_IMPORT_ARRAY
before including numpy/arrayobject.h in all the source files but the one that
defines the module initialization (exportgtsam.cpp in out case), as explained
here:
http://docs.scipy.org/doc/numpy/reference/c-api.array.html#importing-the-api

Note that PY_ARRAY_UNIQUE_SYMBOL, also needed to work multifile, is already
defined on NumpyEigenConverter.hpp.
2015-12-02 13:35:15 +01:00
Ellon Mendes c140a784fe Add constness to matrices and vectors 2015-12-02 13:35:15 +01:00
Ellon Mendes d76ed71c99 Move my developments to the handwritten structure of files that existed before
There's a problem with numpy_eigen causing a segmentation fault.
2015-12-02 13:35:15 +01:00
Ellon Mendes ffae37a675 Revert python module to use old handwritten files
Just noticed several handwritten files here. I'm reverting the python module to
use these handwritten files to later add the files I was wrapping to the same
framework.

Classes from geometry were wrapped for an old C++ interface, so several
boost python's .def(...) were commented out.

Conflicts:
	python/gtsam/.gitignore
2015-12-02 13:35:15 +01:00
Ellon Mendes 7680b533ac Wrap basic functions of NonlinearFactorGraph and ISAM2
While here, change method names for python convention on PEP0008
2015-12-02 13:35:15 +01:00
Ellon Mendes b10f7386c5 Wrap prior factors 2015-12-02 13:35:15 +01:00
Ellon Mendes 72a800f70f Add inheritance to from NonlinearFactor to BetweenFactor.
Nonlinear factor is pure virtual, so we need to declare a wrapper, even
if we don't export anything from it.

Also, we don't make explicit all the chain of inheritance from BetweenFactor,
since it looks like exporting inheritance directly from NonlinearFactor allows
adding it to NonlinearFactorGraph.
2015-12-02 13:35:15 +01:00
Ellon Mendes 828b230e17 Add overloads for named constructors on noiseModel module 2015-12-02 13:35:15 +01:00
Ellon Mendes 9a97248ee4 Put classes in namespaces close to gtsam's C++ interface 2015-12-02 13:35:15 +01:00
Ellon Mendes 6684f69d0a Fix inheritance problem on python wrapping of noise models 2015-12-02 13:35:15 +01:00
Ellon Mendes 72d73c6721 Add slam as submodule of gtsam python module 2015-12-02 13:35:15 +01:00
Ellon Mendes e0b8d87695 Wrap Values::insert and Values::at for Point3, Rot3, and Pose3 2015-12-02 13:35:15 +01:00
Ellon Mendes 7cfd57339a Add nonlinear submodule of gtsam python module 2015-12-02 13:35:15 +01:00
Ellon Mendes ff1cd140bb Register convertion between numpy and eigen in a separated submodule 2015-12-02 13:35:14 +01:00
Ellon Mendes a0064f3aab Add geometry submodule of python module 2015-12-02 13:35:14 +01:00
Ellon Mendes 977d4aa54f Add 'bases' for noiseModel classes
While here, add comments and TODOs
2015-12-02 13:35:14 +01:00
Ellon Mendes 96d6b79f5e Start organizing python module
Organize gtsam modules into submodules. Start with a handwritten noiseModel
module.

Conflicts:
	CMakeLists.txt
2015-12-02 13:35:14 +01:00
Andrew Melim 6a34fa0a22 Markdown readme 2015-12-02 13:35:14 +01:00
Andrew Melim dca285a9d8 Remove library 2015-12-02 13:35:14 +01:00
Andrew Melim 20f5c46507 Reworked python directory structure. Added readme on constructing python module. Added first unit test for point2. Everything needed to get it passing is also here, including some renaming of variables and emitted library names
Conflicts:
	cmake/GtsamPythonWrap.cmake
	python/handwritten/examples/OdometeryExample.py
	wrap/Module.cpp
2015-12-02 13:35:14 +01:00
Andrew Melim 4e00f70e82 Updating cmake build 2015-12-02 13:35:14 +01:00
Andrew Melim def2f1a91c Installation script for python Distutils for python package. Installs to default python dist-packages location call : python setup.py install 2015-12-02 13:35:14 +01:00
Andrew Melim 414e6b58f9 Finally fixed templates, moved into single library for simplicity, add noisemodels, nonlinear 2015-12-02 13:35:14 +01:00
Andrew Melim d0efbadac8 Example on how to wrap templated classes such as factors 2015-12-02 13:35:14 +01:00
Andrew Melim 2455780829 Rot2, Pose2, Point2 now all work fairly well in Python. See Pose2.cpp for examples on method overloading and auto-declarations 2015-12-02 13:35:14 +01:00
Andrew Melim ec934770f3 Initial stages of python wrapping. Issues with method overloading, boost optionals. Testing with Point2 only now 2015-12-02 13:35:13 +01:00