Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
gazebo::BuoyancyPlugin Class Reference

A plugin that simulates buoyancy of an object immersed in fluid. More...

#include <BuoyancyPlugin.hh>

Inheritance diagram for gazebo::BuoyancyPlugin:
Inheritance graph
[legend]

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, VolumePropertiesvolPropsMap
 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...
 

Detailed Description

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.

Constructor & Destructor Documentation

gazebo::BuoyancyPlugin::BuoyancyPlugin ( )

Constructor.

Member Function Documentation

virtual void gazebo::BuoyancyPlugin::Init ( )
virtual

Override this method for custom plugin initialization behavior.

Reimplemented from gazebo::ModelPlugin.

virtual void gazebo::BuoyancyPlugin::Load ( physics::ModelPtr  _model,
sdf::ElementPtr  _sdf 
)
virtual

Read the model SDF to compute volume and center of volume for each link, and store those properties in volPropsMap.

Implements gazebo::ModelPlugin.

virtual void gazebo::BuoyancyPlugin::OnUpdate ( )
protectedvirtual

Callback for World Update events.

Member Data Documentation

double gazebo::BuoyancyPlugin::fluidDensity
protected

The density of the fluid in which the object is submerged in kg/m^3.

Defaults to 1000, the fluid density of water.

physics::ModelPtr gazebo::BuoyancyPlugin::model
protected

Pointer to model containing the plugin.

physics::PhysicsEnginePtr gazebo::BuoyancyPlugin::physicsEngine
protected

Pointer to the physics engine (for accessing gravity).

sdf::ElementPtr gazebo::BuoyancyPlugin::sdf
protected

Pointer to the plugin SDF.

event::ConnectionPtr gazebo::BuoyancyPlugin::updateConnection
protected

Connection to World Update events.

std::map<int, VolumeProperties> gazebo::BuoyancyPlugin::volPropsMap
protected

Map of <link ID, point> pairs mapping link IDs to the CoV (center of volume) and volume of the link.


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