A system that simulates buoyancy of objects immersed in fluid. All SDF parameters are optional. This system must be attached to the world and this system will apply buoyancy to all links that have inertia and collision shapes. More...
#include <Buoyancy.hh>
Public Member Functions | |
Buoyancy () | |
Constructor. More... | |
~Buoyancy () override=default | |
Destructor. More... | |
void | Configure (const Entity &_entity, const std::shared_ptr< const sdf::Element > &_sdf, EntityComponentManager &_ecm, EventManager &_eventMgr) override |
Configure the system. More... | |
void | PreUpdate (const UpdateInfo &_info, EntityComponentManager &_ecm) override |
![]() | |
System ()=default | |
Constructor. More... | |
virtual | ~System ()=default |
Destructor. More... | |
Detailed Description
A system that simulates buoyancy of objects immersed in fluid. All SDF parameters are optional. This system must be attached to the world and this system will apply buoyancy to all links that have inertia and collision shapes.
The volume and center of volume will be computed for each link, and stored as components. During each iteration, Archimedes' principle is applied to each link with a volume and center of volume component.
Plane shapes are not handled by this plugin, and will not be affected by buoyancy.
System Parameters
<uniform_fluid_density>
sets the density of the fluid that surrounds the buoyant object.
Example
The buoyancy.sdf
SDF file contains three submarines. The first submarine is neutrally buoyant, the second sinks, and the third floats. To run:
Constructor & Destructor Documentation
◆ Buoyancy()
Buoyancy | ( | ) |
Constructor.
◆ ~Buoyancy()
|
overridedefault |
Destructor.
Member Function Documentation
◆ Configure()
|
overridevirtual |
Configure the system.
- Parameters
-
[in] _entity The entity this plugin is attached to. [in] _sdf The SDF Element associated with this system plugin. [in] _ecm The EntityComponentManager of the given simulation instance. [in] _eventMgr The EventManager of the given simulation instance.
Implements ISystemConfigure.
◆ PreUpdate()
|
overridevirtual |
Implements ISystemPreUpdate.
The documentation for this class was generated from the following file: