gz-sim icon indicating copy to clipboard operation
gz-sim copied to clipboard

Fluid added mass

Open chapulina opened this issue 1 year ago • 1 comments

🎉 New feature

  • Part of https://github.com/gazebosim/gz-sim/issues/1462
  • Requires
    • https://github.com/gazebosim/gz-math/pull/459
    • https://github.com/gazebosim/sdformat/pull/1077
    • https://github.com/gazebosim/gz-physics/pull/384
    • https://github.com/gazebosim/gz-msgs/pull/271

Summary

Uses the APIs added as part of the Fluid Added Mass Proposal.

TODO

  • [ ] Check that added mass is correctly passed to physics engine
  • [ ] Create example world that demonstrates the added mass effect
  • [x] Display added mass on component inspector
  • [ ] Add tests

Test it

Check out the example world once the PR is ready.

Checklist

  • [x] 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)
  • [x] 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.

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

chapulina avatar Jul 14 '22 05:07 chapulina

We're past feature freeze ❄️ . The plan is to not merge this PR into gz-sim7 until after the stable release (i.e. October).

chapulina avatar Aug 10 '22 18:08 chapulina

I just updated the branch and added the second test for added mass, I have also made the PR ready for review. I don't expect CI to pass, as the changes here depend on https://github.com/gazebosim/gz-physics/pull/384, which hasn't been merged yet.

On a separate note, the "expected values" in both tests come from an implementation of the equations of motion (in python) that has gone through somewhat of a validation process. I have not pushed that code, but we should probably find a home for it and reference it from the tests, just in case these tests need to be revisited in the future.

JoanAguilar avatar Nov 15 '22 00:11 JoanAguilar

@osrf-jenkins retest this please

mjcarroll avatar Dec 05 '22 16:12 mjcarroll

@JoanAguilar still a few Windows issues here:

C:\Jenkins\workspace\ign_gazebo-pr-win\ws\gz-sim\test\integration\added_mass.cc(50,33): error C2065: 'M_PI': undeclared identifier [C:\Jenkins\workspace\ign_gazebo-pr-win\ws\build\gz-sim7\test\integration\INTEGRATION_added_mass.vcxproj]

C:\Jenkins\workspace\ign_gazebo-pr-win\ws\gz-sim\test\integration\added_mass.cc(50,14): error C2737: 'kForceAngVel': const object must be initialized [C:\Jenkins\workspace\ign_gazebo-pr-win\ws\build\gz-sim7\test\integration\INTEGRATION_added_mass.vcxproj]

C:\Jenkins\workspace\ign_gazebo-pr-win\ws\gz-sim\test\integration\added_mass.cc(56,34): error C2065: 'M_PI': undeclared identifier [C:\Jenkins\workspace\ign_gazebo-pr-win\ws\build\gz-sim7\test\integration\INTEGRATION_added_mass.vcxproj]

C:\Jenkins\workspace\ign_gazebo-pr-win\ws\gz-sim\test\integration\added_mass.cc(56,14): error C2737: 'kTorqueAngVel': const object must be initialized [C:\Jenkins\workspace\ign_gazebo-pr-win\ws\build\gz-sim7\test\integration\INTEGRATION_added_mass.vcxproj]

mjcarroll avatar Dec 05 '22 20:12 mjcarroll

@osrf-jenkins retest this please

mjcarroll avatar Dec 06 '22 15:12 mjcarroll

Codecov Report

Merging #1592 (0ba6831) into gz-sim7 (af73ebe) will increase coverage by 0.12%. The diff coverage is 22.38%.

@@             Coverage Diff             @@
##           gz-sim7    #1592      +/-   ##
===========================================
+ Coverage    64.64%   64.77%   +0.12%     
===========================================
  Files          343      344       +1     
  Lines        27542    27773     +231     
===========================================
+ Hits         17805    17989     +184     
- Misses        9737     9784      +47     
Impacted Files Coverage Δ
src/Util.cc 92.53% <ø> (ø)
src/gui/plugins/component_inspector/Inertial.cc 11.76% <11.76%> (ø)
src/systems/apply_link_wrench/ApplyLinkWrench.cc 77.77% <46.15%> (ø)
src/Conversions.cc 83.66% <100.00%> (-0.34%) :arrow_down:
.../plugins/component_inspector/ComponentInspector.cc 5.61% <100.00%> (+0.14%) :arrow_up:
...rc/systems/ackermann_steering/AckermannSteering.hh 100.00% <0.00%> (ø)
...rc/systems/odometry_publisher/OdometryPublisher.cc 88.75% <0.00%> (+0.87%) :arrow_up:
src/SimulationRunner.cc 92.15% <0.00%> (+1.88%) :arrow_up:
...rc/systems/ackermann_steering/AckermannSteering.cc 84.07% <0.00%> (+3.62%) :arrow_up:

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

codecov[bot] avatar Feb 01 '23 19:02 codecov[bot]