FhSim  3.1.0
Marine systems simulation
Loading...
Searching...
No Matches
AuvUndulateDiveControl Class Reference
+ Inheritance diagram for AuvUndulateDiveControl:
+ Collaboration diagram for AuvUndulateDiveControl:

Classes

struct  Command
 One evaluation of the undulation law. More...
 
struct  Limits
 The geometry the undulation law is evaluated against. More...
 

Public Types

enum  EDir_t { Dir_Down = 0 , Dir_Up }
 Which way the vehicle is currently being flown. More...
 

Public Member Functions

 AuvUndulateDiveControl (std::string simObjectName, ISimObjectCreator *creator)
 
 AuvUndulateDiveControl (std::string simObjectName, const Limits &limits, double updatePeriod=1.0)
 
void OdeFcn (const double dT, const double *const adX, double *const adXDot) const override
 This SimObject has no states, so it has no derivatives.
 
void AcceptedStep (const double dT, const double *const adX) override
 
void Update (double depth, double altitude)
 
const CommandHeldCommand () const
 The held command.
 
int ThinWaterWarningCount () const
 The number of thin-water warnings emitted, which is never more than one.
 

Static Public Member Functions

static Command CommandOf (const Limits &limits, double depth, double altitude, EDir_t direction)
 

Protected Member Functions

const double * OutPitchRef (const double dT, const double *const adX)
 The commanded pitch angle, rad.
 
const double * OutDepthRef (const double dT, const double *const adX)
 The turning depth currently being flown towards, or the held depth in thin water, m.
 
const double * OutDirection (const double dT, const double *const adX)
 Plus one while descending, minus one while ascending.
 

Member Enumeration Documentation

◆ EDir_t

Enumerator
Dir_Down 

Descending, that is a negative commanded pitch.

Dir_Up 

Ascending, that is a positive commanded pitch.

Constructor & Destructor Documentation

◆ AuvUndulateDiveControl() [1/2]

AuvUndulateDiveControl::AuvUndulateDiveControl ( std::string  simObjectName,
ISimObjectCreator *  creator 
)

Constructs the controller from the simulation input file.

Parameters
simObjectNameThe name of this object in the simulation.
creatorThe creator of this object.

◆ AuvUndulateDiveControl() [2/2]

AuvUndulateDiveControl::AuvUndulateDiveControl ( std::string  simObjectName,
const Limits limits,
double  updatePeriod = 1.0 
)

Constructs the controller with its parameters given directly.

No ports are registered, so AcceptedStep does nothing and Update must be called with the measurements instead. This constructor exists so that the switching law and its warning can be unit tested without a host simulation.

Parameters
simObjectNameThe name of this object.
limitsThe undulation geometry.
updatePeriodThe time between evaluations, s.

Member Function Documentation

◆ AcceptedStep()

void AuvUndulateDiveControl::AcceptedStep ( const double  dT,
const double *const  adX 
)
override

Evaluates the law when the update period has elapsed.

Parameters
dTThe current simulation time, s.
adXThe state vector.

◆ CommandOf()

static Command AuvUndulateDiveControl::CommandOf ( const Limits limits,
double  depth,
double  altitude,
EDir_t  direction 
)
static

Evaluates the undulation law.

A pure function of the measurements and the current direction, so the whole switching behaviour can be tested without a simulation.

Parameters
limitsThe undulation geometry.
depthThe vehicle depth below the surface, positive down, m.
altitudeThe vehicle height above the seabed, m.
directionThe direction currently being flown.
Returns
The command to hold until the next evaluation.

◆ Update()

void AuvUndulateDiveControl::Update ( double  depth,
double  altitude 
)

Applies the law to one pair of measurements and holds the result.

Parameters
depthThe vehicle depth below the surface, positive down, m.
altitudeThe vehicle height above the seabed, m.

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