Skip to content

gz_waves: FFT backend - Part 4/4#885

Open
caguero wants to merge 4 commits into
caguero/waves-03-renderingfrom
caguero/waves-04-fft
Open

gz_waves: FFT backend - Part 4/4#885
caguero wants to merge 4 commits into
caguero/waves-03-renderingfrom
caguero/waves-04-fft

Conversation

@caguero

@caguero caguero commented Jun 19, 2026

Copy link
Copy Markdown
Collaborator

Fourth in the series. Adds the second wave engine, the FFT spectral backend built on the EncinoWaves library, and wires it into the visual and the demo world as a selectable alternative to Gerstner.

How to test it?

ros2 launch vrx_bringup simulation.launch.xml

What this PR adds

  • FFT engine (FFTWaveSimulation, libgz-waves-provider-fft) — a plain IWaveField backed by EncinoWaves (TMA/JONSWAP/PM spectra + directional spreading + dispersion). MakeFFTWaveField() is its factory.
  • Source system (gz-sim-waves-fft-system) — a WavesSystemBase subclass that builds the FFT engine and writes the Wavefield component. Its doc block documents the full parameter surface and the <sea_state> precedence rules.
  • GUI registrar (gz-sim-waves-fft-gui) — registers the "fft" factory in the GUI so WaterVisual can rebuild a private FFT engine; same bare, no-ISystem, static-init form as the Gerstner registrar.
  • Unit tests (test/fft_test.cc, 18 tests).
  • Wiring: adds gz-sim-waves-fft-gui to the water_surface model (next to the Gerstner registrar) and offers FFT as a commented alternative in open_water.sdf. Gerstner stays the active default — flip by commenting the Gerstner <plugin> and uncommenting the FFT one.

@caguero caguero force-pushed the caguero/waves-04-fft branch from 3253aa3 to c9ba107 Compare June 19, 2026 17:14
@caguero caguero changed the title gz_waves_provider_fft: FFT backend - Part 4/4 gz_waves: FFT backend - Part 4/4 Jun 19, 2026
@caguero caguero force-pushed the caguero/waves-03-rendering branch from f4a163e to 4d50173 Compare June 19, 2026 17:33
@caguero caguero force-pushed the caguero/waves-04-fft branch from c9ba107 to aa40214 Compare June 19, 2026 17:34
@caguero caguero force-pushed the caguero/waves-03-rendering branch 2 times, most recently from 7df415e to 3a1f9b0 Compare June 22, 2026 17:20
caguero and others added 3 commits June 22, 2026 20:04
…I registrar

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Carlos Aguero <caguero@honurobotics.com>
… FFT the default in open_water.sdf

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Carlos Aguero <caguero@honurobotics.com>
Make the FFT engine build on the rebased stack and match its conventions:
- ParticleVelocity/Normal return gz::math::Vector3d (the IWaveField interface
  is now gz::math); Eigen stays internal to EncinoWaves and the grid accessors.
- std::cerr/std::cout -> gzerr/gzmsg (wire gz-common into the engine target).
- Members switch to gz-style this->member (no trailing underscore).
- Wire gz-math/gz-common into CMake + package.xml.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Carlos Agüero <caguero@honurobotics.com>
@caguero caguero force-pushed the caguero/waves-04-fft branch from aa40214 to c14f9f6 Compare June 22, 2026 18:16
…ence)

ParticleVelocity was a zero stub, so buoyancy/drag saw still water under the
FFT backend. EncinoWaves exposes no velocity field or public spectral
coefficients, so compute the Eulerian water velocity as the time derivative of
the displacement field (∂Dx/∂t, ∂Dy/∂t, ∂η/∂t): each Update propagates a
scratch state at t+dt and finite-differences it into velocity grids that
ParticleVelocity bilinear-samples. Adds two tests.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Carlos Agüero <caguero@honurobotics.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant