A plugin that simulates buoyancy of an object immersed in fluid. More...
#include <BuoyancyPlugin.hh>
Public Member Functions | |
BuoyancyPlugin () | |
Constructor. More... | |
virtual void | Init () |
Override this method for custom plugin initialization behavior. More... | |
virtual void | Load (physics::ModelPtr _model, sdf::ElementPtr _sdf) |
Read the model SDF to compute volume and center of volume for each link, and store those properties in volPropsMap. More... | |
Public Member Functions inherited from gazebo::ModelPlugin | |
ModelPlugin () | |
Constructor. More... | |
virtual | ~ModelPlugin () |
Destructor. More... | |
virtual void | Reset () |
Override this method for custom plugin reset behavior. More... | |
Public Member Functions inherited from gazebo::PluginT< ModelPlugin > | |
PluginT () | |
Constructor. More... | |
virtual | ~PluginT () |
Destructor. More... | |
std::string | GetFilename () const |
Get the name of the handler. More... | |
std::string | GetHandle () const |
Get the short name of the handler. More... | |
PluginType | GetType () const |
Returns the type of the plugin. More... | |
Protected Member Functions | |
virtual void | OnUpdate () |
Callback for World Update events. More... | |
Protected Attributes | |
double | fluidDensity |
The density of the fluid in which the object is submerged in kg/m^3. More... | |
physics::ModelPtr | model |
Pointer to model containing the plugin. More... | |
physics::PhysicsEnginePtr | physicsEngine |
Pointer to the physics engine (for accessing gravity). More... | |
sdf::ElementPtr | sdf |
Pointer to the plugin SDF. More... | |
event::ConnectionPtr | updateConnection |
Connection to World Update events. More... | |
std::map< int, VolumeProperties > | volPropsMap |
Map of <link ID, point> pairs mapping link IDs to the CoV (center of volume) and volume of the link. More... | |
Protected Attributes inherited from gazebo::PluginT< ModelPlugin > | |
std::string | filename |
Path to the shared library file. More... | |
std::string | handleName |
Short name. More... | |
PluginType | type |
Type of plugin. More... | |
Additional Inherited Members | |
Public Types inherited from gazebo::PluginT< ModelPlugin > | |
typedef boost::shared_ptr < ModelPlugin > | TPtr |
plugin pointer type definition More... | |
Static Public Member Functions inherited from gazebo::PluginT< ModelPlugin > | |
static TPtr | Create (const std::string &_filename, const std::string &_name) |
a class method that creates a plugin from a file name. More... | |
A plugin that simulates buoyancy of an object immersed in fluid.
All SDF parameters are optional. <fluid_density> sets the density of the fluid that surrounds the buoyant object. <link> elements describe the volume properties of individual links in the model. For example: <link name="body"> <center_of_volume>1 2 3</center_of_volume> <volume>50</volume> </link> <center_of_volume> A point representing the volumetric center of the link in the link frame. This is where the buoyancy force will be applied. <volume> The volume of the link in kg/m^3. If center of volume and volume are not specified, the plugin will attempt to compute these properties from the link collision shapes. This computation will not be accurate if the object is not composed of simple collision shapes.
gazebo::BuoyancyPlugin::BuoyancyPlugin | ( | ) |
Constructor.
|
virtual |
Override this method for custom plugin initialization behavior.
Reimplemented from gazebo::ModelPlugin.
|
virtual |
Read the model SDF to compute volume and center of volume for each link, and store those properties in volPropsMap.
Implements gazebo::ModelPlugin.
|
protectedvirtual |
Callback for World Update events.
|
protected |
The density of the fluid in which the object is submerged in kg/m^3.
Defaults to 1000, the fluid density of water.
|
protected |
Pointer to model containing the plugin.
|
protected |
Pointer to the physics engine (for accessing gravity).
|
protected |
Pointer to the plugin SDF.
|
protected |
Connection to World Update events.
|
protected |
Map of <link ID, point> pairs mapping link IDs to the CoV (center of volume) and volume of the link.