Ignition Gazebo

API Reference

3.5.0
Buoyancy Class Reference

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
 
- Public Member Functions inherited from System
 System ()
 Constructor. More...
 
virtual ~System ()
 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:

ign gazebo -v 4 buoyancy.sdf

Constructor & Destructor Documentation

◆ Buoyancy()

Buoyancy ( )

Constructor.

◆ ~Buoyancy()

~Buoyancy ( )
overridedefault

Destructor.

Member Function Documentation

◆ Configure()

void Configure ( const Entity _entity,
const std::shared_ptr< const sdf::Element > &  _sdf,
EntityComponentManager _ecm,
EventManager _eventMgr 
)
overridevirtual

Configure the system.

Parameters
[in]_entityThe entity this plugin is attached to.
[in]_sdfThe SDF Element associated with this system plugin.
[in]_ecmThe EntityComponentManager of the given simulation instance.
[in]_eventMgrThe EventManager of the given simulation instance.

Implements ISystemConfigure.

◆ PreUpdate()

void PreUpdate ( const UpdateInfo _info,
EntityComponentManager _ecm 
)
overridevirtual

Implements ISystemPreUpdate.


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