asv_wave_sim icon indicating copy to clipboard operation
asv_wave_sim copied to clipboard

Waves fail if wind_speed is between 0.26 and 0.39

Open ellen-thaum opened this issue 1 year ago • 1 comments

Hi Rhys,

I stumbled across some odd behaviour...

Issue

If the wind_speed parameter is set to a number between approximately 0.26 and 0.39 the waves fail to spawn in Gazebo.

Minimal example

Set wind_speed to 0.3 in the 'WavesModel' and 'WavesVisual' plugins of 'gz-waves-models/world_models/waves/model.sdf':

      <wave>
        <!-- `fft` wave parameters -->
        <algorithm>fft</algorithm>
        <tile_size>256</tile_size>
        <cell_count>256</cell_count>
        <wind_speed>0.3</wind_speed>
        <wind_angle_deg>135</wind_angle_deg>
        <steepness>2</steepness>
      </wave>

Re-build and run waves.sdf:

colcon build --merge-install
gz sim -v4 waves.sdf

The waves don't appear and all objects fall: Example of failure

Note: I removed the wam-v to avoid setting up ArduPilotPlugin in a minimal environment.

There were no unusual messages in the output, so I wouldn't know where to start looking for the problem.

Check

Resetting wind_speed to 5.0 and re-running gz sim waves.sdf, everything looks fine: Example of success

Any idea what might be causing particular values of wind_speed to fail?

Thanks for the great package.

Regards,

Ellen

ellen-thaum avatar Oct 14 '24 05:10 ellen-thaum

Hi @ellen-thaum, thanks for the report. I can reproduce the issue on macOS. If the simulation is started in the paused state it's clear that the wave mesh is not generated which is why the objects fall through the surface.

If the simulation is already running and the wind scale is changed using the WaveControl widget the mesh remains and objects stay on the surface. The waves stop when the wind parameter drops below ~1, then resume when it is increased again. I'd previously thought this was simply because the amplitude scale was too small to notice the waves, but it's apparent that something else is going on as well.

I suspect there is an overflow somewhere in the spectrum generator or spreading function when the wind parameter is small - I'll investigate.

srmainwaring avatar Oct 14 '24 08:10 srmainwaring