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

Added --inertial-stats option to ign sdf #936

Merged
merged 9 commits into from
Apr 8, 2022
Merged

Conversation

adityapande-1995
Copy link
Contributor

@adityapande-1995 adityapande-1995 commented Apr 5, 2022

Signed-off-by: Aditya [email protected]

🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸

🎉 New feature

Closes #832

Summary

Adds an option of --inertial-stats to ign sdf tool and prints out centre of mass, total mass, and moment of inertia matrix of the given model sdf.

Test it

Working on a test case.

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.

🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸

@adityapande-1995 adityapande-1995 marked this pull request as draft April 5, 2022 22:55
@github-actions github-actions bot added the 🏯 fortress Ignition Fortress label Apr 5, 2022
Signed-off-by: Aditya <[email protected]>
@adityapande-1995 adityapande-1995 marked this pull request as ready for review April 6, 2022 19:07
Signed-off-by: Aditya <[email protected]>
@adityapande-1995 adityapande-1995 self-assigned this Apr 6, 2022
src/ign.cc Outdated Show resolved Hide resolved
@codecov-commenter
Copy link

codecov-commenter commented Apr 6, 2022

Codecov Report

Merging #936 (d0c4ae4) into sdf12 (56b0d9c) will increase coverage by 0.01%.
The diff coverage is 91.66%.

@@            Coverage Diff             @@
##            sdf12     #936      +/-   ##
==========================================
+ Coverage   87.68%   87.70%   +0.01%     
==========================================
  Files         104      104              
  Lines       15049    15109      +60     
==========================================
+ Hits        13196    13251      +55     
- Misses       1853     1858       +5     
Impacted Files Coverage Δ
src/ign.cc 74.09% <91.66%> (+9.94%) ⬆️

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 56b0d9c...d0c4ae4. Read the comment docs.

src/ign.cc Outdated Show resolved Hide resolved
src/ign.cc Outdated Show resolved Hide resolved
src/ign.cc Show resolved Hide resolved
src/ign_TEST.cc Show resolved Hide resolved
test/sdf/inertial_stats.sdf Outdated Show resolved Hide resolved
src/ign_TEST.cc Outdated Show resolved Hide resolved
@azeey azeey removed their request for review April 7, 2022 17:24
src/ign.cc Show resolved Hide resolved
Copy link
Collaborator

@jennuine jennuine left a comment

Choose a reason for hiding this comment

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

LGTM but I'll let @scpeters do the final approval

src/ign.cc Outdated Show resolved Hide resolved
src/ign.cc Outdated Show resolved Hide resolved
Signed-off-by: Aditya <[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.

I tested this with the VIPER urdf, and it failed to load with libsdformat12 due to #746, so we should prioritize fixing that issue as well, but that is not the fault of this PR. We should also backport this to libsdformat9 so it will be available to gazebo11 users.

looks good

@scpeters scpeters merged commit 1b66d74 into sdf12 Apr 8, 2022
@scpeters scpeters deleted the aditya/inertial_stats branch April 8, 2022 17:02
adityapande-1995 added a commit that referenced this pull request Apr 8, 2022
scpeters pushed a commit that referenced this pull request Apr 11, 2022
* Ported changes from #936
* Removed quick return logic

Signed-off-by: Aditya <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏯 fortress Ignition Fortress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ign sdf --inertial-stats: compute and print aggregate inertial statistics of a model
4 participants