21 #include <gazebo/common/Assert.hh> 22 #include <gazebo/physics/physics.hh> 24 #include <ignition/math/Vector2.hh> 44 public: ignition::math::Vector2d
size;
55 WavefieldEntity::~WavefieldEntity()
60 WavefieldEntity::WavefieldEntity(physics::BasePtr _parent) :
69 GZ_ASSERT(_sdf !=
nullptr,
"Invalid parameter _sdf");
75 ignition::math::Vector2d(1000, 1000));
77 ignition::math::Vector2d(50, 50));
80 gzmsg <<
"WavefieldEntity: Loading WaveParameters from SDF" << std::endl;
82 if (_sdf->HasElement(
"wave"))
84 gzmsg <<
"Found <wave> tag" << std::endl;
85 sdf::ElementPtr sdfWave = _sdf->GetElement(
"wave");
86 this->
data->waveParams->SetFromSDF(*sdfWave);
90 gzmsg <<
"Missing <wave> tag" << std::endl;
93 this->
data->waveParams->DebugPrint();
120 return this->
data->waveParams;
126 return std::string(_parentName +
"::wavefield_entity");
virtual void Update()
Update the object.
virtual void Fini()
Finialize the object.
virtual void Init()
Initialize the object.
This file defines utilities for extracting parameters from SDF.
static ignition::math::Vector2d SdfParamVector2(sdf::Element &_sdf, const std::string &_paramName, const ignition::math::Vector2d _defaultVal)
Extract a named Vector2 parameter from an SDF element.
virtual void Load(sdf::ElementPtr _sdf)
Load.
std::shared_ptr< WavefieldEntityPrivate > data
ignition::math::Vector2d cellCount
The number of grid cells in the wavefield. Default value is [50 50].
A class to manage the parameters for generating a wave.
virtual void Reset()
Reset the object.
std::shared_ptr< asv::WaveParameters > waveParams
The wave parameters.
static std::string MakeName(const std::string &_parentName)
Make a wave field entity name given a parent object name.
ignition::math::Vector2d size
The size of the wavefield. Default value is [1000 1000].
This file contains definitions for classes used to manage a wave field. This includes wave parameters...
std::shared_ptr< const WaveParameters > GetWaveParams() const
Get a pointer to the wave pararameters.
This file contains the definition for a Gazebo physics object that allows a wave field to be added in...