Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Python bindings #201

Merged
merged 5 commits into from
Feb 14, 2021
Merged

Add Python bindings #201

merged 5 commits into from
Feb 14, 2021

Conversation

artivis
Copy link
Owner

@artivis artivis commented Feb 13, 2021

manifpy

Add Python bindings to manif.

Install,

sudo apt install -y libeigen3-dev cmake build-essential python3-pip
python3 -m pip install --upgrade pip
python3 -m pip install pytest "pybind11[global]"
cd manif/
python3 -m pip install -r requirements.txt
python3 -m pip install .

Test,

cd manif/
pytest

Use,

from manifpy import SE3

state = SE3.Identity()
...

Note

rjacinv/ljacinv

The functions rjacinv/ljacinv are not exposed at the moment. They are too complicated to wrap for little benefit.
This will be fixed in the future after the internal API redesign (see e.g. #150).

Eigen/Geometry-related API

The C++ API related to Eigen/Geometry is not exposed. The rational is that this API only exists as a convenience to interface with existing classes in Eigen (Quaternion/Transform etc).
The Eigen counterpart in Python is numpy which does not have such classes. We could wrap the Eigen objects to expose them to Python but that does not have much interest since they wont play nice with numpy unless we put some extra effort.
At the moment this seems to be too much for the little outcome, especially since the different examples (*_localization / *_sam) were ported without issues.

For this reason this will be left to future work or contribution.

Todo list

Bindings:

  • manif group-base API
  • manif tangent-base API
    • missing rjacinv/ljacinv
  • group specific API
    • missing Eigen/Geometry-related
  • port common test suite to python
  • port group specific tests to python (partially done)

Misc:

  • python packaging
  • documentation
    • Python doc generation
    • unified manif website
    • automatic doc update in CI
  • examples
    • se2_localization
    • se3_localization
    • se2_sam
    • se3_sam
    • se3_sam_selfcalib
    • se2_3_localization

Cleanup version of #179

Comes after #200
Closes #187

@artivis artivis added the enhancement New feature or request label Feb 13, 2021
@artivis artivis self-assigned this Feb 13, 2021
@artivis artivis mentioned this pull request Feb 13, 2021
17 tasks
@artivis
Copy link
Owner Author

artivis commented Feb 13, 2021

See #179 for discussion backlogs.

Copy link
Collaborator

@joansola joansola left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Working on MacOSX.

Great work!

How can I execute the python examples? I´d like to see them running before approving

@codecov
Copy link

codecov bot commented Feb 13, 2021

Codecov Report

Merging #201 (9beafaf) into devel (6e8441b) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##            devel     #201   +/-   ##
=======================================
  Coverage   98.40%   98.40%           
=======================================
  Files          51       51           
  Lines        1506     1506           
=======================================
  Hits         1482     1482           
  Misses         24       24           

@artivis
Copy link
Owner Author

artivis commented Feb 13, 2021

How can I execute the python examples? I´d like to see them running before approving

First you need to install manifpy is not already done (see the PR description), then you can execute them as plain Python script, e.g.

cd manif/examples
python3 se3_localization.py

Copy link
Collaborator

@joansola joansola left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Examples checked and working. Approving with congrats

@artivis
Copy link
Owner Author

artivis commented Feb 13, 2021

Post-approval update:

  • rebased on devel
  • update c++ doc to include freshly merged UKF-M example

@artivis artivis merged commit fb4f422 into devel Feb 14, 2021
@artivis artivis deleted the feature/python branch February 14, 2021 18:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Python Bindings discussion
2 participants