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

Implements a method to get the link inertia #2218

Merged
merged 6 commits into from
Nov 3, 2023
Merged

Conversation

Voldivh
Copy link
Contributor

@Voldivh Voldivh commented Oct 25, 2023

🎉 New feature

This PR addresses issue #2209

Summary

This PR adds a method to get the Link inertia in relation to the world frame.

Checklist

  • Signed all commits for DCO
  • Added tests
  • Added example and/or tutorial
  • 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.

@Voldivh Voldivh requested a review from azeey October 25, 2023 20:29
@github-actions github-actions bot added the 🎵 harmonic Gazebo Harmonic label Oct 25, 2023
@codecov
Copy link

codecov bot commented Oct 25, 2023

Codecov Report

Merging #2218 (529d977) into gz-sim8 (71d965a) will increase coverage by 0.16%.
The diff coverage is 90.90%.

❗ Current head 529d977 differs from pull request most recent head 03be14f. Consider uploading reports for the commit 03be14f to get more accurate results

@@             Coverage Diff             @@
##           gz-sim8    #2218      +/-   ##
===========================================
+ Coverage    65.74%   65.91%   +0.16%     
===========================================
  Files          323      323              
  Lines        30719    30730      +11     
===========================================
+ Hits         20197    20255      +58     
+ Misses       10522    10475      -47     
Files Coverage Δ
src/Link.cc 98.39% <100.00%> (+0.08%) ⬆️
python/src/gz/sim/Link.cc 50.00% <50.00%> (ø)

... and 2 files with indirect coverage changes

@@ -190,6 +189,23 @@ std::optional<math::Pose3d> Link::WorldPose(
.value_or(sim::worldPose(this->dataPtr->id, _ecm));
}

//////////////////////////////////////////////////
std::optional<math::Inertiald> Link::WorldInertial(
Copy link
Contributor

Choose a reason for hiding this comment

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

include <optional> and math::Inertiald

Copy link
Contributor Author

@Voldivh Voldivh Oct 27, 2023

Choose a reason for hiding this comment

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

Those are being included in the link.hh file, should I move them to this file?

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think that's necessary.

@@ -59,6 +59,10 @@ def on_pre_udpate_cb(_info, _ecm):
# Visuals Test
self.assertNotEqual(K_NULL_ENTITY, link.visual_by_name(_ecm, 'visual_test'))
self.assertEqual(1, link.visual_count(_ecm))
# World Inertial Test
self.assertEqual(Pose3d(), link.world_inertial(_ecm).pose())
self.assertEqual(Matrix3d(1,0,0,0,1,0,0,0,1), link.world_inertial(_ecm).moi())
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
self.assertEqual(Matrix3d(1,0,0,0,1,0,0,0,1), link.world_inertial(_ecm).moi())
self.assertEqual(Matrix3d(1, 0, 0, 0, 1, 0, 0, 0, 1), link.world_inertial(_ecm).moi())

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

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.

Looks good. Just one comment about the link and inertial pose.

test/integration/link.cc Outdated Show resolved Hide resolved
@Voldivh Voldivh merged commit 86d62f4 into gz-sim8 Nov 3, 2023
6 of 8 checks passed
@Voldivh Voldivh deleted the voldivh/world_inertial branch November 3, 2023 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🎵 harmonic Gazebo Harmonic
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants