Skip to content

Commit

Permalink
Merge branch 'master' into demo/linear-wave-body (#83)
Browse files Browse the repository at this point in the history
* Waves: enable wave direction in the sinusoid wave model (#80)

* Waves: enable wave direction in the sinusoid wave model

- Allow wave direction to be set for regular waves.
- Add test for a wave direction not parallel to the x-axis

Signed-off-by: Rhys Mainwaring <[email protected]>

* Waves: rename monochromatic_waves model

- Rename to regular waves.

Signed-off-by: Rhys Mainwaring <[email protected]>

* Waves simulation optimisation - part 1 (#82)

* Waves: add classes for spreading functions

- Add classes for directional spreading functions.
- Add vectorised calculations using Eigen.

Signed-off-by: Rhys Mainwaring <[email protected]>

* Waves: update classes for spreading functions

- Update classes for directional spreading functions - use Eigen::MatrixXd rather than VectorXd.
- Update tests including broadcasting to arrays.

Signed-off-by: Rhys Mainwaring <[email protected]>

* Waves: add classes for omni-directional spectrum functions

- Add classes for omni-directional wave spectra.
- Add test case for vectorised spectrum calculation using Eigen.
- Add regression test and check limits (k = 0, u19 = 0)

Signed-off-by: Rhys Mainwaring <[email protected]>

* Waves: update classes for omni-directional spectrum functions

- Implement ECVK omni-directional spectra.
- Add test case for vectorised spectrum calculation using Eigen.
- Add regression test and check limits (k = 0, u10 = 0)

Signed-off-by: Rhys Mainwaring <[email protected]>

* Waves: add regression tests for spectra.

- Add regression test against spectrum calculation used in  FFT2.
- Make spectrum functions in FFT2 static.
- Add ECKV spectrum tests.

Signed-off-by: Rhys Mainwaring <[email protected]>

* Waves: fix spreading function test.

- Fix segfault caused by missing arg.

Signed-off-by: Rhys Mainwaring <[email protected]>

* Waves: remove unused wave simulation classes

- Remove FFTW and OpenCL simulation classes.

Signed-off-by: Rhys Mainwaring <[email protected]>

* Waves: reset test values after physical constant updates.

- Update buoyancy regression values after fluid density and gravity value update.

Signed-off-by: Rhys Mainwaring <[email protected]>

* Waves: fix failing static test in gz_waves_bridge

- Disable flake8 and fix docstring.

Signed-off-by: Rhys Mainwaring <[email protected]>

* Waves: replace std::vector with Eigen in WaveSimulation

- Migration from std::vector to Eigen::VectorXf. Not efficient as involved heap allocation each update.
- Replace std::vector for interface calls in OceanTile.
- Remove unused code from WaveSpectrum.

Signed-off-by: Rhys Mainwaring <[email protected]>

* Waves: fixes post cherry-pick

- Revert interface change in WaveSimulation.

Signed-off-by: Rhys Mainwaring <[email protected]>

* Waves: replace std::vector with Eigen in WaveSimulation

- Remove interface using std::vector<double> from WaveSimulation classes.
- Update waves plugin classes to use new interfaces.
- Update test

Signed-off-by: Rhys Mainwaring <[email protected]>

* Waves: replace std::vector with Eigen in WaveSimulation

- Remove internal interface using std::vector<double> from WaveSimulation classes.
- Update tests

Signed-off-by: Rhys Mainwaring <[email protected]>

* Waves: replace std::vector with Eigen in FFT WaveSimulation

- Remove internal interface using std::vector<double> from WaveSimulation classes.

Signed-off-by: Rhys Mainwaring <[email protected]>

* Waves: correct typos in derivative calculations for sinusoid and
trochoid waves

- Ensure Eigen vector workspace is initialised in WavesVisual.

Signed-off-by: Rhys Mainwaring <[email protected]>

* Waves: visual lighting workaround

- Tangent space calculation not correct - environment mapping looks incorrect unless dhdx <---> dhdx?

Signed-off-by: Rhys Mainwaring <[email protected]>

* Waves: update sinusoid wave interface

- Allow x and y to be set independently in wave grid.
- Streamline class declarations.
- Update tests.
- Add vectorise option for sinusoid waves.

Signed-off-by: Rhys Mainwaring <[email protected]>

* Waves: remove unused functions.

Signed-off-by: Rhys Mainwaring <[email protected]>

* Waves: add tests for vectorised sinusoid wave sim

- Cross check vectorised code against non-vectorised version.

Signed-off-by: Rhys Mainwaring <[email protected]>

* Waves: remove unused include from WaveSimulationSinusoid

Signed-off-by: Rhys Mainwaring <[email protected]>

* Waves: refactor WaveSimulation method names.

- Rename ComputeHeights to ComputeElevation.

Signed-off-by: Rhys Mainwaring <[email protected]>

* Waves: refactor update indentation formatting.

- Add vectorisation method to FFT wave simulation.

Signed-off-by: Rhys Mainwaring <[email protected]>

* Waves: refactor update member variable names in FFT wave simulation

- Standardise caps convention for naming member variables (using underscores).
- Update interface to allow different nx and ny for grid.

Signed-off-by: Rhys Mainwaring <[email protected]>

* Waves: temp workaround for wave derivatives used in lighting tangent space

- Workaround mixed conventions for matrix-ij vs matrix-xy storage in tangent space calcs.

Signed-off-by: Rhys Mainwaring <[email protected]>

Signed-off-by: Rhys Mainwaring <[email protected]>

* Waves simulation optimisation - part 2 (#84)

* Waves: update FFT wave simulation tests for non-square grids (nx != ny)

Signed-off-by: Rhys Mainwaring <[email protected]>

* Waves: apply google coding standards

Signed-off-by: Rhys Mainwaring <[email protected]>

* Waves: apply google coding standards

Signed-off-by: Rhys Mainwaring <[email protected]>

* Waves: apply google coding standards

Signed-off-by: Rhys Mainwaring <[email protected]>

* Waves: apply google coding standards

Signed-off-by: Rhys Mainwaring <[email protected]>

* Waves: apply google coding standards

Signed-off-by: Rhys Mainwaring <[email protected]>

* Waves: apply google coding standards

Signed-off-by: Rhys Mainwaring <[email protected]>

* Waves: update FFT test namesWaves

Signed-off-by: Rhys Mainwaring <[email protected]>

* Waves: preparation for vectorising FFT wave simulation update

- Add placeholders for vectorised versions of functions
- Replace hardcoded gravity constants with params.

Signed-off-by: Rhys Mainwaring <[email protected]>

* Waves: preparation for vectorising FFT wave simulation update

- Add cross-check tests for vectorised versions of base and current amplitude calculations.

Signed-off-by: Rhys Mainwaring <[email protected]>

* Waves: progress vectorising FFT wave simulation update

- Change capitalisation of Cos2sSpreadingFunction.
- Update comments in WaveSpectrum.
- WaveSimulationFFT
 	- Consolidate initialisation code.
	- Update variable names (nyquist)
	- Delay allocation of storage for Eigen member variables.
	- Update tests to use nearest for cross checks on vectorised version.
	- Remove use of auto for Eigen references (use Eigen::Ref instead)
	- Factor out wavenumber initialisation.
	- Partial vectorisation.

Signed-off-by: Rhys Mainwaring <[email protected]>

* Waves: vectorise base amplitude calc for FFT wave simulation

- Leave initialisation of IID random normals un-vectorised for testing against original versions.

Signed-off-by: Rhys Mainwaring <[email protected]>

* Waves: add unit test for Eigen and FFTW

- Add test skeleton.

Signed-off-by: Rhys Mainwaring <[email protected]>

* Waves: add unit test for Eigen and FFTW

- Add examples using different storage choices.

Signed-off-by: Rhys Mainwaring <[email protected]>

* Waves: add unit test for Eigen and FFTW

- Add examples for row vs column major storage.

Signed-off-by: Rhys Mainwaring <[email protected]>

* Waves: add Eigen alignment macro

Signed-off-by: Rhys Mainwaring <[email protected]>

* Waves: use Eigen types for FFTW storage - reduce copies

- Use Eigen types instead of fftw_complex* for FFT workspace.

Signed-off-by: Rhys Mainwaring <[email protected]>

* Waves: remove unused code from FFWT wave simulation

Signed-off-by: Rhys Mainwaring <[email protected]>

* Waves: use row-major Eigen matrix storage for FFT wave simulation

- Intermediate step moving from Eigen::VectorXcd to Eigen::MatrixXcdRowMajor.
- FFTW requires row-major ordering, Eigen is column major by default.

Signed-off-by: Rhys Mainwaring <[email protected]>

* Waves: use row-major Eigen matrix storage for FFT wave simulation

- Change to matrix indexing in FFT wave storage (from a single column).

Signed-off-by: Rhys Mainwaring <[email protected]>

* Waves: update output mapping from row to col major storage in FFT wave simulation

- Replace loops with vector calls using reshaped to flatten.

Signed-off-by: Rhys Mainwaring <[email protected]>

* Set up CI using GitHub Actions (#85)

- CI: remove travis integration
- Add codeowners and gazebo ci.yml
- Minimal version - checkout only.
- Change checkout actions/checkout@v3
- Add CI workflows for ubuntu and macos
- Rename and split macOS into separate workflow.
- Install Gazebo Garden.
- Test caching
- Add brew install script.
- Add build script.
- Update macos-ci
- Add test step.
- Add GitHub Actions status badge, remove travis badges.
- Update ci install scripts
- Update the brew installation script to force relinking on all dependencies of the installed packages.
- Fix relink step.
- Update ubunti-ci workflow.
- Add install, build and test steps.
- Rename macos scripts.
- Update ubunti-ci workflow.
- Install additional build dependencies.
- Update ubunti-ci workflow.
- Fix colcon build command line.
- Move macOS to colcon build.
- Update workflow for ubuntu 20.04
- Ensure cgal etc are linked as well as deps.
- Split Ubuntu jobs to separate workflow
- Update macos workflow - add build tools
- Fix EigenFFTW breaking on Ubuntu.
- Update macos workflow - reenable build and test
- Fix timer in CGAL test and disable triangulation tests failing on Ubuntu.
- Fix errors in WaveSimulationFFT2 tests and set tolerances for variance comparisons.
- Check colcon install on macOS workflow
- Disable trochoid wave test
- Investigate why colcon not found in macOS CI workflow
- Add workflow to check build tools are installed.
- Use pip3
- Use full path to colcon
- Add pip install checks
- Update path to Python scripts
- Update path to Python scripts
- Pip install colcon and vcstool with --user flag

Signed-off-by: Rhys Mainwaring <[email protected]>

* Waves simulation optimisation - part 3 (#87)

* Waves: optimise current amplitude calculation for FFT wave simulation

- Investigate optimisation options for the current amplitude calculation.
- vectorised assignment to fft worlspace is not faster than a single loop.
- pre-calculate the fourier amplitude coefficients (reduce index lookup) - marginal gain?

Signed-off-by: Rhys Mainwaring <[email protected]>

* Waves: label indices in ocean tile to distinguish between vertex indices and wave indices

- Vertex array index: v_idx_cm: v - vertex, cm - column major
- Wave array index: w_idx_cm: v - vertex, cm - column major
- Wave array index: w_idx_rm: v - vertex, rm - row major

Signed-off-by: Rhys Mainwaring <[email protected]>

* CI: only run macOS workflow on PR

Signed-off-by: Rhys Mainwaring <[email protected]>

* Waves: rename FFT wave simulation class

Signed-off-by: Rhys Mainwaring <[email protected]>

* Waves: duplicate FFT wave simulation class to factor out reference version

Signed-off-by: Rhys Mainwaring <[email protected]>

* Waves: duplicate FFT wave simulation class to factor out reference version

- Complete split of reference implementation into separate class.
- Remove unused code from the separated FFT wave simulation classes.

Signed-off-by: Rhys Mainwaring <[email protected]>

* Waves: remove commented code

- Remove code referring to reference versions of the spectrum calculations.

Signed-off-by: Rhys Mainwaring <[email protected]>

* Waves: add performance checks for spectrum and FFT amplitude calculations

- Initial performance tests. Contain debugging and timing info.
- Eigen component-wise array versions are not performant...

Signed-off-by: Rhys Mainwaring <[email protected]>

* Waves: replace slow array versions of spectrum calcs.

- Eigen component-wise array versions are not performant - replace with calls using std::transform on unary / binary versions.

Signed-off-by: Rhys Mainwaring <[email protected]>

* Waves: refactor wave simulation and spectrum test names

- Functions are not truly vectorised - use Eigen array type to label tests instead.

Signed-off-by: Rhys Mainwaring <[email protected]>

* Waves: satisfy Eigen check that range iterators in STL algorithms are from the same expression.

Signed-off-by: Rhys Mainwaring <[email protected]>

* Waves simulation optimisation - part 4 (#88)

* Waves: restructure wave spectrum performance test for instrumenting

- Move initialisation into test fixture

Signed-off-by: Rhys Mainwaring <[email protected]>

* Waves: remove c-wise amplitude update

- Remove inefficient component wise amplitude update and associated data.

Signed-off-by: Rhys Mainwaring <[email protected]>

* Waves: remove c-wise cos / sin update in current amplitude calc

- Remove inefficient component wise amplitude update.

Signed-off-by: Rhys Mainwaring <[email protected]>

* Waves: restructure FFT wave amplitude performance test for instrumenting

- Move initialisation into test fixture.

Signed-off-by: Rhys Mainwaring <[email protected]>

* Waves: update FFT wave simulation

- Consolidate storage (shape depends whether loop is flattened or not).
-  Make test fixture class names consistent.
- Remove array allocation in current amplitude update

Signed-off-by: Rhys Mainwaring <[email protected]>

* Waves: use previously calculated wave numbers

Signed-off-by: Rhys Mainwaring <[email protected]>

* Waves: remove two loops from FFT base amplitude calculation

Signed-off-by: Rhys Mainwaring <[email protected]>

* Waves: remove component-wise array amplitude calculations

- Abandon using c-wise amplitude calculations as the loop based update has better performance.
- Remove unnecessary storage from the FFT class to reduce memory footprint.

Signed-off-by: Rhys Mainwaring <[email protected]>

* Waves: remove WaveSimulationFFTRef from public interface

Signed-off-by: Rhys Mainwaring <[email protected]>

* Waves: add performance checks for elevation and displacement calculations

- Add performance check for main update loop - elevations, displacements and derivatives.

Signed-off-by: Rhys Mainwaring <[email protected]>

* Waves simulation optimisation - part 5 (#89)

* Waves: update FFTW check

- Modify check to transform hermitian amplitudes back to real values.

Signed-off-by: Rhys Mainwaring <[email protected]>

* Waves: create FFTW plans before initialising arrays

- FFTW may overwrite data in arrays while planning. Allocate, plan, initialise.

Signed-off-by: Rhys Mainwaring <[email protected]>

* Waves: use complex to real version of FFTW

- Change outputs to real arrays.
- Change size of input complex arrays to nx * ny/2+1
- Output in Compute* functions is now real.
- Add example in the Eigen FFTW test using a c2r plan.

Signed-off-by: Rhys Mainwaring <[email protected]>

* Waves: use complex to real version of FFTW

- Flattened index must be calculated as loops do not cover full range.

Signed-off-by: Rhys Mainwaring <[email protected]>

* Waves: use complex to real version of FFTW

- Disable hermitian tests for optimised FFT wave sim (arrays truncated using symmetry)

Signed-off-by: Rhys Mainwaring <[email protected]>

* Waves: temp disable tests broken because of switch to real DFT

The following tests require further review - restructuring
- ParsevalsIdentityTimeZero
- ParsevalsIdentityTimeNonZero
- Displacement

Signed-off-by: Rhys Mainwaring <[email protected]>

* Waves: additional Hermitian tests

- Add placeholder tests to check derivative and displacement amplitudes are Hermitian.

Signed-off-by: Rhys Mainwaring <[email protected]>

* Waves: fix Hermitian symmetry for derivatives (#90)

- Correct Nyquist term in derivative amplitudes (must be zero).
- Enable tests to check derivative and displacement amplitudes are Hermitian.

Signed-off-by: Rhys Mainwaring <[email protected]>

* CI: clean build warnings (#91)

* CI: enable all warnings and enforce as errors

- Clean build of all warnings.
- Disable unused variables from tests (primarily present for printing info).
- Comment unused parameters in function sigs.
- Fix int type comparison warnings in loops.
- Fix initialisation order errors in constructors.

Signed-off-by: Rhys Mainwaring <[email protected]>

* CI: enable all warnings and enforce as errors

- Remove GZ_ASSERT raising a warning on Ubuntu

Signed-off-by: Rhys Mainwaring <[email protected]>

* CI: enable all warnings and enforce as errors

- Renaming shadowing variables.

Signed-off-by: Rhys Mainwaring <[email protected]>

* Wave Body: update cmake dependencies

- Use FetchContent to retrieve dependency HighFive.
- Fix typo in documentation.
- Remove cpp style header for mlinterp

Signed-off-by: Rhys Mainwaring <[email protected]>

* Wave Body: update ci workflow

- Add build flag for HighFive dependency

Signed-off-by: Rhys Mainwaring <[email protected]>

* Wave Body: update waves bridge tests

- Remove breaking tests inherited from ROS project template.

Signed-off-by: Rhys Mainwaring <[email protected]>
  • Loading branch information
srmainwaring authored Nov 25, 2022
1 parent 65883fb commit 8f12948
Show file tree
Hide file tree
Showing 82 changed files with 6,760 additions and 4,863 deletions.
7 changes: 7 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# CODEOWNERS
#
# https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners

# These owners will be the default owners for everything in
# the repo. Unless a later match takes precedence.
* @srmainwaring
53 changes: 53 additions & 0 deletions .github/scripts/brew_install_deps.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#!/bin/bash

# See the Jenkins script in gazebo-tooling/release-tools
# https://github.com/gazebo-tooling/release-tools/blob/master/jenkins-scripts/lib/project-default-devel-homebrew-amd64.bash

# Run brew update to get latest versions of formulae
brew update

# Don't let brew auto-update any more for this session
# to ensure consistency
export HOMEBREW_NO_AUTO_UPDATE=1
export HOMEBREW_NO_INSTALL_UPGRADE=1

# Run brew config to print system information
# brew config

# Run brew doctor to check for problems with the system
# brew doctor || echo MARK_AS_UNSTABLE

# get the osrf tap for gazebo
brew tap osrf/simulation

# packages to install
PKGS=(
gz-garden
cgal
fftw
)

# install packages
for PKG in "${PKGS[@]}"
do
brew install ${PKG}
done

# The GitHub actions cache does restore links, so we force
# (re-)linking on all dependencies of packages we install.

for PKG in "${PKGS[@]}"
do
# link package
brew link $PKG

DEPS=$(brew deps ${PKG})
declare -a DEPS_ARRAY
DEPS_ARRAY=(${DEPS})

for DEP_PKG in "${DEPS_ARRAY[@]}"
do
# link package dependencies
brew link $DEP_PKG
done
done
16 changes: 16 additions & 0 deletions .github/scripts/macos_build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

# Configure build dependencies
# https://gazebosim.org/docs/garden/install_osx_src#install-dependencies

# [email protected]
export CMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}:/usr/local/opt/[email protected]
export DYLD_FALLBACK_LIBRARY_PATH=${DYLD_FALLBACK_LIBRARY_PATH}:/usr/local/opt/[email protected]/lib:/usr/local/opt/octomap/local
export PKG_CONFIG_PATH=${PKG_CONFIG_PATH}:/usr/local/opt/[email protected]/lib/pkgconfig
# qt5
export CMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}:/usr/local/opt/qt@5

# Python scripts installed with: `pip3 install --user <package>`
export PATH=$PATH:$HOME/Library/Python/3.11/bin

colcon build --symlink-install --merge-install --cmake-args -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_TESTING=ON -DCMAKE_CXX_STANDARD=17 -DCMAKE_MACOSX_RPATH=FALSE -DCMAKE_INSTALL_NAME_DIR=$(pwd)/install/lib -DHIGHFIVE_USE_EIGEN=ON
7 changes: 7 additions & 0 deletions .github/scripts/macos_test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

# Python scripts installed with: `pip3 install --user <package>`
export PATH=$PATH:$HOME/Library/Python/3.11/bin

colcon test --merge-install
colcon test-result --all --verbose
24 changes: 24 additions & 0 deletions .github/workflows/macos-monterey-build-tools.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: macOS Monterey Build Tools

on: [push, pull_request]

jobs:
macos-monterey-ci:
runs-on: macos-12
name: macOS Monterey Build Tools
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install Build Tools
run: |
pip3 install --user vcstool
pip3 install --user colcon-common-extensions
- name: Check Build Tools
run: |
which pip3
which python3
python3 --version
export PATH=$PATH:/Users/runner/Library/Python/3.11/bin
colcon graph
42 changes: 42 additions & 0 deletions .github/workflows/macos-monterey-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: macOS Monterey CI

on: [pull_request]

jobs:
macos-monterey-ci:
runs-on: macos-12
name: macOS Monterey CI
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Cache brew packages
id: cache-brew-packages
uses: actions/cache@v3
with:
path: |
/usr/local/Cellar
/usr/local/Frameworks
/usr/local/Homebrew
/usr/local/bin
/usr/local/lib
/usr/local/opt
/usr/local/share
key: macos-build-cache-${{ hashFiles('./.github/scripts/brew_install_deps.sh') }}

- name: Install brew packages
run: |
bash ./.github/scripts/brew_install_deps.sh
- name: Install Build Tools
run: |
python3 -m pip install --user vcstool
python3 -m pip install --user colcon-common-extensions
- name: Build Wave Sim
run: |
bash ./.github/scripts/macos_build.sh
- name: Test Wave Sim
run: |
bash ./.github/scripts/macos_test.sh
46 changes: 46 additions & 0 deletions .github/workflows/ubuntu-focus-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Ubuntu Focus CI

on: [push, pull_request]

jobs:
ubuntu-focus-ci:
runs-on: ubuntu-20.04
name: Ubuntu Focus CI
steps:
- name: Checkout
uses: actions/checkout@v3
with:
path: src

- name: Install Build Essentials
run: |
sudo apt-get update
sudo apt-get install wget lsb-release gnupg curl
- name: Install Build Tools
run: |
sudo sh -c 'echo "deb http://packages.ros.org/ros2/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros2-latest.list'
curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add -
sudo apt-get update
sudo apt-get install python3-pip python3-vcstool python3-colcon-common-extensions
- name: Install Gazebo Garden
run: |
sudo wget https://packages.osrfoundation.org/gazebo.gpg -O /usr/share/keyrings/pkgs-osrf-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/pkgs-osrf-archive-keyring.gpg] http://packages.osrfoundation.org/gazebo/ubuntu-stable $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/gazebo-stable.list > /dev/null
sudo apt-get update
sudo apt-get install gz-garden
- name: Install Wave Sim Dependencies
run: |
sudo apt-get update
sudo apt-get install libcgal-dev libfftw3-dev libtbb-dev
- name: Build Wave Sim
run: |
colcon build --symlink-install --merge-install --cmake-args -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_CXX_STANDARD=17 -DBUILD_TESTING=ON -DHIGHFIVE_USE_EIGEN=ON
- name: Test Wave Sim
run: |
colcon test --merge-install
colcon test-result --all --verbose
47 changes: 47 additions & 0 deletions .github/workflows/ubuntu-jammy-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Ubuntu Jammy CI

on: [push, pull_request]

jobs:
ubuntu-jammy-ci:
runs-on: ubuntu-22.04
name: Ubuntu Jammy CI
steps:
- name: Checkout
uses: actions/checkout@v3
with:
path: src

- name: Install Build Essentials
run: |
sudo apt-get update
sudo apt-get install wget lsb-release gnupg curl
- name: Install Build Tools
run: |
sudo sh -c 'echo "deb http://packages.ros.org/ros2/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros2-latest.list'
curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add -
sudo apt-get update
sudo apt-get install python3-pip python3-vcstool python3-colcon-common-extensions
- name: Install Gazebo Garden
run: |
sudo wget https://packages.osrfoundation.org/gazebo.gpg -O /usr/share/keyrings/pkgs-osrf-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/pkgs-osrf-archive-keyring.gpg] http://packages.osrfoundation.org/gazebo/ubuntu-stable $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/gazebo-stable.list > /dev/null
sudo apt-get update
sudo apt-get install gz-garden
- name: Install Wave Sim Dependencies
run: |
sudo apt-get update
sudo apt-get install libcgal-dev libfftw3-dev libtbb-dev
- name: Build Wave Sim
run: |
colcon build --symlink-install --merge-install --cmake-args -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_CXX_STANDARD=17 -DBUILD_TESTING=ON -DHIGHFIVE_USE_EIGEN=ON
colcon build --symlink-install --merge-install --cmake-args -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_CXX_STANDARD=17 -DBUILD_TESTING=ON
- name: Test Wave Sim
run: |
colcon test --merge-install
colcon test-result --all --verbose
Empty file removed .travis.rosinstall
Empty file.
32 changes: 0 additions & 32 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion LinearWaveBodyModel.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ to store and access the coefficients, the build command must be modified
slightly:

```zsh
olcon build --symlink-install --merge-install --cmake-args -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_TESTING=ON -DCMAKE_CXX_STANDARD=17 -DCMAKE_MACOSX_RPATH=FALSE -DCMAKE_INSTALL_NAME_DIR=$(pwd)/install/lib -DHIGHFIVE_USE_EIGEN=ON --packages-select gz-waves1
colcon build --symlink-install --merge-install --cmake-args -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_TESTING=ON -DCMAKE_CXX_STANDARD=17 -DCMAKE_MACOSX_RPATH=FALSE -DCMAKE_INSTALL_NAME_DIR=$(pwd)/install/lib -DHIGHFIVE_USE_EIGEN=ON --packages-select gz-waves1
```

where the flag `DHIGHFIVE_USE_EIGEN` allows the hdf5 datasets to be read into
Expand Down
20 changes: 4 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Gazebo Waves

<!-- [![Ubuntu Focus CI](https://github.com/srmainwaring/asv_wave_sim/actions/workflows/ubuntu-focus-ci.yml/badge.svg)](https://github.com/srmainwaring/asv_wave_sim/actions/workflows/ubuntu-focus-ci.yml) -->
[![Ubuntu Jammy CI](https://github.com/srmainwaring/asv_wave_sim/actions/workflows/ubuntu-jammy-ci.yml/badge.svg)](https://github.com/srmainwaring/asv_wave_sim/actions/workflows/ubuntu-jammy-ci.yml)
[![macOS Monterey CI](https://github.com/srmainwaring/asv_wave_sim/actions/workflows/macos-monterey-ci.yml/badge.svg)](https://github.com/srmainwaring/asv_wave_sim/actions/workflows/macos-monterey-ci.yml)

This package contains plugins that support the simulation of waves and surface vessels in [Gazebo](https://gazebosim.org/home).

![Gazebo Waves](https://github.com/srmainwaring/asv_wave_sim/wiki/images/gz-waves-v5b.jpg)
Expand Down Expand Up @@ -389,22 +393,6 @@ $ cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_TESTING=ON
$ make && make test
```

## Build Status

### Develop Job Status

| | Melodic |
|--- |--- |
| asv_wave_sim | [![Build Status](https://travis-ci.com/srmainwaring/asv_wave_sim.svg?branch=feature%2Ffft_waves)](https://travis-ci.com/srmainwaring/asv_wave_sim) |


### Release Job Status

| | Melodic |
|--- |--- |
| asv_wave_sim | [![Build Status](https://travis-ci.com/srmainwaring/asv_wave_sim.svg?branch=master)](https://travis-ci.com/srmainwaring/asv_wave_sim) |


## License

This is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
Expand Down
6 changes: 3 additions & 3 deletions gz-waves-models/world_models/regular_waves_3s_1m/model.config
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

<?xml version='1.0'?>
<model>
<name>Regular Waves 3s 1m</name>
<name>Regular Waves</name>
<version>1.0</version>
<sdf version='1.6'>model.sdf</sdf>

Expand All @@ -11,8 +11,8 @@
</author>

<description>
Regular surface waves T=3s, H=1m.

Regular surface waves. i.e. plane progressive waves of a single frequency.
This model uses the materials from the `waves`
model to prevent duplicating the large mesh files.
</description>
Expand Down
10 changes: 10 additions & 0 deletions gz-waves/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)

gz_configure_project()

#============================================================================
# Include cmake
#============================================================================

include(${PROJECT_SOURCE_DIR}/cmake/URL.conf.cmake)

list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)

#============================================================================
# Set project-specific options
#============================================================================
Expand All @@ -27,6 +35,8 @@ gz_configure_project()
# Search for project-specific dependencies
#============================================================================

include(Add_HighFive)

#--------------------------------------
# Find gz-math
gz_find_package(gz-math7 REQUIRED COMPONENTS eigen3)
Expand Down
11 changes: 11 additions & 0 deletions gz-waves/cmake/Add_HighFive.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
include(FetchContent)

FetchContent_Declare(
HighFive
GIT_REPOSITORY ${HighFive_URL}
GIT_TAG ${HighFive_TAG}
)

FetchContent_MakeAvailable(HighFive)


6 changes: 6 additions & 0 deletions gz-waves/cmake/URL.conf.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

# Declare the PATH, TAG and PATCH used by FetchContent

# HighFive: tag v2.6.2
set(HighFive_URL https://github.com/BlueBrain/HighFive.git)
set(HighFive_TAG 577a2552357ddd9ba9ed412452ea5406747033b4 CACHE STRING "HighFive version")
Loading

0 comments on commit 8f12948

Please sign in to comment.