18#ifndef GAZEBO_PLUGINS_BUOYANCYPLUGIN_HH_
19#define GAZEBO_PLUGINS_BUOYANCYPLUGIN_HH_
22#include <ignition/math/Vector3.hh>
26#include "gazebo/physics/physics.hh"
37 public: ignition::math::Vector3d
cov;
70 public:
virtual void Init();
82 protected: sdf::ElementPtr
sdf;
A plugin that simulates buoyancy of an object immersed in fluid.
Definition BuoyancyPlugin.hh:61
BuoyancyPlugin()
Constructor.
virtual void Init()
Override this method for custom plugin initialization behavior.
physics::ModelPtr model
Pointer to model containing the plugin.
Definition BuoyancyPlugin.hh:79
virtual void OnUpdate()
Callback for World Update events.
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 i...
sdf::ElementPtr sdf
Pointer to the plugin SDF.
Definition BuoyancyPlugin.hh:82
event::ConnectionPtr updateConnection
Connection to World Update events.
Definition BuoyancyPlugin.hh:76
double fluidDensity
The density of the fluid in which the object is submerged in kg/m^3.
Definition BuoyancyPlugin.hh:86
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.
Definition BuoyancyPlugin.hh:90
A plugin with access to physics::Model.
Definition Plugin.hh:304
A class for storing the volume properties of a link.
Definition BuoyancyPlugin.hh:32
VolumeProperties()
Default constructor.
Definition BuoyancyPlugin.hh:34
double volume
Volume of this link.
Definition BuoyancyPlugin.hh:40
ignition::math::Vector3d cov
Center of volume in the link frame.
Definition BuoyancyPlugin.hh:37
boost::shared_ptr< Connection > ConnectionPtr
Definition CommonTypes.hh:134
boost::shared_ptr< Model > ModelPtr
Definition PhysicsTypes.hh:93
Forward declarations for the common classes.
Definition Animation.hh:27