190#include "SampleClock.h"
192#include <fhsim/simobject/SimObject.h>
196class PrintDuringExec;
286 double battery,
double metresPerJoule);
304 double posX,
double posY,
double battery,
double headingMeasured,
double metresPerJoule);
307 void OdeFcn(
const double dT,
const double*
const adX,
double*
const adXDot)
const override;
316#ifdef FH_VISUALIZATION
317 void RenderInit(Ogre::Root*
const ogreRoot, ISimObjectCreator*
const creator)
override { }
318 void RenderUpdate(
const double dT,
const double*
const adX)
override { }
328 void Update(
double posX,
double posY,
double battery,
double headingMeasured);
338 const double*
OutSpeed(
const double dT,
const double*
const adX);
341 const double*
OutHeading(
const double dT,
const double*
const adX);
353 const double*
OutPhase(
const double dT,
const double*
const adX);
357 void AccumulateProgress(
double posX,
double posY,
double battery);
360 void ReportPhaseChange(
EPhase_t previousPhase);
363 void RefreshPortValues();
365 ISignalPort* m_inPos =
nullptr;
366 ISignalPort* m_inBattery =
nullptr;
367 ISignalPort* m_inHeading =
nullptr;
369 PrintDuringExec* m_print =
nullptr;
377 double m_outEndMission = 0.0;
378 double m_outWaypointIndex = 0.0;
379 double m_outPhase = 0.0;
381 bool m_progressStarted =
false;
382 double m_startBattery = 0.0;
383 double m_energyUsed = 0.0;
384 double m_distanceTravelled = 0.0;
385 double m_lastX = 0.0;
386 double m_lastY = 0.0;
Definition AuvUndulateMissionControl.h:199
const Command & HeldCommand() const
The held command.
Definition AuvUndulateMissionControl.h:331
double MetresPerJoule() const
The measured distance made good per joule spent, or zero before anything is known.
AuvUndulateMissionControl(std::string simObjectName, const Settings &settings, double updatePeriod=1.0)
static bool CanReachRecovery(const Settings &settings, double posX, double posY, double battery, double metresPerJoule)
static std::string WaypointListError(int numX, int numY)
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
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.
static double WrapToPi(double angle)
EPhase_t
Where the mission has got to.
Definition AuvUndulateMissionControl.h:203
@ Phase_Transit
Flying the waypoint list.
Definition AuvUndulateMissionControl.h:204
@ Phase_Return
Flying to the recovery position.
Definition AuvUndulateMissionControl.h:205
@ Phase_Finished
Home. Speed zero and EndMission latched.
Definition AuvUndulateMissionControl.h:206
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.
AuvUndulateMissionControl(std::string simObjectName, ISimObjectCreator *creator)
const double * OutWaypointIndex(const double dT, const double *const adX)
The index of the waypoint being flown towards.
void Update(double posX, double posY, double battery, double headingMeasured)
const double * OutEndMission(const double dT, const double *const adX)
One once the vehicle is home, zero before that.
static Command CommandOf(const Settings &settings, const Command &previous, double posX, double posY, double battery, double headingMeasured, double metresPerJoule)
Definition SampleClock.h:40
Definition AuvUndulateMissionControl.h:229
double distanceToWaypoint
The horizontal distance to the point being flown towards, m.
Definition AuvUndulateMissionControl.h:232
double speed
The commanded forward speed, m/s.
Definition AuvUndulateMissionControl.h:230
int waypointIndex
The index of the waypoint being flown towards.
Definition AuvUndulateMissionControl.h:233
EPhase_t phase
Where the mission has got to.
Definition AuvUndulateMissionControl.h:234
bool endMission
True once the vehicle is home. Latches.
Definition AuvUndulateMissionControl.h:235
double heading
The commanded heading, rad, unwrapped against the measurement.
Definition AuvUndulateMissionControl.h:231
The track and the budget the mission law is evaluated against.
Definition AuvUndulateMissionControl.h:211
double recoveryX
The north coordinate returned to, m.
Definition AuvUndulateMissionControl.h:214
double cruiseSpeed
The commanded forward speed, m/s.
Definition AuvUndulateMissionControl.h:217
double batteryAtEndOfMission
The energy required on arriving home, J.
Definition AuvUndulateMissionControl.h:218
std::vector< double > waypointsX
The north coordinates of the waypoints, m.
Definition AuvUndulateMissionControl.h:212
bool loopWaypoints
True to restart the list instead of returning.
Definition AuvUndulateMissionControl.h:219
double waypointRadius
The distance at which a waypoint counts as reached, m.
Definition AuvUndulateMissionControl.h:216
std::vector< double > waypointsY
The east coordinates of the waypoints, m.
Definition AuvUndulateMissionControl.h:213
double recoveryY
The east coordinate returned to, m.
Definition AuvUndulateMissionControl.h:215