srmainwaring / asv_wave_sim

This package contains plugins that support the simulation of waves and surface vessels in Gazebo.
GNU General Public License v3.0
114 stars 31 forks source link

Allow hydrodynamics plugin to apply to named links #43

Closed srmainwaring closed 1 year ago

srmainwaring commented 2 years ago

The hydrodynamics plugin currently applies buoyancy and drag forces to all links in a model. The proposal is to allow the user to specify which links should be included / excluded from the calculation. For example the contribution from sensor links is likely to be small and these could be safely excluded without a material impact to the physical behaviour.

See the gz-sim-buoyancy-system plugin and the graded_buoyancy.sdf for an example where certain models and links have the calculation enabled.

<plugin
  filename="gz-marine1-hydrodynamics-system"
  name="gz::sim::systems::Hydrodynamics">

   <!-- Hydrodynamics -->
   <hydrodynamics>
    <damping_on>1</damping_on>
    <viscous_drag_on>1</viscous_drag_on>
    <pressure_drag_on>1</pressure_drag_on>

    <!-- Linear and Angular Damping -->  
    <cDampL1>1.0E-6</cDampL1>
    <cDampL2>1.0E-6</cDampL2>
    <cDampR1>1.0E-6</cDampR1>
    <cDampR2>1.0E-6</cDampR2>

    <!-- 'Pressure' Drag -->
    <cPDrag1>1.0E+2</cPDrag1>
    <cPDrag2>1.0E+2</cPDrag2>
    <fPDrag>0.4</fPDrag>
    <cSDrag1>1.0E+2</cSDrag1>
    <cSDrag2>1.0E+2</cSDrag2>
    <fSDrag>0.4</fSDrag>
    <vRDrag>1.0</vRDrag>

    <!-- Either: enable specific links -->
    <enable>base_link</enable>
    <enable>left_hull</enable>
    <enable>right_hull</enable>

    <!-- Or: disable specific links -->
    <disable>imu_sensor_link</disable>

  </hydrodynamics>
</plugin>