171#include "SampleClock.h"
173#include <fhsim/simobject/SimObject.h>
176class PrintDuringExec;
240 void OdeFcn(
const double dT,
const double*
const adX,
double*
const adXDot)
const override;
249#ifdef FH_VISUALIZATION
250 void RenderInit(Ogre::Root*
const ogreRoot, ISimObjectCreator*
const creator)
override { }
251 void RenderUpdate(
const double dT,
const double*
const adX)
override { }
259 void Update(
double depth,
double altitude);
269 const double*
OutPitchRef(
const double dT,
const double*
const adX);
272 const double*
OutDepthRef(
const double dT,
const double*
const adX);
279 void WarnOnceAboutThinWater();
281 ISignalPort* m_inDepth =
nullptr;
282 ISignalPort* m_inAltitude =
nullptr;
284 PrintDuringExec* m_print =
nullptr;
291 double m_outDirection = 1.0;
292 bool m_thinWaterWarningGiven =
false;
293 int m_thinWaterWarnings = 0;
Definition AuvUndulateDiveControl.h:179
AuvUndulateDiveControl(std::string simObjectName, const Limits &limits, double updatePeriod=1.0)
static Command CommandOf(const Limits &limits, double depth, double altitude, EDir_t direction)
const Command & HeldCommand() const
The held command.
Definition AuvUndulateDiveControl.h:262
int ThinWaterWarningCount() const
The number of thin-water warnings emitted, which is never more than one.
Definition AuvUndulateDiveControl.h:265
EDir_t
Which way the vehicle is currently being flown.
Definition AuvUndulateDiveControl.h:183
@ Dir_Up
Ascending, that is a positive commanded pitch.
Definition AuvUndulateDiveControl.h:185
@ Dir_Down
Descending, that is a negative commanded pitch.
Definition AuvUndulateDiveControl.h:184
const double * OutDirection(const double dT, const double *const adX)
Plus one while descending, minus one while ascending.
AuvUndulateDiveControl(std::string simObjectName, ISimObjectCreator *creator)
void OdeFcn(const double dT, const double *const adX, double *const adXDot) const override
This SimObject has no states, so it has no derivatives.
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.
void AcceptedStep(const double dT, const double *const adX) override
const double * OutPitchRef(const double dT, const double *const adX)
The commanded pitch angle, rad.
void Update(double depth, double altitude)
Definition SampleClock.h:40
One evaluation of the undulation law.
Definition AuvUndulateDiveControl.h:200
EDir_t direction
The direction being flown.
Definition AuvUndulateDiveControl.h:203
double pitchRef
The commanded pitch, rad. Negative is nose down.
Definition AuvUndulateDiveControl.h:201
bool waterTooThin
True when the water cannot hold an undulation.
Definition AuvUndulateDiveControl.h:204
double depthRef
The turning depth being flown towards, or the held depth in thin water, m.
Definition AuvUndulateDiveControl.h:202
The geometry the undulation law is evaluated against.
Definition AuvUndulateDiveControl.h:190
double maxDepth
The deepest turning depth allowed, m.
Definition AuvUndulateDiveControl.h:191
double diveAngle
The magnitude of the commanded pitch, rad.
Definition AuvUndulateDiveControl.h:194
double minSeafloorDistance
The smallest allowed height above the seabed, m.
Definition AuvUndulateDiveControl.h:193
double minDepth
The shallowest turning depth allowed, m.
Definition AuvUndulateDiveControl.h:192
double depthHysteresis
The band by which a reversal is brought forward, m.
Definition AuvUndulateDiveControl.h:195