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

Vector2, 3 and 4 with pybind11 #280

Merged
merged 32 commits into from
Dec 16, 2021
Merged

Vector2, 3 and 4 with pybind11 #280

merged 32 commits into from
Dec 16, 2021

Conversation

ahcorde
Copy link
Contributor

@ahcorde ahcorde commented Nov 5, 2021

Signed-off-by: ahcorde [email protected]

🎉 New feature

Summary

This is a draft PR tothat create wrappers for Vector2, 3 and 4 with pybind11

Checklist

  • Signed all commits for DCO
  • Added tests
  • Added example and/or tutorial
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • codecheck passed (See contributing)
  • All tests passed (See test coverage)
  • While waiting for a review on your PR, please help review another open pull request to support the maintainers

Note to maintainers: Remember to use Squash-Merge

@ahcorde ahcorde self-assigned this Nov 5, 2021
@github-actions github-actions bot added Gazebo 1️1️ Dependency of Gazebo classic version 11 🌱 garden Ignition Garden 🏢 edifice Ignition Edifice 🏯 fortress Ignition Fortress 🏰 citadel Ignition Citadel 🔮 dome Ignition Dome labels Nov 5, 2021
@chapulina chapulina added the scripting Scripting interfaces to Ignition label Nov 5, 2021
@ahcorde
Copy link
Contributor Author

ahcorde commented Nov 15, 2021

I made some changes:

  • I changed a little bit the ruby/CMakeLists.txt to avoid collisions with the pybind11 target.
  • I'm getting pybind11 with FetchContent. we will be always compiling the python interfaces, should I need to add a CMAKE flag ?
  • I installed the SWIG version in lib/python/swig/ to avoid collisions with the two versions

@ahcorde ahcorde marked this pull request as ready for review November 15, 2021 23:44
@ahcorde
Copy link
Contributor Author

ahcorde commented Nov 15, 2021

@scpeters or @chapulina this is ready for a initial review.

Signed-off-by: ahcorde <[email protected]>
Signed-off-by: ahcorde <[email protected]>
Signed-off-by: ahcorde <[email protected]>
Signed-off-by: ahcorde <[email protected]>
Signed-off-by: ahcorde <[email protected]>
Signed-off-by: ahcorde <[email protected]>
Signed-off-by: ahcorde <[email protected]>
@codecov
Copy link

codecov bot commented Nov 19, 2021

Codecov Report

Merging #280 (2f77fc0) into ign-math6 (af04dad) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           ign-math6     #280   +/-   ##
==========================================
  Coverage      99.65%   99.65%           
==========================================
  Files             67       67           
  Lines           6359     6359           
==========================================
  Hits            6337     6337           
  Misses            22       22           
Impacted Files Coverage Δ
include/ignition/math/Vector2.hh 100.00% <100.00%> (ø)
include/ignition/math/Vector3.hh 100.00% <100.00%> (ø)
include/ignition/math/Vector4.hh 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update af04dad...2f77fc0. Read the comment docs.

Signed-off-by: ahcorde <[email protected]>
Signed-off-by: ahcorde <[email protected]>
Signed-off-by: ahcorde <[email protected]>
Signed-off-by: ahcorde <[email protected]>
Signed-off-by: ahcorde <[email protected]>
src/python_pybind11/src/vector2.hh Outdated Show resolved Hide resolved
src/python_pybind11/src/Vector2.hh Outdated Show resolved Hide resolved
src/python_pybind11/src/Vector2.hh Outdated Show resolved Hide resolved
src/python_pybind11/src/Vector3.hh Outdated Show resolved Hide resolved
src/python_pybind11/src/Vector4.hh Outdated Show resolved Hide resolved
src/python_pybind11/src/Vector2.hh Outdated Show resolved Hide resolved
src/python_pybind11/src/Vector3.hh Outdated Show resolved Hide resolved
src/python_pybind11/src/Vector4.hh Outdated Show resolved Hide resolved
src/python_pybind11/test/Vector3_TEST.py Outdated Show resolved Hide resolved
Signed-off-by: ahcorde <[email protected]>
Signed-off-by: ahcorde <[email protected]>
Copy link
Member

@scpeters scpeters left a comment

Choose a reason for hiding this comment

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

just some minor comments related to comments and doc-strings, looks good!

"Return the absolute dot product of this vector and "
"another vector. This is similar to the Dot function, except the "
"absolute value of each component of the vector is used.")
.def("abs", &Class::Abs, " Get the absolute value of the vector")
Copy link
Member

Choose a reason for hiding this comment

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

nit: leading whitespace in doc-string

src/python_pybind11/src/Vector4.hh Show resolved Hide resolved
src/python_pybind11/src/Vector2.hh Outdated Show resolved Hide resolved
src/python_pybind11/CMakeLists.txt Outdated Show resolved Hide resolved
Signed-off-by: ahcorde <[email protected]>
Copy link
Member

@scpeters scpeters left a comment

Choose a reason for hiding this comment

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

looks great!

please edit the commit message when squash+merging, thanks!

@ahcorde ahcorde enabled auto-merge (squash) December 16, 2021 15:15
@chapulina chapulina dismissed their stale review December 16, 2021 16:37

comments addressed

@ahcorde ahcorde merged commit b399035 into ign-math6 Dec 16, 2021
@ahcorde ahcorde deleted the ahcorde/math/pybind11 branch December 16, 2021 16:37
scpeters added a commit to scpeters/ign-math that referenced this pull request Dec 22, 2021
Ccreated wrappers for Vector2, 3 and 4 with pybind11

Signed-off-by: ahcorde <[email protected]>

Co-authored-by: Steve Peters <[email protected]>
scpeters added a commit to scpeters/ign-math that referenced this pull request Jan 10, 2022
Ccreated wrappers for Vector2, 3 and 4 with pybind11

Signed-off-by: ahcorde <[email protected]>

Co-authored-by: Steve Peters <[email protected]>
scpeters added a commit that referenced this pull request Jan 10, 2022
Ccreated wrappers for Vector2, 3 and 4 with pybind11

Signed-off-by: ahcorde <[email protected]>

Co-authored-by: Steve Peters <[email protected]>
@osrf-triage
Copy link

This pull request has been mentioned on Gazebo Community. There might be relevant details there:

https://community.gazebosim.org/t/new-ignition-releases-2022-03-01-citadel-edifice-fortress/1313/1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏰 citadel Ignition Citadel 🔮 dome Ignition Dome 🏢 edifice Ignition Edifice 🏯 fortress Ignition Fortress 🌱 garden Ignition Garden Gazebo 1️1️ Dependency of Gazebo classic version 11 scripting Scripting interfaces to Ignition
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants