Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
asv::WavefieldModelPlugin Class Reference

A Gazebo model plugin to simulate water waves. More...

#include <WavefieldModelPlugin.hh>

Inheritance diagram for asv::WavefieldModelPlugin:
Inheritance graph
[legend]

Public Member Functions

void Fini ()
 
void Init ()
 
void Load (gazebo::physics::ModelPtr _model, sdf::ElementPtr _sdf)
 
void Reset ()
 
 WavefieldModelPlugin ()
 Constructor. More...
 
virtual ~WavefieldModelPlugin ()
 Destructor. More...
 

Static Public Member Functions

static std::shared_ptr< const WaveParametersGetWaveParams (gazebo::physics::WorldPtr _world, const std::string &_waveModelName)
 Retrive a pointer to the wavefield parameters from the Wavefield plugin. More...
 

Private Member Functions

void OnUpdate ()
 Callback for World Update events. More...
 

Private Attributes

std::shared_ptr< WavefieldModelPluginPrivatedata
 

Detailed Description

A Gazebo model plugin to simulate water waves.

Usage

Add the SDF for the plugin to the <model> element of your wave model.

<plugin name="wavefield" filename="libWavefieldModelPlugin.so">
<static>false</static>
<update_rate>30</update_rate>
<size>1000 1000</size>
<cell_count>50 50</cell_count>
<wave>
<number>3</number>
<scale>1.5</scale>
<angle>0.4</angle>
<steepness>1.0</steepness>
<amplitude>0.4</amplitude>
<period>8.0</period>
<direction>1 1</direction>
</wave>
</plugin>

Parameters

  1. <static> (bool, default: false) Create a static wave field if set to true.
  2. <update_rate> (double, default: 30.0) The rate in Hz at which the wavefield is updated.
  3. <size> (Vector2D, default: (1000 1000)) A two component vector for the size of the wave field in each direction.
  4. <cell_count> (int, default: (50 50)) A two component vector for the number of grid cells in each direction.
  5. <number> (int, default: 1) The number of component waves.
  6. <scale> (double, default: 2.0) The scale between the mean and largest / smallest component waves.
  7. <angle> (double, default: 2*pi/10) The angle between the mean wave direction and the largest / smallest component waves.
  8. <steepness> (double, default: 1.0) A parameter in [0, 1] controlling the wave steepness with 1 being steepest.
  9. <amplitude> (double, default: 0.0) The amplitude of the mean wave in [m].
  10. <period> (double, default: 1.0) The period of the mean wave in [s].
  11. <phase> (double, default: 0.0) The phase of the mean wave.
  12. <direction> (Vector2D, default: (1 0)) A two component vector specifiying the direction of the mean wave.
  13. <model> (string, default: default) The model used to generate component waves. Should be either "PMS" or "CWR"
  14. <gain> (double, default: 1.0) For PMS, the multiplier applied to component amplitudes.
  15. <tau> (double, default: 1.0) Time constant used to gradually increase wavefield at startup.

Definition at line 114 of file WavefieldModelPlugin.hh.

Constructor & Destructor Documentation

asv::WavefieldModelPlugin::~WavefieldModelPlugin ( )
virtual

Destructor.

Definition at line 69 of file WavefieldModelPlugin.cc.

asv::WavefieldModelPlugin::WavefieldModelPlugin ( )

Constructor.

Definition at line 78 of file WavefieldModelPlugin.cc.

Member Function Documentation

void asv::WavefieldModelPlugin::Fini ( )

Definition at line 128 of file WavefieldModelPlugin.cc.

std::shared_ptr< const WaveParameters > asv::WavefieldModelPlugin::GetWaveParams ( gazebo::physics::WorldPtr  _world,
const std::string &  _waveModelName 
)
static

Retrive a pointer to the wavefield parameters from the Wavefield plugin.

Parameters
_worldA pointer to the world containing the wave field.
_waveModelNameThe name of the wavefield model containing the wave field.
Returns
A valid pointer to WaveParameters if found and nullptr if not.

Definition at line 170 of file WavefieldModelPlugin.cc.

void asv::WavefieldModelPlugin::Init ( )

Definition at line 120 of file WavefieldModelPlugin.cc.

void asv::WavefieldModelPlugin::Load ( gazebo::physics::ModelPtr  _model,
sdf::ElementPtr  _sdf 
)

Definition at line 84 of file WavefieldModelPlugin.cc.

void asv::WavefieldModelPlugin::OnUpdate ( )
private

Callback for World Update events.

internal

Definition at line 142 of file WavefieldModelPlugin.cc.

void asv::WavefieldModelPlugin::Reset ( )

Definition at line 132 of file WavefieldModelPlugin.cc.

Member Data Documentation

std::shared_ptr<WavefieldModelPluginPrivate> asv::WavefieldModelPlugin::data
private

Definition at line 150 of file WavefieldModelPlugin.hh.


The documentation for this class was generated from the following files:


wave_gazebo_plugins
Author(s): Rhys Mainwaring
autogenerated on Thu May 7 2020 03:54:44