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

Copy std-vector and std-map from Pinocchio #325

Merged
merged 34 commits into from
Dec 5, 2022
Merged

Copy std-vector and std-map from Pinocchio #325

merged 34 commits into from
Dec 5, 2022

Conversation

ManifoldFR
Copy link
Member

I recovered the history using git-filter-repo, squashed and rebased it into a single big commit before merging the files' history into eigenpy.

TODO

  • Include the utils/copyable.hpp header from Pinocchio
  • Include the relevant tests

Closes #324

@hrp2-14
Copy link

hrp2-14 commented Oct 4, 2022

Hi ! This project doesn't usually accept pull requests on the main branch.
If this wasn't intentionnal, you can change the base branch of this PR to devel
(No need to close it for that). Best, a bot.

@ManifoldFR ManifoldFR changed the base branch from master to devel October 4, 2022 14:43
@ManifoldFR ManifoldFR changed the title WIP: Move std-vector and std-map from Pinocchio WIP: Copy std-vector and std-map from Pinocchio Oct 4, 2022
@ManifoldFR ManifoldFR marked this pull request as ready for review October 4, 2022 17:04
Copy link
Contributor

@jcarpent jcarpent left a comment

Choose a reason for hiding this comment

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

@ManifoldFR Thanks a lot for this PR.
Could you remove aligned_vector, which is not useful to have I do think?

@ManifoldFR
Copy link
Member Author

@ManifoldFR Thanks a lot for this PR. Could you remove aligned_vector, which is not useful to have I do think?

Ok, will do so

@jcarpent jcarpent marked this pull request as draft November 14, 2022 08:34
@ManifoldFR
Copy link
Member Author

Rebased on devel.

@fabinsch
Copy link
Contributor

fabinsch commented Dec 5, 2022

Now it should be fixed. I will manually squash my commits and force push.

@ManifoldFR ManifoldFR changed the title WIP: Copy std-vector and std-map from Pinocchio Copy std-vector and std-map from Pinocchio Dec 5, 2022
@ManifoldFR ManifoldFR marked this pull request as ready for review December 5, 2022 14:53
jcarpent and others added 16 commits December 5, 2022 15:54
all: change __se3_* for __pinocchio_* for pragma once

all: change namespace from se3 to pinocchio

The previous se3 namespace is now deprecated but can still be used

all: remove license from files

[binding][std::map] Create Python visitors for std::map for aligned allocator. (and also for non-aligned maps, for the sake of completion)

[referenceConfigurations] review comments of @jcarpent on #666

[bindings][pickling] add support for vector<T> aligned_vector<T> map<T> pickling.
update model and data classes to make their members picklable

python: add converter from Python list to std::vector or aligned_vector

python: fix issue on GCC related to namespace bp

all: fix template issue

python/utils: factorization of the code

python/vector: add conversion tolist for std::vector

python/utils: return by reference when creating list

python/contact: fix doc

python/utils: handle std::vector for non const reference

python: add helpers to return Eigen object from std containers

python/utils: add return of the class for StdVector helpers

python: fix return type

core: fix merging issues

all: fix merging

python: make the code compliant for casadi bindings

python/utils: fix entry type for StdVectorPythonVisitor

python/utils: enhance API exposed for std::vector

python: add copy constructor and method to std::vector

python: expose operator{==,!=} for std::vector

Revert "python: expose operator{==,!=} for std::vector"

This reverts commit 6710dd4758791b3eee1ac444945e7f507aece7f6.

python/utils: update std-vector exposition

python: fix issues with const reference as input argument
Commits from downstream are rebased & squashed
(std-map) Fix include guard

* apply pre-commit formatting
* rename namespace
[Python] Introduce struct to expose both std::vector and aligned_vector

all: change __se3_* for __pinocchio_* for pragma once

all: change namespace from se3 to pinocchio

The previous se3 namespace is now deprecated but can still be used

all: remove license from files

[bindings][pickling] add support for vector<T> aligned_vector<T> map<T> pickling.
update model and data classes to make their members picklable

[bindings][pickling] 1) fix includes. make picklemap borrow from picklevector

2) use pickle support for rest of data and some more of model vectors

python: add converter from Python list to std::vector or aligned_vector

python: fix issue on GCC related to namespace bp

python: fix namespace issue

python/vector: add conversion tolist for std::vector

python/utils: return by reference when creating list

python/utils: add return of the class for StdVector helpers

python: fix return type

python/pickle: fix pickling of std::map

python: fix potential bug with C++11

python: make the code compliant for casadi bindings

python: fix arg name

python/pickle: fix compatibility issue

Compilation issues with recent version of Boost

python: add copy constructor and method to std::vector

python: expose operator{==,!=} for std::vector

Revert "python: expose operator{==,!=} for std::vector"

This reverts commit 6710dd4758791b3eee1ac444945e7f507aece7f6.

python/utils: update std-vector exposition

python: fix issues with const reference as input argument

python: fix pickling of Pinocchio data structure
* add test_std_vector.py
* fix copyable.hpp's include guards & namespace
* same for pickle-vector
* expose std::vector for VectorXd, MatrixXd, VectorXi, MatrixXi
* tests we can expose std::vector<Matrix3d>
* test input and returning std::vector<Matrix> objects
* test specific functions for specific dims
…trices

* bp::extract will construct an Eigen::Ref on the fly as an rvalue using the registered converter
* move overload_base_get_item_for_std_vector from pinocchio to here -- changes behaviour of __getitem__
* redef exposeStdVectorEigenSpecificType to overload the boost vector_indexing_suite __getitem__
* move exposeStdVectorEigenSpecificType to std-vector.hpp header
pre-commit-ci bot and others added 17 commits December 5, 2022 15:54
std-map/std-vector: add mention to file heading
…utput layout

eigen-allocator: try a fix for mutable Eigen::Ref from Python array with "wrong" layout

* trick transposes pyArray to get the right layout :)
* should take Eigen::Ref of const (to dispatch to proper EigenAllocator)
unittest/eigen_ref.cpp: asConstRef should take input as Ref<const T>
* fix includes
* comment out edge cases
remove useless include
remove comment between includes (not sorted by pre-commit anymore)

core/std-vector.hpp
* fix using-ctor for older cpp versions
* fix warning about conversion
@ManifoldFR ManifoldFR requested a review from jcarpent December 5, 2022 14:55
@jcarpent
Copy link
Contributor

jcarpent commented Dec 5, 2022

Nice work @ManifoldFR and @fabinsch. Thanks a lot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Proposal: port StdVectorPythonVisitor from Pinocchio's bindings
4 participants