patrykcieslak / stonefish_ros2

ROS2 package implementing an interface for the Stonefish library.
https://stonefish-ros2.readthedocs.io
GNU General Public License v3.0
7 stars 4 forks source link

Buoyancy is not included when the physics is set to "surface" #5

Open mzhouURI opened 6 months ago

mzhouURI commented 6 months ago

Hi Patryk

Thanks for creating a ROS2 wrapper for stonefish.

I was recently testing our vehicle in stonefish with this ros2 wrapper. But I encounter a small issue with it.

Description: I tried to create a cylinder with physics being "surface" and buoyant set to "true". But seems like the buoyancy is not computed in this case.

The surface body(with buoyant set to true) was previously used to mimic buoyancy foams placed inside the AUV. So they only provide buoyancy instead of hydrodynamic forces.

Maybe, it is due to some recent updates in stonefish, such that the buoyancy is only computed for floating and submerged bodies?

To replicate this problem, you can add a dynamic body in the scenario file as follows. Our density for the foam is 370kg/m^3. When physics="surface", the cylinder will sink. If phyiscs="submerged", the cylinder will float, however, hydrodynamic force will be included.

    <dynamic name="Cyl" type="cylinder" physics="surface" buoyant="true">
          <dimensions radius="1.0" height="2.0"/>
          <origin xyz="4.0 0.0 0.0" rpy="0.0 0.0 0.0"/>
          <material name="Foam"/>
          <look name="yellow"/>
          <world_transform xyz="0.0 0.0 0.0" rpy="0.0 0.0 0.0"/>
    </dynamic>

Thank you very much in advance.

MIngxi