Robotics StackExchange | Archived questions

buoyancy neutral object goes up with hydrodynamics plugin

Hello, I made an object in gazebo. I am using the hydrodynamics plugin on it. The fluid density is 1000. Every part of the object has the same density 1000. Its total weight is 0.218 kgs. When I start the sim the object just keeps going up. Why is it doing this. Since the object has the same density as its surroundings doesn't my object have neutral buoyancy? When I increase my objects weight to a couple of kgs it stays at the bottom. Why is it doing this?

Asked by kalvik on 2017-03-14 23:15:02 UTC

Comments

It might be easier for someone to help you if you provide a simple example model which reproduces the problem you're having. The yellow submarine on the underwater.world example stays in place: http://gazebosim.org/tutorials?tut=hydrodynamics&cat=plugins

Asked by chapulina on 2017-03-15 10:49:25 UTC

I am making a bluerobotics T200 thruster. It's relatively small and weighs 0.211 kgs. When I create it in gazebo it ends up going to the surface and floating at the top. I guess if I attach the thruster to a thruster then it won't have the same issue.A simpler example of my problem would be if I make a tube which weighs 0.211kgs but with the same density as water (along with the hydrodynamics plugin) it floats at the surface instead of staying in place.

Asked by kalvik on 2017-03-15 15:07:20 UTC

Are you using the <volume> tag?

Asked by chapulina on 2017-03-15 15:28:49 UTC

I am using the model editor and I am not aware of a volume tag so no.

Asked by kalvik on 2017-03-15 15:30:34 UTC

Answers

So based on the comments, I think you might not be setting all the necessary parameters for the buoyancy plugin. I suggest you go through this tutorial, which explains the parameters for that plugin:

http://gazebosim.org/tutorials?tut=hydrodynamics&cat=plugins#UsingtheBuoyancyPlugin

When attaching the plugin to the model using the model editor, be sure to add the <volume> tag under <link>. Otherwise, Gazebo will use the bounding box of the link by default. If you want a density of 1000 kg / m^3 for a mass of 0.218 kg, the volume should be voume = mass / density = 0.218 / 1000 = 0.00218 m^3.

Asked by chapulina on 2017-03-15 15:59:26 UTC

Comments

Maybe this example might help you understand the fundamentals. Also its an example with URDF, which might be usefull for further ROS integration. Here you have the launch files and the URDF to test it. Also the script to calculate the Buoyancy Forces of a sphere.

Here you have a full video tutorial: VIDEO

main.launch

spawn_simple_sphere.launch

spawn_robot_urdf.launch

ocean.world

simple_floating_sphere.urdf

volume_calculator.py

inertial_calculator.py

You can launch the world through the launch main.launch, and spawn the sphere through the spawn_simple_sphere.launch

Then you can play around with the mass , radius and fluid_desnisty to get different buoyancy. You can calculate the perfect neutral buoyancy with the help of the volume_calculator.py script. It will tell you the force produced by buoyancy and of the weight of the Sphere. All this is applicable to any shape of course.

Hope this helps understand a bit better and complement the previous answers given.

Edit:

Here you have a second part explaining how to do it with a complex 3D shape from a dae file: VIDEO PART 2 Basically you could try it with the 3D mesh real volume but the plugin doesnt fully support that still so I also teach you how to know the volume of the bounding box and use that instead.

The formula we use too calculate the neutral buoyancy mass is: Ff: Final Force

Fb: Buoyancy Force

W: Weight of the object

Ff = Fb - W

Ff = 0, because we want neutral buoyancy.

Fb = FluidDensity * 3dMeshVolume

W = mass * gravity

mass = FluidDensity * 3dMeshVolume

This massis the one you have to put in the URDF file.

Bare in mind that even with this the force distribution has to be evenly distributed otherwise it can make the robot be in an unstable situation. But that's another topic that you will need to calibrate yourself depending on what you want.

Edit2:

Here I give you the urdf for the 3DMesh version and the geometric version.

C:\fakepath\naro_buoyancy.urdf.sdf

C:\fakepath\naro_geometric_buoyancy.urdf.sdf

For the 3D mesh you use Blender 3DPrint plugin to get its volume. For the geometric versions you dont need that, with formulas is ok. You can use the volume.py that I give at the top of the question to calculate all you need including the mass that it has to have to have neautral buoyancy.

Here you have the VIDEO PART3 that explain all this in more detail.

Also bare in mind that when changing the mas of an object and shape, you have to recalculate the inertial matrix. I give a pythons script also to make those calculations for you inertial_calculator.py.

The only thing that it wouldn't be solve is that there is no friction with the fluid and therefore it migh move in un unstable way.

Asked by Duckfrost on 2017-11-06 08:16:57 UTC

Comments