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

Pose3: deprecate + operator in favor of * #381

Merged
merged 3 commits into from
Mar 28, 2022

Conversation

scpeters
Copy link
Member

@scpeters scpeters commented Mar 2, 2022

🎉 New feature

Part of #60.

Summary

The * operator matches the behavior of multiplying transform matrices, so it should be preferred over the addition operator, which is confusing. This will be a draft PR until the deprecation warnings have been fixed in downstream packages.

Test it

Run the UNIT_Pose_TEST, which uses the * operator instead of +.

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 and edit the commit message to match the pull request summary while retaining Signed-off-by messages.

@scpeters scpeters requested a review from azeey March 2, 2022 06:31
@github-actions github-actions bot added the 🌱 garden Ignition Garden label Mar 2, 2022
@codecov
Copy link

codecov bot commented Mar 2, 2022

Codecov Report

Merging #381 (2434219) into main (b1cb6bb) will not change coverage.
The diff coverage is 100.00%.

❗ Current head 2434219 differs from pull request most recent head 2bd60e7. Consider uploading reports for the commit 2bd60e7 to get more accurate results

@@           Coverage Diff           @@
##             main     #381   +/-   ##
=======================================
  Coverage   99.73%   99.73%           
=======================================
  Files          68       68           
  Lines        6314     6314           
=======================================
  Hits         6297     6297           
  Misses         17       17           
Impacted Files Coverage Δ
include/ignition/math/Pose3.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 b1cb6bb...2bd60e7. Read the comment docs.

Copy link
Contributor

@azeey azeey left a comment

Choose a reason for hiding this comment

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

LGTM! Should we deprecate Pose3::operator- and Pose3::operator-= as well?

EXPECT_TRUE(pose ==
math::Pose3d(5.74534, 7.01053, 8.62899, 0.675732, 0.535753, 1.01174));

pose += pose;
pose *= pose;
Copy link
Contributor

Choose a reason for hiding this comment

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

As we found in #372, it would be good to keep tests for deprecated functions.

Copy link
Member Author

Choose a reason for hiding this comment

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

coverage restored in d9a6d4a

@scpeters
Copy link
Member Author

scpeters commented Mar 2, 2022

LGTM! Should we deprecate Pose3::operator- and Pose3::operator-= as well?

I wanted to address them separately, so I'll make a follow-up pull request about - and -=

@scpeters scpeters marked this pull request as ready for review March 23, 2022 06:31
The * operator matches the behavior of multiplying
transform matrices, so it should be preferred over
the addition operator, which is confusing.

Part of gazebosim#60.

Signed-off-by: Steve Peters <[email protected]>
@scpeters
Copy link
Member Author

I think this is ready for review as downstream packages have already been fixed to use * instead of +

@scpeters scpeters merged commit 71b6db2 into gazebosim:main Mar 28, 2022
@scpeters scpeters deleted the pose_deprecate_addition branch March 28, 2022 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🌱 garden Ignition Garden
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants