166#include "SampleClock.h"
168#include <fhsim/simobject/SimObject.h>
171class PrintDuringExec;
235 void OdeFcn(
const double dT,
const double*
const adX,
double*
const adXDot)
const override;
244#ifdef FH_VISUALIZATION
245 void RenderInit(Ogre::Root*
const ogreRoot, ISimObjectCreator*
const creator)
override { }
246 void RenderUpdate(
const double dT,
const double*
const adX)
override { }
254 void Update(
double depth,
double altitude);
264 const double*
OutPitchRef(
const double dT,
const double*
const adX);
267 const double*
OutDepthRef(
const double dT,
const double*
const adX);
274 void WarnOnceAboutThinWater();
276 ISignalPort* m_inDepth =
nullptr;
277 ISignalPort* m_inAltitude =
nullptr;
279 PrintDuringExec* m_print =
nullptr;
286 double m_outDirection = 1.0;
287 bool m_thinWaterWarningGiven =
false;
288 int m_thinWaterWarnings = 0;
Definition AuvUndulateDiveControl.h:174
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:257
int ThinWaterWarningCount() const
The number of thin-water warnings emitted, which is never more than one.
Definition AuvUndulateDiveControl.h:260
EDir_t
Which way the vehicle is currently being flown.
Definition AuvUndulateDiveControl.h:178
@ Dir_Up
Ascending, that is a positive commanded pitch.
Definition AuvUndulateDiveControl.h:180
@ Dir_Down
Descending, that is a negative commanded pitch.
Definition AuvUndulateDiveControl.h:179
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:195
EDir_t direction
The direction being flown.
Definition AuvUndulateDiveControl.h:198
double pitchRef
The commanded pitch, rad. Negative is nose down.
Definition AuvUndulateDiveControl.h:196
bool waterTooThin
True when the water cannot hold an undulation.
Definition AuvUndulateDiveControl.h:199
double depthRef
The turning depth being flown towards, or the held depth in thin water, m.
Definition AuvUndulateDiveControl.h:197
The geometry the undulation law is evaluated against.
Definition AuvUndulateDiveControl.h:185
double maxDepth
The deepest turning depth allowed, m.
Definition AuvUndulateDiveControl.h:186
double diveAngle
The magnitude of the commanded pitch, rad.
Definition AuvUndulateDiveControl.h:189
double minSeafloorDistance
The smallest allowed height above the seabed, m.
Definition AuvUndulateDiveControl.h:188
double minDepth
The shallowest turning depth allowed, m.
Definition AuvUndulateDiveControl.h:187
double depthHysteresis
The band by which a reversal is brought forward, m.
Definition AuvUndulateDiveControl.h:190