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

Buoyancy improvements #818

Merged
merged 44 commits into from
Sep 22, 2021
Merged

Buoyancy improvements #818

merged 44 commits into from
Sep 22, 2021

Conversation

arjo129
Copy link
Contributor

@arjo129 arjo129 commented May 14, 2021

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

🎉 New feature

Depends on gazebosim/gz-math#219.

Summary

Often when simulating a maritime environment one may need to simulate both
surface and underwater vessels. This means the buoyancy plugin needs to
take into account two different fluids. One being water with a density of
1000kgm^-3 and another being air with a very light density of say 1kgm^-3.
An example for such a configuration may be found in the graded_buoyancy.sdf world.

ign gazebo -v 4 graded_buoyancy.sdf

You should be able to see a sphere bobbing up and down undergoing simple
harmonic motion on the surface of the fluid (this is expected behaviour
as the SHM is usually damped by the hydrodynamic forces. See the hydro-
dynamics plugin for an example of how to use it). The key part of this is

<graded_buoyancy>
   <default_density>1000</default_density>
   <density_change>
     <above_depth>0</above_depth>
     <density>1</density>
  </density_change>
</graded_buoyancy>

The default density tag says that by default the world has a fluid density
of 1000kgm^-3. This essentially states that by default the world is filled
with dihydrogen monoxide (aka water). The <density_change> tag
essentially establishes the fact that there is a nother fluid. The
<above_depth> tag says that above z=0 there is another fluid with a
different density. The density of that fluid is defined by the <density>
tag. We will be simulating air with a fluid density of 1kgm^-3.

Test it

TODO

  • Write write unit tests.
  • Update other examples (possibly in another PR).

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

Signed-off-by: Arjo Chakravarty <[email protected]>
Signed-off-by: Arjo Chakravarty <[email protected]>
Signed-off-by: Arjo Chakravarty <[email protected]>
Signed-off-by: Arjo Chakravarty <[email protected]>
@github-actions github-actions bot added the 🏢 edifice Ignition Edifice label May 14, 2021
@chapulina chapulina changed the title [wip] Arjo/buoyancy improvements [wip] Buoyancy improvements May 14, 2021
Copy link
Contributor

@chapulina chapulina left a comment

Choose a reason for hiding this comment

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

I know this is still WIP, but I just did a quick pass

src/systems/buoyancy/Buoyancy.cc Outdated Show resolved Hide resolved
src/systems/buoyancy/Buoyancy.cc Outdated Show resolved Hide resolved
src/systems/buoyancy/Buoyancy.cc Outdated Show resolved Hide resolved
src/systems/buoyancy/Buoyancy.cc Outdated Show resolved Hide resolved
src/systems/buoyancy/Buoyancy.cc Outdated Show resolved Hide resolved
@arjo129 arjo129 changed the base branch from ign-gazebo5 to main August 16, 2021 06:02
@arjo129 arjo129 added 🏯 fortress Ignition Fortress and removed 🏢 edifice Ignition Edifice labels Aug 16, 2021
Signed-off-by: Arjo Chakravarty <[email protected]>
@arjo129 arjo129 marked this pull request as ready for review August 31, 2021 06:13
Signed-off-by: Arjo Chakravarty <[email protected]>
Signed-off-by: Arjo Chakravarty <[email protected]>
Signed-off-by: Arjo Chakravarty <[email protected]>
@chapulina chapulina added the beta Targeting beta release of upcoming collection label Sep 8, 2021
@arjo129 arjo129 changed the title [wip] Buoyancy improvements Buoyancy improvements Sep 14, 2021
src/systems/buoyancy/Buoyancy.cc Outdated Show resolved Hide resolved
src/systems/buoyancy/Buoyancy.cc Outdated Show resolved Hide resolved
src/systems/buoyancy/Buoyancy.cc Show resolved Hide resolved
src/systems/buoyancy/Buoyancy.cc Outdated Show resolved Hide resolved
src/systems/buoyancy/Buoyancy.cc Outdated Show resolved Hide resolved
src/systems/buoyancy/Buoyancy.hh Outdated Show resolved Hide resolved
src/systems/buoyancy/Buoyancy.cc Outdated Show resolved Hide resolved
test/worlds/graded_buoyancy.sdf Outdated Show resolved Hide resolved
examples/worlds/graded_buoyancy.sdf Show resolved Hide resolved
src/systems/buoyancy/Buoyancy.cc Show resolved Hide resolved
@chapulina chapulina mentioned this pull request Sep 14, 2021
12 tasks
arjo129 and others added 11 commits September 16, 2021 21:58
Signed-off-by: Arjo Chakravarty <[email protected]>
Signed-off-by: Arjo Chakravarty <[email protected]>
Signed-off-by: Arjo Chakravarty <[email protected]>
Signed-off-by: Arjo Chakravarty <[email protected]>
Signed-off-by: Arjo Chakravarty <[email protected]>
Signed-off-by: Arjo Chakravarty <[email protected]>
Signed-off-by: Arjo Chakravarty <[email protected]>
Signed-off-by: Arjo Chakravarty <[email protected]>
…fail art in primary school.

Signed-off-by: Arjo Chakravarty <[email protected]>
Signed-off-by: Louise Poubel <[email protected]>
Copy link
Contributor

@chapulina chapulina left a comment

Choose a reason for hiding this comment

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

Works for me! I pushed a new example and a small fix for it on 2abcabd. Now we just need to merge and release the ign-math PR.

@chapulina chapulina removed the needs upstream release Blocked by a release of an upstream library label Sep 22, 2021
@codecov
Copy link

codecov bot commented Sep 22, 2021

Codecov Report

Merging #818 (7c3dd55) into main (4be711c) will increase coverage by 0.09%.
The diff coverage is 86.79%.

❗ Current head 7c3dd55 differs from pull request most recent head f6ce49f. Consider uploading reports for the commit f6ce49f to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##             main     #818      +/-   ##
==========================================
+ Coverage   63.47%   63.56%   +0.09%     
==========================================
  Files         241      241              
  Lines       19577    19675      +98     
==========================================
+ Hits        12426    12507      +81     
- Misses       7151     7168      +17     
Impacted Files Coverage Δ
src/systems/buoyancy/Buoyancy.hh 100.00% <ø> (ø)
src/systems/buoyancy/Buoyancy.cc 82.35% <86.79%> (+7.07%) ⬆️
src/gui/plugins/plot_3d/Plot3D.cc 43.47% <0.00%> (-4.35%) ⬇️
src/EntityComponentManager.cc 84.83% <0.00%> (+0.15%) ⬆️

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 4be711c...f6ce49f. Read the comment docs.

@chapulina chapulina merged commit ac84fb7 into main Sep 22, 2021
@chapulina chapulina deleted the arjo/buoyancy_improvements branch September 22, 2021 05:28
@caguero caguero mentioned this pull request Nov 2, 2021
40 tasks
WilliamLewww pushed a commit to WilliamLewww/ign-gazebo that referenced this pull request Dec 7, 2021
Signed-off-by: Arjo Chakravarty <[email protected]>
Signed-off-by: Louise Poubel <[email protected]>

Co-authored-by: Louise Poubel <[email protected]>
Signed-off-by: William Lew <[email protected]>
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 🏯 fortress Ignition Fortress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants