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

Bugfix: Updated Mesh Inertia Calculator to incorporate mesh scale in the calculations #2171

Merged
merged 2 commits into from
Sep 27, 2023

Conversation

jasmeet0915
Copy link
Contributor

🦟 Bug fix

The MeshInertiaCalculator.cc was not incorporating the scale value set through the SDF for the inertia calculations leading to incorrect values. This PR fixes this issue by scaling the mesh coordinates in MeshInertiaCaclulator::GetMeshTriangles() function before calculating the inertia.

Checklist

  • Signed all commits for DCO
  • Added tests
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • Consider updating Python bindings (if the library has them)
  • 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.

@github-actions github-actions bot added the 🎵 harmonic Gazebo Harmonic label Sep 25, 2023
@codecov
Copy link

codecov bot commented Sep 25, 2023

Codecov Report

Merging #2171 (58924a5) into gz-sim8 (e603694) will increase coverage by 0.01%.
The diff coverage is 100.00%.

❗ Current head 58924a5 differs from pull request most recent head d892b53. Consider uploading reports for the commit d892b53 to get more accurate results

@@             Coverage Diff             @@
##           gz-sim8    #2171      +/-   ##
===========================================
+ Coverage    65.47%   65.49%   +0.01%     
===========================================
  Files          323      323              
  Lines        30711    30714       +3     
===========================================
+ Hits         20108    20116       +8     
+ Misses       10603    10598       -5     
Files Coverage Δ
src/MeshInertiaCalculator.cc 92.90% <100.00%> (+0.15%) ⬆️

... and 2 files with indirect coverage changes

@@ -40,6 +40,7 @@ using namespace sim;
//////////////////////////////////////////////////
void MeshInertiaCalculator::GetMeshTriangles(
std::vector<Triangle>& _triangles,
gz::math::Vector3d _meshScale,
Copy link
Contributor

Choose a reason for hiding this comment

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

make it const ref? i.e. const gz::math::Vector3d &_meshScale

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 in d892b53

@azeey azeey added the beta Targeting beta release of upcoming collection label Sep 27, 2023
@azeey azeey merged commit 5ef84a9 into gazebosim:gz-sim8 Sep 27, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beta Targeting beta release of upcoming collection 🎵 harmonic Gazebo Harmonic
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants