|
| | AuvUndulateMissionControl (std::string simObjectName, ISimObjectCreator *creator) |
| |
| | AuvUndulateMissionControl (std::string simObjectName, const Settings &settings, 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 posX, double posY, double battery, double headingMeasured) |
| |
|
const Command & | HeldCommand () const |
| | The held command.
|
| |
|
double | MetresPerJoule () const |
| | The measured distance made good per joule spent, or zero before anything is known.
|
| |
|
| static double | WrapToPi (double angle) |
| |
| static std::string | WaypointListError (int numX, int numY) |
| |
| static bool | CanReachRecovery (const Settings &settings, double posX, double posY, double battery, double metresPerJoule) |
| |
| static Command | CommandOf (const Settings &settings, const Command &previous, double posX, double posY, double battery, double headingMeasured, double metresPerJoule) |
| |
|
|
const double * | OutSpeed (const double dT, const double *const adX) |
| | The commanded forward speed, m/s.
|
| |
|
const double * | OutHeading (const double dT, const double *const adX) |
| | The commanded heading, rad, unwrapped against the measurement.
|
| |
|
const double * | OutEndMission (const double dT, const double *const adX) |
| | One once the vehicle is home, zero before that.
|
| |
|
const double * | OutWaypointIndex (const double dT, const double *const adX) |
| | The index of the waypoint being flown towards.
|
| |
|
const double * | OutDistanceToWaypoint (const double dT, const double *const adX) |
| | The horizontal distance to the point being flown towards, m.
|
| |
|
const double * | OutPhase (const double dT, const double *const adX) |
| | Zero while transiting, one while returning, two once finished.
|
| |
◆ EPhase_t
| Enumerator |
|---|
| Phase_Transit | Flying the waypoint list.
|
| Phase_Return | Flying to the recovery position.
|
| Phase_Finished | Home. Speed zero and EndMission latched.
|
◆ AuvUndulateMissionControl() [1/2]
| AuvUndulateMissionControl::AuvUndulateMissionControl |
( |
std::string |
simObjectName, |
|
|
ISimObjectCreator * |
creator |
|
) |
| |
Constructs the controller from the simulation input file.
- Parameters
-
| simObjectName | The name of this object in the simulation. |
| creator | The creator of this object. |
◆ AuvUndulateMissionControl() [2/2]
| AuvUndulateMissionControl::AuvUndulateMissionControl |
( |
std::string |
simObjectName, |
|
|
const Settings & |
settings, |
|
|
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 mission law can be unit tested without a host simulation.
- Parameters
-
| simObjectName | The name of this object. |
| settings | The track and the budget. |
| updatePeriod | The time between evaluations, s. |
◆ AcceptedStep()
| void AuvUndulateMissionControl::AcceptedStep |
( |
const double |
dT, |
|
|
const double *const |
adX |
|
) |
| |
|
override |
Evaluates the law when the update period has elapsed.
- Parameters
-
| dT | The current simulation time, s. |
| adX | The state vector. |
◆ CanReachRecovery()
| static bool AuvUndulateMissionControl::CanReachRecovery |
( |
const Settings & |
settings, |
|
|
double |
posX, |
|
|
double |
posY, |
|
|
double |
battery, |
|
|
double |
metresPerJoule |
|
) |
| |
|
static |
Reports whether the vehicle can still reach the recovery position with its reserve.
- Parameters
-
| settings | The track and the budget. |
| posX | The vehicle north coordinate, m. |
| posY | The vehicle east coordinate, m. |
| battery | The energy left in the battery, J. |
| metresPerJoule | The measured distance made good per joule spent, or zero when nothing has been measured yet. |
- Returns
- True while the mission may continue.
◆ CommandOf()
| static Command AuvUndulateMissionControl::CommandOf |
( |
const Settings & |
settings, |
|
|
const Command & |
previous, |
|
|
double |
posX, |
|
|
double |
posY, |
|
|
double |
battery, |
|
|
double |
headingMeasured, |
|
|
double |
metresPerJoule |
|
) |
| |
|
static |
Evaluates the mission law.
A pure function of the measurements and the previous command, so the whole waypoint, unwrap and battery behaviour can be tested without a simulation.
- Parameters
-
| settings | The track and the budget. |
| previous | The command held since the previous evaluation. |
| posX | The vehicle north coordinate, m. |
| posY | The vehicle east coordinate, m. |
| battery | The energy left in the battery, J. |
| headingMeasured | The measured vehicle heading, rad. |
| metresPerJoule | The measured distance made good per joule spent, or zero when nothing has been measured yet. |
- Returns
- The command to hold until the next evaluation.
◆ Update()
| void AuvUndulateMissionControl::Update |
( |
double |
posX, |
|
|
double |
posY, |
|
|
double |
battery, |
|
|
double |
headingMeasured |
|
) |
| |
Applies the law to one set of measurements and holds the result.
- Parameters
-
| posX | The vehicle north coordinate, m. |
| posY | The vehicle east coordinate, m. |
| battery | The energy left in the battery, J. |
| headingMeasured | The measured vehicle heading, rad. |
◆ WaypointListError()
| static std::string AuvUndulateMissionControl::WaypointListError |
( |
int |
numX, |
|
|
int |
numY |
|
) |
| |
|
static |
Returns the error message for a waypoint list of the given sizes.
Factored out of the constructor because ISimObjectCreator has no mock in FhSim, so a constructor-only check could not be tested at all.
- Parameters
-
| numX | The number of entries in WaypointsX. |
| numY | The number of entries in WaypointsY. |
- Returns
- The message to report, or an empty string when the list is usable.
◆ WrapToPi()
| static double AuvUndulateMissionControl::WrapToPi |
( |
double |
angle | ) |
|
|
static |
Wraps an angle into the half-open interval \((-\pi, \pi]\).
- Parameters
-
- Returns
- The congruent angle in \((-\pi, \pi]\).
The documentation for this class was generated from the following file: