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

Backport ign sdf --inertial-stats #958

Merged
merged 8 commits into from
Apr 11, 2022
Merged

Conversation

adityapande-1995
Copy link
Contributor

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

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

🎉 New feature

Summary

Backport of #936

Test it

Added a test case to ign_TEST.cc and an example model sdf file.

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.

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

Signed-off-by: Aditya <aditya050995@gmail.com>
@github-actions github-actions bot added the 🏯 fortress Ignition Fortress label Apr 8, 2022
@adityapande-1995 adityapande-1995 changed the base branch from sdf12 to sdf9 April 8, 2022 20:14
Signed-off-by: Aditya <aditya050995@gmail.com>
@adityapande-1995 adityapande-1995 marked this pull request as ready for review April 8, 2022 20:37
@adityapande-1995 adityapande-1995 requested review from jennuine and scpeters and removed request for scpeters April 8, 2022 20:38
Signed-off-by: Aditya <aditya050995@gmail.com>
@codecov-commenter
Copy link

codecov-commenter commented Apr 8, 2022

Codecov Report

Merging #958 (7d2fd04) into sdf9 (796a980) will increase coverage by 0.02%.
The diff coverage is 91.66%.

@@            Coverage Diff             @@
##             sdf9     #958      +/-   ##
==========================================
+ Coverage   87.55%   87.58%   +0.02%     
==========================================
  Files          63       63              
  Lines        9903     9963      +60     
==========================================
+ Hits         8671     8726      +55     
- Misses       1232     1237       +5     
Impacted Files Coverage Δ
src/ign.cc 82.60% <91.66%> (+9.88%) ⬆️

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 796a980...7d2fd04. Read the comment docs.

src/ign.cc Outdated
{
std::cerr << "Error: " << error.Message() << std::endl;
}
return -1;
Copy link
Member

Choose a reason for hiding this comment

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

I think we don't need to return here. There can be minor errors that wouldn't affect the inertial calculations. It's nice to print the errors, but just skip the return and that should be fine

Copy link
Collaborator

Choose a reason for hiding this comment

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

Wouldn't it be safer to return in case the error isn't minor? For example, it won't catch inertial_invalid.sdf

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah that just broke a test case. ign sdf --inertial-stats should inherently check for sdf errors I think, and if those pass only then we should return the statistics. Maybe that is safer for users.

Copy link
Member

Choose a reason for hiding this comment

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

it currently doesn't work for the VIPER urdf. That might be fixed by #959, but it's not very helpful for debugging if it doesn't at least try to give you some inertial information if there's anything at all wrong with the model. We could add a --strict flag to make this configurable if we can't agree, but I think printing the warning messages should be enough of a clue that there's something wrong

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated the test case. On the other hand maybe printing out the false inertial stats can help with debugging.

Signed-off-by: Aditya <aditya050995@gmail.com>
Signed-off-by: Aditya <aditya050995@gmail.com>
src/ign.cc Outdated Show resolved Hide resolved
src/ign.cc Outdated Show resolved Hide resolved
Signed-off-by: Aditya <aditya050995@gmail.com>
@adityapande-1995
Copy link
Contributor Author

The ABI checker failed weirdly. Seems unrelated.

@scpeters
Copy link
Member

The ABI checker failed weirdly. Seems unrelated.

yes, it's unrelated. I'll merge this now

@scpeters scpeters merged commit 1491d72 into sdf9 Apr 11, 2022
@scpeters scpeters deleted the aditya/inertial_stats_backport branch April 11, 2022 21:30
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.

4 participants