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
110 stars 29 forks source link

Waves: allow ocean tile to have different dimensions in each direction. #116

Closed srmainwaring closed 1 year ago

srmainwaring commented 1 year ago

This change allows the dimensions of the wave tile to be set independently in the x and y directions. This affects both the tile size (in metres), and the cell count controlling the grid resolution.

The FFT wave generator had been previously updated to cope with non-square grids, this change updates the Gazebo system plugins and interfaces to use that feature.

Details

The tile dimensions are controlled by the SDF elements:

      <tile_size>500.0</tile_size>
      <cell_count>128</cell_count>

which may now optionally be set as vectors:

      <tile_size>500.0 125.0</tile_size>
      <cell_count>128 32</cell_count>

There is a breaking change to the interface of the classes OceanTile and WaveParameters to return tuples instead of single values for the TileSize and CellCount.

wave-grid-size Figure: a single tile may now have different size and resolution in the x and y directions.

Context

For FFT generated waves using spectra with spreading functions, it is usually desirable to use square grids for the ocean tile. An example where the asymmetric grid is useful is when analysing a linear wave-body model where the incident waves for the wave excitation force are expected to be uni-directional. In this case, for performance, we'd like to use an alternative wave generator with good resolution in the direction of the wave travel and lower resolution the the perpendicular direction.