controls  3.0.0
Public Member Functions | List of all members
BuoyancyController Class Reference

Controller that compensates for buoyancy and gravity restoring forces. More...

#include <BuoyancyController.h>

Inheritance diagram for BuoyancyController:
BaseControllerInterface

Public Member Functions

void reset () override
 Resets the adaptive buoyancy bias to zero. More...
 
Vector6d getForce (const State &goal, const State &curr, double dt) override
 Computes the total buoyancy compensation force. More...
 
void saveBias ()
 Saves the current adaptive bias for later restoration. More...
 
void loadBias ()
 Restores the adaptive bias from the most recent saved snapshot. More...
 
double getBias () const
 Returns the current adaptive bias value in Newtons. More...
 
 BaseControllerInterface ()=default
 
 BaseControllerInterface (std::shared_ptr< SystemDynamicsBase > auv, std::shared_ptr< ControllerConfig > config)
 Constructs a controller with the given dynamics model and config. More...
 
- Public Member Functions inherited from BaseControllerInterface
 BaseControllerInterface ()=default
 
 BaseControllerInterface (std::shared_ptr< SystemDynamicsBase > auv, std::shared_ptr< ControllerConfig > config)
 Constructs a controller with the given dynamics model and config. More...
 
virtual ~BaseControllerInterface ()=default
 

Additional Inherited Members

- Protected Attributes inherited from BaseControllerInterface
std::shared_ptr< SystemDynamicsBaseauv_
 Vehicle dynamics model shared with all controllers in a stack. More...
 
std::shared_ptr< ControllerConfigconfig_
 Tuning parameters shared with all controllers in a stack. More...
 

Detailed Description

Controller that compensates for buoyancy and gravity restoring forces.

Produces two additive components:

  1. Static model-based compensation — the gravitational/buoyancy restoring wrench G(q) evaluated at the goal orientation, identical to the original behaviour.
  2. Adaptive bias estimation (opt-in via buoyancy_adaptive) — a slow integrator on the heave axis that learns the residual buoyancy force not captured by the static model. The bias is only updated when the vehicle is in approximate steady state (small depth error and small heave velocity), so it does not fight the PD controller during transients. Inspired by the adaptive feedforward in Eng You Hong et al., "Depth Control of an Autonomous Underwater Vehicle, STARFISH", NUS 2010.

Returns zero near the surface when surface gain scheduling is enabled.

Member Function Documentation

◆ BaseControllerInterface() [1/2]

BaseControllerInterface::BaseControllerInterface
default

◆ BaseControllerInterface() [2/2]

BaseControllerInterface::BaseControllerInterface
inline

Constructs a controller with the given dynamics model and config.

Parameters
auv[in] Shared vehicle dynamics model
config[in] Shared controller tuning parameters

◆ getBias()

double BuoyancyController::getBias ( ) const

Returns the current adaptive bias value in Newtons.

◆ getForce()

Vector6d BuoyancyController::getForce ( const State goal,
const State curr,
double  dt 
)
overridevirtual

Computes the total buoyancy compensation force.

Returns G(q) from the dynamics model plus, when adaptive estimation is enabled, an adaptive heave-axis bias that slowly tracks residual depth error during steady state.

Parameters
goal[in] Desired vehicle state (orientation and position Z are used)
curr[in] Current vehicle state (position Z and twist Z are used)
dt[in] Time step in seconds (used by the adaptive estimator)
Returns
6-element restoring + adaptive force/torque vector in N and Nm

Implements BaseControllerInterface.

◆ loadBias()

void BuoyancyController::loadBias ( )

Restores the adaptive bias from the most recent saved snapshot.

◆ reset()

void BuoyancyController::reset ( )
overridevirtual

Resets the adaptive buoyancy bias to zero.

Reimplemented from BaseControllerInterface.

◆ saveBias()

void BuoyancyController::saveBias ( )

Saves the current adaptive bias for later restoration.


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