191#include "SampleClock.h"
193#include <fhsim/simobject/SimObject.h>
197class PrintDuringExec;
287 double battery,
double metresPerJoule);
305 double posX,
double posY,
double battery,
double headingMeasured,
double metresPerJoule);
308 void OdeFcn(
const double dT,
const double*
const adX,
double*
const adXDot)
const override;
317#ifdef FH_VISUALIZATION
318 void RenderInit(Ogre::Root*
const ogreRoot, ISimObjectCreator*
const creator)
override { }
319 void RenderUpdate(
const double dT,
const double*
const adX)
override { }
329 void Update(
double posX,
double posY,
double battery,
double headingMeasured);
339 const double*
OutSpeed(
const double dT,
const double*
const adX);
342 const double*
OutHeading(
const double dT,
const double*
const adX);
354 const double*
OutPhase(
const double dT,
const double*
const adX);
358 void AccumulateProgress(
double posX,
double posY,
double battery);
361 void ReportPhaseChange(
EPhase_t previousPhase);
364 void RefreshPortValues();
366 ISignalPort* m_inPos =
nullptr;
367 ISignalPort* m_inBattery =
nullptr;
368 ISignalPort* m_inHeading =
nullptr;
370 PrintDuringExec* m_print =
nullptr;
378 double m_outEndMission = 0.0;
379 double m_outWaypointIndex = 0.0;
380 double m_outPhase = 0.0;
382 bool m_progressStarted =
false;
383 double m_startBattery = 0.0;
384 double m_energyUsed = 0.0;
385 double m_distanceTravelled = 0.0;
386 double m_lastX = 0.0;
387 double m_lastY = 0.0;
Definition AuvUndulateMissionControl.h:200
const Command & HeldCommand() const
The held command.
Definition AuvUndulateMissionControl.h:332
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:204
@ Phase_Transit
Flying the waypoint list.
Definition AuvUndulateMissionControl.h:205
@ Phase_Return
Flying to the recovery position.
Definition AuvUndulateMissionControl.h:206
@ Phase_Finished
Home. Speed zero and EndMission latched.
Definition AuvUndulateMissionControl.h:207
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:230
double distanceToWaypoint
The horizontal distance to the point being flown towards, m.
Definition AuvUndulateMissionControl.h:233
double speed
The commanded forward speed, m/s.
Definition AuvUndulateMissionControl.h:231
int waypointIndex
The index of the waypoint being flown towards.
Definition AuvUndulateMissionControl.h:234
EPhase_t phase
Where the mission has got to.
Definition AuvUndulateMissionControl.h:235
bool endMission
True once the vehicle is home. Latches.
Definition AuvUndulateMissionControl.h:236
double heading
The commanded heading, rad, unwrapped against the measurement.
Definition AuvUndulateMissionControl.h:232
The track and the budget the mission law is evaluated against.
Definition AuvUndulateMissionControl.h:212
double recoveryX
The north coordinate returned to, m.
Definition AuvUndulateMissionControl.h:215
double cruiseSpeed
The commanded forward speed, m/s.
Definition AuvUndulateMissionControl.h:218
double batteryAtEndOfMission
The energy required on arriving home, J.
Definition AuvUndulateMissionControl.h:219
std::vector< double > waypointsX
The north coordinates of the waypoints, m.
Definition AuvUndulateMissionControl.h:213
bool loopWaypoints
True to restart the list instead of returning.
Definition AuvUndulateMissionControl.h:220
double waypointRadius
The distance at which a waypoint counts as reached, m.
Definition AuvUndulateMissionControl.h:217
std::vector< double > waypointsY
The east coordinates of the waypoints, m.
Definition AuvUndulateMissionControl.h:214
double recoveryY
The east coordinate returned to, m.
Definition AuvUndulateMissionControl.h:216