ICAROUS
|
#include <Plan.h>
Public Member Functions | |
Plan () | |
Plan (const std::string &name) | |
Plan (const std::string &name, const std::string ¬e) | |
Plan (const Plan &fp) | |
bool | isLinear () const |
bool | validIndex (int i) const |
bool | equals (const Plan &fp) |
bool | almostEquals (const Plan &p) const |
bool | almostEquals (const Plan &p, double epsilon_horiz, double epsilon_vert) const |
bool | operator== (const Plan &o) const |
bool | operator!= (const Plan &o) const |
void | setDebug (bool d) |
void | clear () |
void | clearVirtuals () |
BoundingBox | getBoundBox () const |
int | size () const |
bool | isLatLon () const |
bool | isLatLon (bool latlon) const |
const std::string & | getID () const |
void | setID (const std::string &s) |
const std::string | getName (int i) const |
void | setName (int i, const std::string &s) |
const std::string & | getNote () const |
void | setNote (const std::string &s) |
void | appendNote (const std::string &s) |
void | includeParameters (ParameterData pd) |
ParameterData | extractParameters () const |
double | getFirstTime () const |
double | getFirstRealTime () const |
double | getLastTime () const |
bool | isTimeInPlan (double t) const |
NavPoint | getLastPoint () const |
int | nextPtOrEnd (int startWp) const |
int | findName (const std::string &name, int startIx, bool withWrap) |
int | findName (const std::string &name) const |
void | clearName (int ix) |
std::string | getInfo (int i) const |
int | findInfo (const std::string &info, int startIx, bool withWrap) const |
int | findInfo (const std::string &info, bool exact) const |
int | findInfo (const std::string &info) const |
void | setInfo (int i, const std::string &info) |
void | appendInfo (int i, const std::string &info) |
void | clearInfo (int ix) |
int | getIndex (double tm) const |
int | getSegment (double tm) const |
int | getSegmentByDistance (int startIx, double d) const |
int | getSegmentByDistance (double d) const |
int | getNearestIndex (double tm) const |
double | time (int i) const |
const Position | getPos (int i) const |
double | alt (int i) const |
const NavPoint | point (int i) const |
const std::pair< NavPoint, TcpData > | get (int i) const |
TcpData | getTcpData (int i) const |
TcpData & | getTcpDataRef (int i) |
bool | isOriginal (int i) const |
bool | isAltPreserve (int i) const |
bool | isVirtual (int i) const |
double | signedRadius (int i) const |
double | calcRadius (int i) const |
double | vertexRadius (int i) const |
int | turnDir (int i) const |
double | gsAccel (int i) const |
double | vsAccel (int i) const |
bool | isTrkTCP (int i) const |
bool | isBOT (int i) const |
bool | isMOT (int i) const |
bool | isEOT (int i) const |
bool | isGsTCP (int i) const |
bool | isBGS (int i) const |
bool | isEGS (int i) const |
bool | isVsTCP (int i) const |
bool | isBVS (int i) const |
bool | isEVS (int i) const |
bool | isBeginTCP (int i) const |
bool | isEndTCP (int i) const |
bool | isTCP (int i) const |
void | setVirtual (int i) |
void | setOriginal (int i) |
void | setAltPreserve (int i) |
void | setVertexRadius (int i, double radius) |
Position | turnCenter (int i) const |
double | getGsAccel (int i) |
double | getVsAccel (int i) |
void | setGsAccel (int i, double accel) |
void | setVsAccel (int i, double accel) |
void | setBOT (int i, double signedRadius, Position center) |
void | setEOT (int i) |
void | setEOTBOT (int i, double signedRadius, Position center) |
void | addBOT (int i, double signedRadius, Position center) |
void | addEOT (int i) |
void | setMOT (int i) |
void | clearMOT (int i) |
void | clearBOT (int ix) |
void | clearEOT (int ix) |
void | setBGS (int i, double acc) |
void | setEGS (int i) |
void | addEGS (int i) |
void | clearEGS (int ix) |
void | setEGSBGS (int i, double acc) |
void | clearBGS (int ix) |
void | setBVS (int i, double acc) |
void | setEVS (int i) |
void | addEVS (int i) |
void | setEVSBVS (int i, double acc) |
void | clearBVS (int ix) |
void | clearEVS (int ix) |
int | addNavPoint (const NavPoint &p) |
int | add (const Position &p, double time) |
int | add (const std::pair< NavPoint, TcpData > &p) |
int | add (const NavPoint &p2, const TcpData &d) |
void | remove (int i) |
int | insertByDistance (double d) |
int | insertByDistance (int i, double d) |
double | gsOutCalc (int i, bool linear) const |
double | gsOutCalc (int i) const |
void | setAlt (int i, double alt) |
int | setTcpData (int i, TcpData v) |
void | setTime (int i, double t) |
bool | timeShiftPlan (int start, double st) |
int | prevTrkTCP (int current) const |
int | prevGsTCP (int current) const |
int | prevVsTCP (int current) const |
int | nextTrkTCP (int current) const |
int | nextGsTCP (int current) const |
int | nextVsTCP (int current) const |
int | prevBOT (int current) const |
int | prevEOT (int current) const |
int | nextEOT (int current) const |
int | nextBOT (int current) const |
int | prevBGS (int current) const |
int | prevEGS (int current) const |
int | nextEGS (int current) const |
int | nextBGS (int current) const |
int | prevTRK (int current) const |
int | prevGS (int current) const |
int | prevVS (int current) const |
int | prevBVS (int current) const |
int | prevEVS (int current) const |
int | nextEVS (int current) const |
int | nextBVS (int current) const |
int | prevTCP (int current) const |
int | nextTCP (int current) const |
bool | inTrkChange (double t) const |
bool | inTrkAccel (int ix) const |
bool | inGsAccel (int ix) const |
bool | inVsAccel (int ix) const |
bool | inGsChange (double t) const |
bool | inVsChange (double t) const |
double | turnRadiusAtTime (double t) const |
double | gsAccelAtTime (double t) const |
double | vsAccelAtTime (double t) const |
Position | position (double t) const |
Position | position (double t, bool linear) const |
NavPoint | navPt (double t) const |
Velocity | velocity (double tm) const |
Velocity | velocity (double tm, bool linear) const |
double | timeFromDistanceWithinSeg (int seg, double rdist) const |
double | timeFromDistance (double dist) const |
double | timeFromDistance (int startSeg, double dist) const |
Velocity | averageVelocity (int i, bool linear) const |
Velocity | averageVelocity (int i) const |
Velocity | initialVelocity (int i) const |
Velocity | initialVelocity (int i, bool linear) const |
Velocity | finalVelocity (int i) const |
Velocity | finalVelocity (int i, bool linear) const |
Velocity | velocityFromDistance (double d) const |
double | trkOut (int seg, bool linear) const |
double | trkInTurn (int ix, int ixBOT) const |
double | trkOut (int seg) const |
double | trkIn (int seg) const |
double | trkDelta (int i) const |
double | defTrkOut (int seg) const |
double | defTrkIn (int seg) const |
double | trkFinal (int seg, bool linear) const |
double | gsOut (int i, bool linear) const |
double | gsFinal (int i, bool linear) const |
double | gsIn (int seg, bool linear) const |
double | gsInCalc (int seg) const |
double | gsOut (int seg) const |
double | gsFinal (int seg) const |
double | gsIn (int seg) const |
double | gsAtTime (int seg, double gsAtSeg, double t, bool linear) const |
double | gsAtTime (double t, bool linear) const |
double | gsAtTime (double t) const |
double | vsOut (int i, bool linear) const |
double | vsFinal (int i, bool linear) const |
double | vsIn (int seg, bool linear) const |
double | vsOut (int seg) const |
double | vsFinal (int seg) const |
double | vsIn (int seg) const |
double | vsAtTime (int seg, double vsAtSeg, double t, bool linear) const |
double | vsAtTime (double t, bool linear) const |
double | vsAtTime (double t) const |
double | distFromPointToTime (int seg, double t, bool linear) const |
std::pair< Position, Velocity > | posVelWithinSeg2D (int seg, double t, bool linear, double gsAt_d) const |
std::pair< Position, Velocity > | advanceDistanceWithinSeg2D (int seg, double distFromSeg, bool linear, double gsAt_d) const |
Position | advanceDistanceWithinSeg2D (int seg, double distFromSeg, bool linear) const |
std::pair< Position, int > | advanceDistance2D (int seg, double distFromSeg, bool linear) const |
std::pair< Position, int > | advanceDistance (int seg, double distFromSeg, bool linear) const |
std::pair< Position, Velocity > | posVelWithinSeg (int seg, double t, bool linear, double gsAt_d) const |
std::pair< Position, Velocity > | positionVelocity (double t, bool linear) const |
std::pair< Position, Velocity > | positionVelocity (double t) const |
std::pair< double, double > | interpolateAltVs (int seg, double dt, bool linear) const |
std::pair< double, double > | altitudeVs (double t, bool linear) const |
double | calcVertAccel (int i) |
double | calcGsAccel (int i) |
double | calcDtGsIn (int i, double gs) const |
double | calcTimeGsIn (int i, double gs) const |
void | setTimeGsIn (int i, double gs) |
void | setAltVSin (int i, double vs, bool preserve) |
void | mkAlt (int ix, double newAlt) |
void | removeAltPreserves () |
bool | mkGsIn (int ix, double gs) |
bool | mkGsOut (int ix, double gs) |
void | mkGsConstant (int wp1, int wp2, double gs) |
void | mkGsConstant (double gs) |
bool | isTrkContinuous (int i, double trkEpsilon, bool silent) const |
bool | isTrkContinuous (int i, bool silent) const |
bool | isTrkContinuous (bool silent) const |
bool | isGsContinuous (int i, double gsEpsilon, bool silent) const |
bool | isGsContinuous (int i, bool silent) const |
bool | isGsContinuous (bool silent) const |
bool | isVsContinuous (int i, double velEpsilon, bool silent) const |
bool | isVsContinuous (int i, bool silent) const |
bool | isVsContinuous (bool silent) const |
bool | isVelocityContinuous () const |
double | pathDistance () const |
double | pathDistance (int i) const |
double | pathDistance (int i, bool linear) const |
double | pathDistance (int i, int j) const |
double | pathDistance (int i, int j, bool linear) const |
double | partialPathDistance (double t, bool linear) const |
double | pathDistanceToPoint (double t, int j) const |
double | pathDistanceFromTime (double t) const |
double | vertDistance (int i) const |
double | vertDistance (int i, int j) const |
double | averageGroundSpeed () const |
double | verticalSpeed (int i) const |
Position | vertexFromTurnTcps (int ixBOT, int ixEOT, double altMid) const |
NavPoint | vertexPointTurnTcps (int ixBOT, int ixEOT, double altMid) const |
int | findMOT (int ixBOT) const |
void | revertGsTCPs () |
void | revertVsTCPs () |
void | revertTurnTCPs () |
void | repairPlan () |
void | repairMOTs () |
void | repairMOT (int ixBOT) |
void | repairGsContinuity (int ixBGS, int ixEGS, double vo, double vf, double maxGsAccel) |
void | repairGsContinuity (int ixBGS, int ixEGS, double maxGsAccel) |
void | repairGsContinuity (double maxGsAccel) |
bool | repairGsContInside (int ixBGS, int ixEGS, double v0) |
void | repairGsConsistency () |
void | repairGsConsistencyAt (int ixBGS) |
void | repairNegGsIn (int ix) |
void | repairNegGsOut (int ix) |
void | revertTurnTCP (int ix) |
void | revertGsTCP (int ix) |
void | crudeRevertGsTCP (int ix) |
int | revertVsTCP (int ix) |
double | inferredVsIn (int ixBVS) |
std::pair< int, std::string > | wellFormed (bool strongMOT) const |
bool | isWellFormed () const |
int | indexWellFormed () const |
std::string | strWellFormed () const |
bool | isGsConsistent (int ixBGS, double distEpsilon, bool silent, double nearZeroGsValue) const |
bool | checkBGS (int ixBGS, bool silent) const |
bool | checkBGS (int ixBGS) const |
bool | isGsConsistent (bool silent) |
bool | isVsConsistent (int ixBVS, double distEpsilon, bool silent) const |
bool | isTurnConsistent (int i, double distH_Epsilon, bool silent) const |
bool | isTurnConsistent (bool silent) const |
bool | isVsConsistent (bool silent) const |
bool | isConsistent (double maxTrkDist, double maxGsDist, double maxVsDist, bool silent, double nearZeroGsValue) const |
bool | isConsistent () const |
bool | isConsistent (bool silent) const |
bool | isWeakConsistent () const |
bool | isWeakConsistent (bool silent) const |
bool | isVelocityContinuous (bool silent) const |
bool | isWeakVelocityContinuous (bool silent) const |
bool | isFlyable () const |
bool | isFlyable (bool silent) const |
bool | isWeakFlyable (bool silent) const |
bool | isWeakFlyable () |
bool | isWeakFlyable () const |
void | fix () |
NavPoint | closestPointHoriz (int seg, const Position &p) const |
NavPoint | closestPoint (const Position &p) const |
NavPoint | closestPointHoriz (const Position &p) const |
NavPoint | closestPoint (int start, int end, const Position &p, bool horizOnly, double maxHdist) const |
std::pair< Vect3, double > | closestPoint3D (int seg, const Vect3 &v0) const |
NavPoint | closestPoint3D (const Position &p) const |
bool | inAccel (double t) const |
bool | inAccelZone (int ix) const |
void | remove (int i, int k) |
int | set (int i, const NavPoint &v, const TcpData &d) |
int | setNavPoint (int i, const NavPoint &v) |
Plan | copy () const |
Plan | cut (int firstIx, int lastIx) const |
int | mergeClosePoints (int i, double minDt) |
void | mergeClosePoints (double minDt) |
void | mergeClosePoints () |
int | mergeClosePointsByDist (int j, double minDist) |
void | cleanPlan () |
void | removeRedundantPoints (int from, int to) |
void | removeRedundantPoints () |
int | removeIfRedundant (int ix, bool trkF, bool gsF, bool vsF) |
int | removeIfRedundant (int ix, bool trkF, bool gsF, bool vsF, double minTrk, double minGs, double minVs, bool repair) |
int | removeIfRedundant (int ix) |
int | removeIfVsConstant (int ix) |
double | getMIN_GS_DELTA_GEN () const |
double | getMIN_TRK_DELTA_GEN () const |
double | getMIN_VS_DELTA_GEN () const |
std::string | toUnitTest () |
std::string | toUnitTest (std::string prefix, bool asserts, bool si) |
std::string | toString () const |
std::vector< std::string > | toStringList (int i, int precision, bool tcp) const |
std::string | toStringVelocity (int velField) const |
std::string | toStringTrk () const |
std::string | toStringGs () const |
std::string | toStringVs () const |
std::string | toStringProfile () const |
void | addWarning (std::string s) const |
void | addError (std::string s) const |
void | addError (std::string s, int loc) const |
int | getErrorLocation () const |
bool | hasError () const |
bool | hasMessage () const |
std::string | getMessage () |
std::string | getMessageNoClear () const |
Static Public Member Functions | |
static std::string | specPre () |
static void | setStaticDebug (bool d) |
static double | timeFromDistance (double vo, double gsAccel, double dist) |
static Position | vertexFromTurnTcps (const Position &botPos, const Position &eotPos, double radius, int dir, const Position ¢er, double altMid) |
static Position | vertexFromTurnTcps (const Position &botPos, const Position &eotPos, double signedRadius, double trkInit, double altMid) |
static double | interpolateAlts (double vsInit, double vsAccel, double alt1, double t1, double t) |
static std::pair< NavPoint, TcpData > | makeBOT (Position p, double t, double signedRadius, const Position ¢er) |
static std::pair< NavPoint, TcpData > | makeEOT (Position p, double t) |
static std::pair< NavPoint, TcpData > | makeEOTBOT (Position p, double t, double signedRadius, const Position ¢er) |
static std::pair< NavPoint, TcpData > | makeBGS (const std::string &name, Position p, double t, double a) |
static std::pair< NavPoint, TcpData > | makeEGS (Position p, double t) |
static std::pair< NavPoint, TcpData > | makeEGSBGS (const std::string &name, Position p, double t, double a) |
static std::pair< NavPoint, TcpData > | makeBVS (const std::string &name, Position p, double t, double a) |
static std::pair< NavPoint, TcpData > | makeEVS (Position p, double t) |
static std::pair< NavPoint, TcpData > | makeEVSBVS (Position p, double t, double a) |
static Plan | planFromState (const std::string &id, const Position &pos, const Velocity &v, double startTime, double endTime) |
static void | setMIN_GS_DELTA_GEN (double minGsDeltaGen) |
static void | setMIN_TRK_DELTA_GEN (double minTrkDeltaGen) |
static void | setMIN_VS_DELTA_GEN (double minVsDeltaGen) |
static void | setMinDeltaGen (double trkDelta, double gsDelta, double vsDelta) |
static void | setMinDeltaGen_BackToDefaults () |
static std::vector< std::string > | toStringList (const NavPoint &p, const TcpData &d, int precision, bool tcp) |
Static Public Attributes | |
static double | MIN_TRK_DELTA_GEN = Units::from("deg", 1) |
static double | MIN_GS_DELTA_GEN = Units::from("kn", 10) |
static double | MIN_VS_DELTA_GEN = Units::from("fpm", 10) |
static std::string | manualRadius = ".<manRadius>." |
static std::string | manualGsAccel = ".<manGsAccel>." |
static std::string | manualVsAccel = ".<manVsAccel>." |
static const double | minDt = GreatCircle::minDt |
static const double | nearlyZeroGs = 1E-4 |
static const std::string | noteParamStart = ":PARAM_START:" |
static const std::string | noteParamEnd = ":PARAM_END:" |
Protected Types | |
typedef std::vector< NavPoint > | navPointVector |
typedef navPointVector::iterator | navPointIterator |
typedef std::vector< TcpData > | tcpDataVector |
typedef tcpDataVector::iterator | tcpDataIterator |
Protected Member Functions | |
void | init () |
Protected Attributes | |
std::string | label |
navPointVector | points |
tcpDataVector | data |
ErrorLog | error |
int | errorLocation |
std::string | note |
BoundingBox | bound |
Static Protected Attributes | |
static bool | newConsistencyAlg = true |
static bool | debug = false |
Private Member Functions | |
void | insert (int i, const NavPoint &v, const TcpData &d) |
int | indexSearch (double tm, int i1, int i2) const |
double | gsFinalCalc (int i, bool linear) const |
void | setTimeInPlace (int i, double t) |
std::pair< double, double > | timeFromHeight (int seg, double height) const |
int | findBot (int i) const |
int | findMOT (int ixBOT, int ixEOT) const |
void | fixBGS_EGS (int wp1, int wp2) |
std::string | toStringPoint (int i) const |
Static Private Attributes | |
static TcpData | invalid_value = TcpData::makeInvalid() |
Friends | |
class | PlanCollection |
class | PlanUtil |
Manages a flight plan or kinematic trajectory as a sequence of 4D vectors (three dimensions of space and time). Acceleration zones in a kinematic plan are defined by appending acceleration values to the beginning point of that zone.
This class assumes that (1) the points are added in increasing time, (2) all point times are 0 or positive, (3) there are no duplicate point times.
Points that "overlap" with existing points are deemed as redundant and will not be included in the Plan. Two points overlap if they are within both a minimum distance and time of each other (as defined by minDt).
Kinematic plans can be constructed algorithmically. One way to do this is using the Util.TrajGen.makeKinematicPlan() method to construct a kinematic Plan core from a linear one.
Furthermore this version of the Plan assumes that any points between a beginning and paired end TCP will have constant acceleration (or turn radius). These values will be derived from the beginning and end points. It is not recommended that these Plans be directly modified. Rather the (linear) Plans they are based on should be modified and new kinematic Plans be generated from those.
Acceleration regions are delineated by BOT, EOT, BGS, EGS, BVS, EVS trajectory change points (TCPs). In general, the end TCPS points are not considered to be part of the maneuver. All acceleration regions of the same type must be distinct and not overlap. Acceleration begin TCP points contain meta data including acceleration and initial velocity. For other points, velocities are inferred from surrounding points.
See An Efficient Universal Trajectory Language, NASA/TM-2017-219669, Sept 2017.
Typical Usage:
larcfm::Plan::Plan | ( | ) |
Create an empty Plan
|
explicit |
Create an empty Plan with the given id
name | name of this plan, typically the aircraft id |
larcfm::Plan::Plan | ( | const std::string & | name, |
const std::string & | note | ||
) |
larcfm::Plan::Plan | ( | const Plan & | fp | ) |
Construct a new object that is a deep copy of the supplied object
fp | plan to copy |
int larcfm::Plan::add | ( | const Position & | p, |
double | time | ||
) |
void larcfm::Plan::addBOT | ( | int | i, |
double | signedRadius, | ||
Position | center | ||
) |
makes the point at index i to be a Beginning of turn (either BOT or EOTBOT)
i | plan index |
signedRadius | signed radius, positive indicates turn right, negative indicated turn left |
center | center of turn |
void larcfm::Plan::addEGS | ( | int | i | ) |
makes the point at index i to be either a BGS or EGSBGS)
i | plan index |
signedRadius | signed radius, positive indicates turn right, negative indicated turn left |
center | center of turn |
void larcfm::Plan::addEOT | ( | int | i | ) |
makes the point at index i to be an end of turn (either BOT or EOTBOT)
i | plan index |
signedRadius | signed radius, positive indicates turn right, negative indicated turn left |
center | center of turn |
void larcfm::Plan::addEVS | ( | int | i | ) |
makes the point at index i to be either a BGS or EGSBGS)
i | plan index |
signedRadius | signed radius, positive indicates turn right, negative indicated turn left |
center | center of turn |
int larcfm::Plan::addNavPoint | ( | const NavPoint & | p | ) |
Add a Navpoint to the plan that does not have any associated TCP information. Once this point is added to the plan a set of default TCP information will be used for this point.
p | the point to add |
std::pair< Position, int > larcfm::Plan::advanceDistance2D | ( | int | seg, |
double | distFromSeg, | ||
bool | linear | ||
) | const |
starting with point at seg advance "distanceFromSeg" in Plan NOTE do not use non-positive value for gsAt_d
seg | |
distFromSeg | |
linear | |
gsAt_d |
Position larcfm::Plan::advanceDistanceWithinSeg2D | ( | int | seg, |
double | distFromSeg, | ||
bool | linear | ||
) | const |
Advance forward in a plan by distance (within a segment only) (does not compute altitude)
seg | starting point index |
distFromSeg | distance to advance from starting point |
linear | if linear, use straight segments only |
std::pair< Position, Velocity > larcfm::Plan::advanceDistanceWithinSeg2D | ( | int | seg, |
double | distFromSeg, | ||
bool | linear, | ||
double | gsAt_d | ||
) | const |
Advance forward in a plan by distance (within a segment only)
seg | starting point index |
distFromSeg | distance to advance from starting point |
linear | if linear, use straight segments only |
bool larcfm::Plan::almostEquals | ( | const Plan & | p | ) | const |
determines if plans are almost equals (not exactly equal because of floating point calculations
p | plan of interest |
bool larcfm::Plan::almostEquals | ( | const Plan & | p, |
double | epsilon_horiz, | ||
double | epsilon_vert | ||
) | const |
Check that positions and times are virtually identical
Note: it does not compare source info, or TCP attributes
p | Plan to compare with |
epsilon_horiz | allowable horizontal deviation [m] |
epsilon_vert | allowable vertical deviation [m] |
double larcfm::Plan::alt | ( | int | i | ) | const |
Altitude at index i
i | plan index |
void larcfm::Plan::appendInfo | ( | int | i, |
const std::string & | info | ||
) |
Append info at index i
i | plan index |
info | information to be appended |
double larcfm::Plan::averageGroundSpeed | ( | ) | const |
calculate average ground speed over entire plan
Velocity larcfm::Plan::averageVelocity | ( | int | i | ) | const |
Estimate the linear velocity between point i to point i+1 for this aircraft. This is not defined for the last point of the plan.
i | index |
Velocity larcfm::Plan::averageVelocity | ( | int | i, |
bool | linear | ||
) | const |
Estimate the velocity between point i to point i+1 for this aircraft. This is not defined for the last point of the plan.
i | index |
linear | if true, calculate the linear velocity, otherwise calculate the kinematic velocity (use pathdistance for gs) |
double larcfm::Plan::calcDtGsIn | ( | int | ix, |
double | gs | ||
) | const |
calculate delta time (from point i-1) into point i to make ground speed into it = gs
i | index of interest |
gs | target ground speed |
calculate delta time for point i to make ground speed into it = gs
i | |
gs |
double larcfm::Plan::calcRadius | ( | int | i | ) | const |
Calculates a radius (great circle distance from center to BOT, i.e. surface radius). It uses center and BOT position to calculate the radius.
Note it is usually preferable to get the radius from the signedRadius method
i | index |
double larcfm::Plan::calcTimeGsIn | ( | int | i, |
double | gs | ||
) | const |
calculate time at a point such that the ground speed into that point is "gs". If i or gs is invalid, this returns -1. If i is in a turn, this returns the current point time.
Note: parameter maxGsAccel is not used on a linear segment
i | index |
gs | ground speed |
calculate time at a point such that the ground speed into that point is "gs". If i or gs is invalid, this returns -1. If i is in a turn, this returns the current point time.
Note: parameter maxGsAccel is not used on a linear segment
void larcfm::Plan::cleanPlan | ( | ) |
Remove records of deleted points and make all remaining points "original"
fp |
void larcfm::Plan::clear | ( | ) |
Clear a plan of its contents.
void larcfm::Plan::clearVirtuals | ( | ) |
Clear all virtual points in a plan.
Experimental This returns a NavPoint on the plan that is closest to the given position. If more than one point are closest horizontally, the closer vertically is returned. If more than one have the same horizontal and vertical distances, the first is returned.
p | position |
NavPoint larcfm::Plan::closestPoint | ( | int | start, |
int | end, | ||
const Position & | p, | ||
bool | horizOnly, | ||
double | maxHdist | ||
) | const |
Experimental This returns a NavPoint on the plan within the given segment range that is closest to the given position. If more than one point are closest horizontally, the closer vertically is returned. If more than one have the same horizontal and vertical distances, the first is returned. If start >= end, this returns an INVALID point
start | start point |
end | end point |
p | position to check against |
horizOnly | if true, only consider horizontal distances, if false, also compare vertical distances if the closest points on 2 segments are within maxHdist of each other |
maxHdist | only used if horizOnly is false: compare vertical distances if candidate points are within this range of each other |
Experimental Return the closest geometric point on a plan to a reference point, as measured as a Euclidean 3D norm from each linear segment. (Kinematic turns are not accounted for in this distance calculation.) This may produce unexpected results if a kinematic segment includes a turn ≥ 180 degrees or a vertical segment that crosses over itself.
p | reference point |
Return the closest geometric point on a plan to a reference point, as measured as a Euclidean 3D norm from each linear segment. (Kinematic turns are not accounted for in this distance calculation.)
seg | |
p | reference point |
Return the closest geometric point on a segment to a reference point, as measured as a Euclidean 3D norm from a linear segment. (Kinematic turns are not accounted for in this distance calculation.)
seg | |
p | reference point |
Experimental Returns the (first) point on the plan that has the smallest horizontal distance from the reference point. If the closest point horizontally happens to occur on a 0 gs segment, it will return the point on the segment with the closest altitude. This will attempt to allow for curved turns in a kinematic plan.
p | position |
Experimental Return the "closest" point on a segment to position p. This will only use horizontal (2d) distance calculations unless the segment's ground speed is (nearly) zero, in which case it will use altitude to determine the closest point.
This will attempt to allow for curved turns (if kinematic). If multiple points are equally closest, it will return the first such point.
seg | segment to check |
p | reference position |
Plan larcfm::Plan::cut | ( | int | firstIx, |
int | lastIx | ||
) | const |
Create new plan from existing using points from index "firstIx" to index "lastIx". This is a "raw" cut, no attention is given to TCPs.
For a more general cutter see PlanUtil.cutDownTo
firstIx | first index |
lastIx | last index |
Note. It is often a good idea to follow this method with a call to "cleanPlan" and "repairPlan" Note. See also PlanUtil.cutDown and PlanUtil.cutDownTo
double larcfm::Plan::defTrkIn | ( | int | seg | ) | const |
This function generalizes trkIn to handle segments with zero ground speed.
seg | The index of the point of interest |
double larcfm::Plan::defTrkOut | ( | int | seg | ) | const |
This function generalizes trkOut to handle segments with zero ground speed. If gsOut(ix) > 0 returns trkOut(ix)
seg | The index of the point of interest |
double larcfm::Plan::distFromPointToTime | ( | int | seg, |
double | t, | ||
bool | linear | ||
) | const |
distanceFromTime() Calculate the distance from the Navpoint at "seq" to plan position at absolute time "t" (within the segment)
seg | starting position |
t | time of stopping position (must be in segment "seg") |
linear | If true, then interpret plan in a linear manner |
Calculate the distance from the Navpoint at "seq" to plan position at time "t"
seg | |
t | |
linear |
bool larcfm::Plan::equals | ( | const Plan & | fp | ) |
Tests if one plan object has the same contents as another. This test also compares the concrete classes of the two Plans.
fp | plan of interest |
ParameterData larcfm::Plan::extractParameters | ( | ) | const |
Retrieve parameters stored in the plan's note field, if any.
Velocity larcfm::Plan::finalVelocity | ( | int | i, |
bool | linear | ||
) | const |
Return the velocity at the end of segment "i". This is not defined for the last point (because there is no next point)
i | segment of interest |
linear | if true, measure the straight distance, if false measure the curved distance |
|
private |
Finds the index of the BOT associated with the given index. If the given index does not represent a point within a turn, then return -1.
p | plan |
i | index of some point within a turn |
int larcfm::Plan::findInfo | ( | const std::string & | info | ) | const |
Return the first index that has a tcp field that contains the given search term, or -1 if not found. Same as findInfo(term, false).
info | information |
int larcfm::Plan::findInfo | ( | const std::string & | info, |
bool | exact | ||
) | const |
Return the first index that has a tcp field that matches the given search term.
info | the term to be searched for. |
exact | if true, the term must match the stored information exactly. If false, the term must be a substring of the stored information; this is generally more robust in most circumstances, especially if the term is delimited. |
int larcfm::Plan::findMOT | ( | int | ixBOT | ) | const |
Find middle of turn
ixBOT | index of a BOT point |
int larcfm::Plan::findName | ( | const std::string & | name | ) | const |
Return the index of first point that has a name equal to the given string, return -1 if there are no matches.
name | String to match |
Return the index of first point that has a name equal to the given string, return -1 if there are no matches.
name | String to match |
int larcfm::Plan::findName | ( | const std::string & | name, |
int | startIx, | ||
bool | withWrap | ||
) |
Return the index of first point that has a name equal to the given string -1 if there are no matches.
name | nane |
startIx | start with this index |
withWrap | if true, go through whole list |
Return the index of first point that has a name equal to the given string -1 if there are no matches.
startIx | start with this index |
name | String to match |
withWrap | if true, go through whole list |
void larcfm::Plan::fix | ( | ) |
This removes the acceleration tags on points that appear "unbalanced." This is not particularly intelligent and may result in bizarre (but legal) plans.
BoundingBox larcfm::Plan::getBoundBox | ( | ) | const |
Get an approximation of the bounding rectangle around this plan
Get an approximation of the bounding rectangle around this plan
double larcfm::Plan::getFirstRealTime | ( | ) | const |
This returns the time for the first non-virtual point in the plan. Usually this is the same as getFirstTime(), and this should only be called if there is a known special handling of virtual points, as it is less efficient. If there are 0 non-virtual points in the plan, this logs an error and returns 0.0
double larcfm::Plan::getFirstTime | ( | ) | const |
Return the time of the first point in the plan.
double larcfm::Plan::getGsAccel | ( | int | i | ) |
Ground speed acceleration at a point
i | index of BGS |
const std::string & larcfm::Plan::getID | ( | ) | const |
Return the name of this plan (probably the aircraft name).
int larcfm::Plan::getIndex | ( | double | tm | ) | const |
Return the index of the point that matches the provided time. If the result is negative, then the given time corresponds to no point. A negative result gives information about where the given time does enter the list. If the (negative) result is i, then the given time corresponds to a time between indexes -i-2 and -i-1. For example, if times are {0.0, 1.0, 2.0, 3.0, 4.0}:
tm | a time |
std::string larcfm::Plan::getInfo | ( | int | i | ) | const |
Return information field
i | plan index |
NavPoint larcfm::Plan::getLastPoint | ( | ) | const |
Return the last point in the plan.
double larcfm::Plan::getLastTime | ( | ) | const |
Return the time of the last point in the plan.
|
inlinevirtual |
Return a string representation of any errors or warnings. Calling this method will clear any messages and reset both the error and warning status to none.
Implements larcfm::ErrorReporter.
|
inlinevirtual |
Return a string representation of any errors or warnings. Calling this method will not clear the error or warning status (i.e., hasError() will return the same value before and after this call.)
Implements larcfm::ErrorReporter.
const std::string larcfm::Plan::getName | ( | int | i | ) | const |
Return the name of the point i.
i | index |
int larcfm::Plan::getNearestIndex | ( | double | tm | ) | const |
Return the index of the point nearest to the provided time. in the event two points are equidistant from the time, the earlier one is returned. If the plan is empty, -1 will be returned.
tm | time |
const std::string & larcfm::Plan::getNote | ( | ) | const |
Return the note of this plan.
const Position larcfm::Plan::getPos | ( | int | i | ) | const |
int larcfm::Plan::getSegment | ( | double | tm | ) | const |
Return the segment number that contains 'time' in [s]. If the time is not contained in the flight plan then -1 is returned. If the time for point 0 is 10.0 and the time for point 1 is 20.0, then getSegment(10.0) will produce 0, getSegment(15.0) will produce 0, and getSegment(20.0) will produce 1.
int larcfm::Plan::getSegmentByDistance | ( | double | d | ) | const |
Return segment that is distance "d" from beginning of plan
d | distance of interest |
int larcfm::Plan::getSegmentByDistance | ( | int | startIx, |
double | d | ||
) | const |
Return segment that is distance "d" from segment startIx
startIx | starting index |
d | distance of interest |
TcpData larcfm::Plan::getTcpData | ( | int | i | ) | const |
i | plan index |
double larcfm::Plan::getVsAccel | ( | int | i | ) |
Vertical speed acceleration at a point
i | index of BVS |
double larcfm::Plan::gsAccelAtTime | ( | double | t | ) | const |
Return the ground speed rate of change (i.e., position acceleration in the "ground speed" dimension) associated with the point at time t.
t | time |
double larcfm::Plan::gsAtTime | ( | double | t | ) | const |
t | time |
double larcfm::Plan::gsAtTime | ( | double | t, |
bool | linear | ||
) | const |
ground speed at time t
t | time of interest |
linear | If true, then interpret plan in a linear manner |
double larcfm::Plan::gsAtTime | ( | int | seg, |
double | gsAtSeg, | ||
double | t, | ||
bool | linear | ||
) | const |
ground speed at time t (which must be in segment "seg")
seg | segment where time "t" is located |
gsAtSeg | ground speed out of segment "seg" |
t | time of interest |
linear | If true, then interpret plan in a linear manner |
double larcfm::Plan::gsFinal | ( | int | i, |
bool | linear | ||
) | const |
ground speed at the end of segment "i"
Note. if there is no acceleration, this will be the same as gsOut
i | The index of the point of interest |
linear | If true, then interpret plan in a linear manner |
|
private |
ground speed at the end of segment "i"
Note. if there is no acceleration, this will be the same as gsOut
i | The index of the point of interest |
linear | If true, then interpret plan in a linear manner |
double larcfm::Plan::gsIn | ( | int | seg | ) | const |
seg | The index of the point of interest |
double larcfm::Plan::gsIn | ( | int | seg, |
bool | linear | ||
) | const |
ground speed into point "seg"
seg | The index of the point of interest |
linear | If true, then interpret plan in a linear manner |
double larcfm::Plan::gsOut | ( | int | i, |
bool | linear | ||
) | const |
ground speed out of point "i"
i | The index of the point of interest |
linear | If true, then interpret plan in a linear manner |
double larcfm::Plan::gsOut | ( | int | seg | ) | const |
seg | The index of the point of interest |
double larcfm::Plan::gsOutCalc | ( | int | i, |
bool | linear | ||
) | const |
ground speed out of point "i"
i | The index of the point of interest |
linear | If true, then interpret plan in a linear manner |
|
inlinevirtual |
|
inlinevirtual |
Does this object have an error or a warning?
Implements larcfm::ErrorReporter.
bool larcfm::Plan::inAccel | ( | double | t | ) | const |
Is the aircraft accelerating (either horizontally or vertically) at this time?
t | time to check for acceleration |
bool larcfm::Plan::inAccelZone | ( | int | ix | ) | const |
true if this point is in a closed interval [BEGIN_TCP , END_TCP]
NOTE: inAccel(t) returns false if the point at time "t" is an end TCP. This method return true!
ix | index |
void larcfm::Plan::includeParameters | ( | ParameterData | pd | ) |
Include a parameterData object into the note field of this plan. This replaces any such information already in the note field.
pd | parameters to include. If empty, do not include parameter information in the note field (and delete any such previously in it) |
int larcfm::Plan::indexWellFormed | ( | ) | const |
This returns -1 if the entire plan is "well formed", i.e. all acceleration zones have a matching beginning and end point. Returns a nonnegative value to indicate the problem point. Also requires that there are no points closer together than Plan.minDt.
This returns -1 if the entire plan is "well formed", i.e. all acceleration zones have a matching beginning and end point. Returns a nonnegative value to indicate the problem point
bool larcfm::Plan::inGsAccel | ( | int | ix | ) | const |
In ground speed acceleration at index ix ?
ix | point index |
bool larcfm::Plan::inGsChange | ( | double | t | ) | const |
This returns true if the given time is greater than or equal to a BGS but before a EGS point
t | time |
|
protected |
initialize class variables
Velocity larcfm::Plan::initialVelocity | ( | int | i | ) | const |
estimate the velocity from point i to point i+1 (at point i).
i | index of point |
Velocity larcfm::Plan::initialVelocity | ( | int | i, |
bool | linear | ||
) | const |
calculate the velocity out of point i.
i | index of point |
linear | if true, measure the straight distance, if false measure the curved distance |
int larcfm::Plan::insertByDistance | ( | double | d | ) |
Insert a navpoint at the indicated distance from plan start.
d | distance (cannot be negative) |
Insert a navpoint at the indicated distance from plan start.
d | distance (can be negative) |
int larcfm::Plan::insertByDistance | ( | int | i, |
double | d | ||
) |
Insert a navpoint at the indicated distance from the given index point. Negative distances are before the given point.
i | index |
d | distance (may be positive or negative) |
Insert a navpoint at the indicated distance from the given index point. Negative distances are before the given point.
d | distance |
std::pair< double, double > larcfm::Plan::interpolateAltVs | ( | int | seg, |
double | dt, | ||
bool | linear | ||
) | const |
Return interpolated altitude in this segment at absolute time t
seg | getSegment(t) |
t | time of interest |
linear | linear flag |
bool larcfm::Plan::inTrkAccel | ( | int | ix | ) | const |
In track acceleration at index ix ?
ix | point index |
bool larcfm::Plan::inTrkChange | ( | double | t | ) | const |
This returns true if the given time is greater than or equal to a BGS but before a EGS point
t | time |
bool larcfm::Plan::inVsAccel | ( | int | ix | ) | const |
In vertical speed acceleration at index ix ?
ix | point index |
bool larcfm::Plan::inVsChange | ( | double | t | ) | const |
This returns true if the given time is greater than or equal to a BVS but before a EVS point
t | time |
bool larcfm::Plan::isAltPreserve | ( | int | i | ) | const |
Returns true if the point at index i is an altitude perserve point, false otherwise. 0 <= i < size()
i | index |
bool larcfm::Plan::isConsistent | ( | ) | const |
This returns true if the entire plan produces reasonable accelerations. If the plan has instantaneous "jumps," it is not consistent.
bool larcfm::Plan::isConsistent | ( | bool | silent | ) | const |
This returns true if the entire plan produces reasonable accelerations. If the plan has instantaneous "jumps," it is not consistent.
silent | use true to ensure limited console messages |
bool larcfm::Plan::isFlyable | ( | ) | const |
Checks if the entire plan contains reasonable accelerations. If the plan has instantaneous jumps, it is not flyable. A flyable plan is both consistent and continuous.
bool larcfm::Plan::isFlyable | ( | bool | silent | ) | const |
Checks if the entire plan produces reasonable accelerations. If the plan has instantaneous jumps, it is not flyable. A flyable plan is both consistent and continuous.
silent | Use true to suppress messages to console. |
This returns true if the entire plan is "sound"
bool larcfm::Plan::isGsConsistent | ( | bool | silent | ) |
This returns true if the entire plan produces reasonable accelerations. If the plan has instantaneous "jumps," it is not consistent.
silent | use true to ensure limited console messages |
bool larcfm::Plan::isGsContinuous | ( | int | i, |
double | gsEpsilon, | ||
bool | silent | ||
) | const |
Determines if the ground speed component of velocity is continuous at index i
i | index i |
gsEpsilon | tolerance of the test |
silent | if false, info about a discontinuity is printed |
bool larcfm::Plan::isLatLon | ( | ) | const |
Are points specified in Latitude and Longitude
bool larcfm::Plan::isLatLon | ( | bool | latlon | ) | const |
bool larcfm::Plan::isLinear | ( | ) | const |
search plan to see if there are any TCPs
bool larcfm::Plan::isOriginal | ( | int | i | ) | const |
Returns true if the point at index i is an unmodified original point, false otherwise. 0 <= i < size()
i | index |
bool larcfm::Plan::isTrkContinuous | ( | int | i, |
double | trkEpsilon, | ||
bool | silent | ||
) | const |
Determines if the track component of velocity is continuous at index i
i | index i |
trkEpsilon | tolerance of the test |
silent | if false, info about a discontinuity is printed |
bool larcfm::Plan::isTurnConsistent | ( | bool | silent | ) | const |
Check the Turn consistency of all of the points.
silent | if true, then do not display anything to the console |
bool larcfm::Plan::isTurnConsistent | ( | int | i, |
double | distH_Epsilon, | ||
bool | silent | ||
) | const |
Check the consistency of all of the points in the turn indicated by i
. This assumes that the plan is well-formed.
p | plan |
i | index of a point in a turn (typically the BOT) |
distH_Epsilon | horizontal epsilon |
silent | if true, then do not display anything to the console |
bool larcfm::Plan::isVelocityContinuous | ( | ) | const |
Checks if each point in the plan has approximately the same velocity in and velocity out.
bool larcfm::Plan::isVelocityContinuous | ( | bool | silent | ) | const |
Checks if each point in the plan has approximately the same velocity in and velocity out.
silent | true if limited console messages |
bool larcfm::Plan::isVirtual | ( | int | i | ) | const |
Returns true if the point at index i is a virtual point, false otherwise. 0 <= i < size()
i | index |
bool larcfm::Plan::isVsConsistent | ( | bool | silent | ) | const |
Check the Vertical Speed consistency of all of the points.
silent | if true, then do not display anything to the console |
bool larcfm::Plan::isVsContinuous | ( | int | i, |
double | velEpsilon, | ||
bool | silent | ||
) | const |
Determines if the vertical speed component of velocity is continuous at index i
i | index i |
velEpsilon | tolerance of the test |
silent | if false, info about a discontinuity is printed |
bool larcfm::Plan::isWeakConsistent | ( | ) | const |
This returns true if the entire plan produces reasonable accelerations. If the plan has instantaneous "jumps," it is not consistent.
bool larcfm::Plan::isWeakConsistent | ( | bool | silent | ) | const |
This returns true if the entire plan produces reasonable accelerations. If the plan has instantaneous "jumps," it is not consistent.
silent | use true to ensure limited console messages |
bool larcfm::Plan::isWeakFlyable | ( | ) | const |
A weak flyable plan is both weakly consistent and weakly continuous.
bool larcfm::Plan::isWeakFlyable | ( | bool | silent | ) | const |
A flyable plan is both consistent and continuous.
silent | Use true to suppress messages to console. |
This returns true if the entire plan is "sound"
bool larcfm::Plan::isWeakVelocityContinuous | ( | bool | silent | ) | const |
Checks if each point in the plan has approximately the same velocity in and velocity out.
silent | true if limited console messages |
bool larcfm::Plan::isWellFormed | ( | ) | const |
This returns true if the entire plan is "well formed", i.e. all acceleration zones have a matching beginning and end points. Also requires that there are no points closer together than Plan.minDt.
int larcfm::Plan::mergeClosePoints | ( | int | i, |
double | minDt | ||
) |
merge together all points closer together in time than "minDt".
minDt | the smallest delta time allowed between points. See also wellFormed() |
int larcfm::Plan::mergeClosePointsByDist | ( | int | j, |
double | minDist | ||
) |
merge points j-1 and j if they are closer together (in distance2D) than minDist
j | index to be merged |
minDist | minimum horizontal distance |
Note: it retains position of "j" (i.e. removes j-1)
void larcfm::Plan::mkAlt | ( | int | ix, |
double | newAlt | ||
) |
Change the altitude at point ix to "newAlt"
ix | plan index |
newAlt | new altitude |
void larcfm::Plan::mkGsConstant | ( | int | wp1, |
int | wp2, | ||
double | gs | ||
) |
Make a new plan with constant ground speed from wp1 to wp2.
200 200 200 200 200
0 --— 1 --— 2 --— 3 --— 4 --— 5
mkGsConstant(p, 1, 3, 500)
200 500 500 200 200 200 0 --— 1 --— 2 --— 3 --— 4 --— 5
Note that if wp1 == wp2 no change is made.
Note: If the initial plan has zero ground speed segments, then the final plan may have points removed.
Note. This method can handle kinematic models, but it may result in loss of velocity continuity
wp1 | starting index |
wp2 | ending index |
gs | new ground speed |
bool larcfm::Plan::mkGsIn | ( | int | ix, |
double | gs | ||
) |
Change the ground speed into ix to be gs – all other ground speeds remain the same in the linear case Note: If ix is in an acceleration zone, this will also affect gsOut(ix-1) Note: If the segment has zero length, or parameter gs = 0, special considerations are present
ix | index |
gs | new ground speed |
Change the ground speed into ix to be gs – all other ground speeds remain the same in the linear case Note: If ix is in an acceleration zone, this will also affect gsOut(ix-1)
ix | index |
gs | new ground speed |
bool larcfm::Plan::mkGsOut | ( | int | ix, |
double | gs | ||
) |
Change the ground speed at ix to be gs – all other ground speeds remain the same if linear Note: If ix is in an acceleration zone, this will also affect gsIn(ix+1) Note: If the segment has zero length, or parameter gs = 0, special considerations are present
ix | index |
gs | new ground speed |
Change the ground speed at ix to be gs – all other ground speeds remain the same NOTE: This assumes that there are no BVS - EVS segments in the area
Note: If point is a begin TCP, we need to update the velocityIn
p | Plan of interest |
ix | index |
gs | new ground speed |
int larcfm::Plan::nextBGS | ( | int | current | ) | const |
This returns the index of the Ground Speed Change Begin point greater than the given index, or -1 if there is no such point.
current | current index |
int larcfm::Plan::nextBOT | ( | int | current | ) | const |
This returns the index of the next Beginning of Turn (BOT) point that occurs after "current"
current | start search after this index |
int larcfm::Plan::nextBVS | ( | int | current | ) | const |
This returns the index of the next Vertical Speed Change begin point that is greater than the given index, or -1 if there is no such point. This is generally intended to be used to find the end of an acceleration zone.
current | current index |
int larcfm::Plan::nextEGS | ( | int | current | ) | const |
This returns the index of the Ground Speed Change End point greater than the given index, or -1 if there is no such point.
current | starting index |
int larcfm::Plan::nextEOT | ( | int | current | ) | const |
This returns the index of the End of Turn point greater than the given index, or -1 if there is no such point. This is generally intended to be used to find the end of an acceleration zone.
current | current index |
int larcfm::Plan::nextEVS | ( | int | current | ) | const |
This returns the index of the Vertical Speed Change End point that is greater than the given index, or -1 if there is no such point. This is generally intended to be used to find the end of an acceleration zone.
current | current index |
int larcfm::Plan::nextGsTCP | ( | int | current | ) | const |
This finds the next Gs TCP
int larcfm::Plan::nextPtOrEnd | ( | int | startWp | ) | const |
Returns the index of the next point which is after startWp. If the startWp is greater or equal to the last wp, then the index of the last point is returned. Note: if the plan is empty, this returns a -1
startWp | index |
int larcfm::Plan::nextTCP | ( | int | current | ) | const |
Return the lowest indexed TCP point that is greater than current, or -1 if none
current | start point for search |
int larcfm::Plan::nextTrkTCP | ( | int | current | ) | const |
This finds the last index where the TCP type is BOT or EOT. If BOT or EOT are never found, then return -1.
current | the index of the point to begin the search |
int larcfm::Plan::nextVsTCP | ( | int | current | ) | const |
This finds the last previous index where the TCP is of type tcp1 or tcp2
bool larcfm::Plan::operator!= | ( | const Plan & | o | ) | const |
Inequality
bool larcfm::Plan::operator== | ( | const Plan & | o | ) | const |
Tests if one plan object has the same contents as another.
double larcfm::Plan::partialPathDistance | ( | double | t, |
bool | linear | ||
) | const |
return the path distance from the location at time t until the next point
t | current time of interest |
linear | if "linear" then ignore BOTs |
double larcfm::Plan::pathDistance | ( | ) | const |
Find the cumulative horizontal (curved) path distance for whole plan.
double larcfm::Plan::pathDistance | ( | int | i | ) | const |
Find the horizontal (curved) distance between points i and i+1 [meters].
i | index of starting point |
double larcfm::Plan::pathDistance | ( | int | i, |
bool | linear | ||
) | const |
Calculate the horizontal distance between points i and i+1 [meters].
i | index of starting point |
linear | if true, measure the straight distance, if false measure the curved distance |
double larcfm::Plan::pathDistance | ( | int | i, |
int | j | ||
) | const |
Find the cumulative horizontal (curved) path distance between points i and j [meters].
i | first index |
j | second index |
double larcfm::Plan::pathDistance | ( | int | i, |
int | j, | ||
bool | linear | ||
) | const |
Find the cumulative horizontal path distance between points i and j [meters].
i | beginning index |
j | ending index |
linear | if true, then TCP turns are ignored. Otherwise, the length of the circular turns are calculated. |
double larcfm::Plan::pathDistanceToPoint | ( | double | t, |
int | j | ||
) | const |
calculate path distance from the current position at time t to point j
t | current time |
j | next point |
|
static |
Create a (simple) new Plan by projecting state information.
id | Name of aircraft |
pos | Initial position of aircraft |
v | Initial velocity of aircraft (if pos in in lat/lon, then this assumes a great circle initial heading) |
startTime | Time of initial state |
endTime | Final time when projection ends |
const NavPoint larcfm::Plan::point | ( | int | i | ) | const |
Position larcfm::Plan::position | ( | double | t | ) | const |
Return a linear interpolation of the position at the given time. If the time is beyond the end of the plan and getExtend() is true, then the position is extrapolated after the end of the plan. An error is set if the time is before the beginning of the plan.
t | time |
Position larcfm::Plan::position | ( | double | t, |
bool | linear | ||
) | const |
Return the position at the given time.
t | time |
linear | if true, ignore accelerations |
Compute position and velocity at time t
Note that the calculation proceeds in steps. First, the 2D path is determined. This gives a final position and final track. Then ground speed is computed. Finally vertical speed is computed.
t | time of interest |
std::pair< Position, Velocity > larcfm::Plan::posVelWithinSeg | ( | int | seg, |
double | t, | ||
bool | linear, | ||
double | gsAt_d | ||
) | const |
Assumes seg = getSegment(t)
t | time |
linear | If true, then interpret plan in a linear manner |
gsAt_d | ground speed at time t |
std::pair< Position, Velocity > larcfm::Plan::posVelWithinSeg2D | ( | int | seg, |
double | t, | ||
bool | linear, | ||
double | gsAt_d | ||
) | const |
Assumes seg = getSegment(t)
t | time of interest |
linear | If true, then interpret plan in a linear manner |
gsAt_d | ground speed at time t |
int larcfm::Plan::prevBGS | ( | int | current | ) | const |
This returns the index of the Ground Speed Change Begin point less than the given index, or -1 if there is no such point. This is generally intended to be used to find the beginning of an acceleration zone.
current | the index of the point to begin the search (Note: the index may be up to size instead of size-1. This allows the current point to be checked by this method.) |
int larcfm::Plan::prevBOT | ( | int | current | ) | const |
This returns the index of the Beginning of Turn (BOT) point that is less than the given index, or -1 if there is no such point. This is generally intended to be used to find the beginning of an acceleration zone.
current | the index of the point to begin the search (Note: the index may be up to size instead of size-1. This allows the current point to be checked by this method.) |
int larcfm::Plan::prevBVS | ( | int | current | ) | const |
This returns the index of the Vertical Speed Change Begin point less than the given index, or -1 if there is no such point. This is generally intended to be used to find the beginning of an acceleration zone.
current | the index of the point to begin the search (Note: the index may be up to size instead of size-1. This allows the current point to be checked by this method.) |
int larcfm::Plan::prevEGS | ( | int | current | ) | const |
This returns the index of the ground speed end point less than or equal to the given index, or -1 if there is no such point. This is generally intended to be used to find the beginning of an acceleration zone.
current | the index of the point to begin the search (Note: the index may be up to size instead of size-1. This allows the current point to be checked by this method.) |
int larcfm::Plan::prevEOT | ( | int | current | ) | const |
This returns the index of the turn end point less than the given index, or -1 if there is no such point. This is generally intended to be used to find the beginning of an acceleration zone.
current | the index of the point to begin the search (Note: the index may be up to size instead of size-1. This allows the current point to be checked by this method.) |
int larcfm::Plan::prevEVS | ( | int | current | ) | const |
This returns the index of the vertical speed end point less than or equal to the given index, or -1 if there is no such point. This is generally intended to be used to find the beginning of an acceleration zone.
current | the index of the point to begin the search (Note: the index may be up to size instead of size-1. This allows the current point to be checked by this method.) |
int larcfm::Plan::prevGS | ( | int | current | ) | const |
Find the last BGS or EGS before "current" point. Will not return "current"
current | index point |
int larcfm::Plan::prevGsTCP | ( | int | current | ) | const |
This finds the last previous index where the TCP is a speed change type
int larcfm::Plan::prevTCP | ( | int | current | ) | const |
Return the highest indexed TCP point that is less than current, or -1 if none
current | start point for search |
int larcfm::Plan::prevTRK | ( | int | current | ) | const |
Find the last BOT or EOT before "current" point. Will not return "current"
current | index point |
int larcfm::Plan::prevTrkTCP | ( | int | current | ) | const |
This finds the last index where the TCP type is BOT or EOT. If BOT or EOT are never found, then return -1.
current | the index of the point to begin the search |
int larcfm::Plan::prevVS | ( | int | current | ) | const |
Find the last BVS or EVS before "current" point. Will not return "current"
current | index point |
int larcfm::Plan::prevVsTCP | ( | int | current | ) | const |
This finds the last previous index where the TCP is of type tcp1 or tcp2
void larcfm::Plan::remove | ( | int | i | ) |
Remove the i-th point in this plan. (note: This does not store the fact a point was deleted.)
i | index |
void larcfm::Plan::remove | ( | int | i, |
int | k | ||
) |
Remove a range of points i to j, inclusive, from a plan. (note: This does not store the fact a point was deleted.)
void larcfm::Plan::removeAltPreserves | ( | ) |
Remove all AltPreserve Flags from plan
Note: AltPreserve is used by TrajGen to define the vertical profile and keep it unaltered as multiple passes over the plan are executed.
int larcfm::Plan::removeIfRedundant | ( | int | ix | ) |
Remove point from plan if it passes trk and gs tests
ix | index of interest |
int larcfm::Plan::removeIfRedundant | ( | int | ix, |
bool | trkF, | ||
bool | gsF, | ||
bool | vsF | ||
) |
Remove point from plan if it passes all specified tests (indicated by flags
ix | index of interest |
trkF | track flag: perform track continuity test |
gsF | ground speed flag: perform ground speed continuity test |
vsF | vertical speed flag: perform vertical speed continuity test |
int larcfm::Plan::removeIfRedundant | ( | int | ix, |
bool | trkF, | ||
bool | gsF, | ||
bool | vsF, | ||
double | minTrk, | ||
double | minGs, | ||
double | minVs, | ||
bool | repair | ||
) |
Remove point from plan if it passes all specified tests (indicated by flags)
Note: This method can remove a "named" point, but will not remove a TCP or AltPreserve Note: A point is not redundant if it is a TCP, is AltPreserve, has information or a name or if there is a significant change in velocity as determined by parameters minTrk, minGs, and minVs,
ix | index of interest |
trkF | track flag: perform track continuity test |
gsF | ground speed flag: perform ground speed continuity test |
vsF | vertical speed flag: perform vertical speed continuity test |
minTrk | minimum track |
minGs | minimum ground speed |
minVs | minimum vertical speed |
repair | true if method should repair points |
void larcfm::Plan::removeRedundantPoints | ( | int | from, |
int | to | ||
) |
Remove all redundant points in Plan in the index range [from,to] using "removeIfRedundant"
Note: A point is NOT redundant if it is a TCP, is AltPreserve, has information or a name or if there is significant change in velocity.
from | starting location |
to | ending location |
void larcfm::Plan::repairGsConsistency | ( | ) |
Attempt to fix (gs) acceleration inconsistencies in this plan by adjusting accel values and/or point times.
void larcfm::Plan::repairGsContinuity | ( | int | ixBGS, |
int | ixEGS, | ||
double | vo, | ||
double | vf, | ||
double | maxGsAccel | ||
) |
Given a gs accel zone and modified starting and ending velocities, change the acceleration and internal points' times so that it is continuous with the velocities into and out of the BGS-EGS zone
p | Plan to be fixed |
ixBGS | index of BGS |
ixEGS | index of EGS |
vo | target gsOut at ixBGS |
vf | target gsIn at ixEGS |
maxGsAccel | maximum gs acceleration allowed |
NOTE: given d, vo, vf calculate a and dt using two equations:
d = vo*t + 0.5*a*t*t vf = vo + a*t
NOTE: if the calculated acceleration exceeds maxGsAccel, then add error to plan
void larcfm::Plan::repairMOT | ( | int | ixBOT | ) |
supply missing MOTs
ixBOT | index of a BOT |
void larcfm::Plan::repairNegGsIn | ( | int | ix | ) |
Repair a negative GsIn value at ix
ix |
void larcfm::Plan::repairNegGsOut | ( | int | ix | ) |
Repair a negative GsOut value at ix
ix |
void larcfm::Plan::repairPlan | ( | ) |
Clean up mismatched begin or end tcp markers.
void larcfm::Plan::revertGsTCP | ( | int | ix | ) |
Structurally revert BGS-EGS pair at index "ix" Note: it assumes that BGS-EGS pairs will be removed in ascending order
ix | index |
void larcfm::Plan::revertGsTCPs | ( | ) |
Revert all BGS-EGS pairs
void larcfm::Plan::revertTurnTCP | ( | int | ixBOT | ) |
Structurally revert Turn TCP at ix. This method assumes ix > 0 AND ix < pln.size(). If ix is not a BOT, then nothing is done
NOTE: Assumes BGS_EGS and BVS-EVS TCPs have already been reverted
ixBOT | index of point to be reverted |
void larcfm::Plan::revertTurnTCPs | ( | ) |
Revert all BOT-EOT pairs in range "start" to "end"
int larcfm::Plan::revertVsTCP | ( | int | ix | ) |
Revert BVS at ix to an instantaneous vertical speed change
ixBVS | index of a BVS point |
void larcfm::Plan::revertVsTCPs | ( | ) |
Revert all BVS-EVS pairs
Attempt to replace the i-th point with the given NavPoint. If successful, this returns the index of the new point (which may change because of a new time relative to the old point). This method returns an error if the given index is out of bounds or a warning if the new point overlaps with (and replaces) a different existing point.
i | the index of the point to be replaced |
v | the new point to replace it with |
d | the new TcpData to replace |
void larcfm::Plan::setAlt | ( | int | i, |
double | alt | ||
) |
Set altitude of point "i" to "alt"
i | index |
alt | altitude |
void larcfm::Plan::setAltPreserve | ( | int | i | ) |
AltPreserve is used by TrajGen.generateVsTCPs to create a vertical profile that is a function of locations (rather than time which is very fluid). The TrajGen method "markVsChanges" marks points with a significant vertical speed change as "AltPreserve".
i | index of point set as "AltPReserve" |
void larcfm::Plan::setAltVSin | ( | int | i, |
double | vs, | ||
bool | preserve | ||
) |
Set the altitude at a point such that the vertical speed into that point is "vs", given the vertical speed accelerations (possibly ignored)
i | index |
vs | vertical speed |
preserve | preserve flag |
void larcfm::Plan::setBOT | ( | int | i, |
double | signedRadius, | ||
Position | center | ||
) |
makes the point at index i to be a BOT
i | plan index |
signedRadius | signed radius, positive indicates turn right, negative indicated turn left |
center | center of turn |
void larcfm::Plan::setBVS | ( | int | i, |
double | acc | ||
) |
makes the point at index i to be a BVS
i | plan index |
acc | vertical speed acceleration |
void larcfm::Plan::setEOT | ( | int | i | ) |
makes the point at index i to be an EOT
i | plan index |
void larcfm::Plan::setEOTBOT | ( | int | i, |
double | signedRadius, | ||
Position | center | ||
) |
makes the point at index i to be an EOTBOT
i | plan index |
signedRadius | signed radius, positive indicates turn right, negative indicated turn left |
center | center of turn |
void larcfm::Plan::setGsAccel | ( | int | i, |
double | accel | ||
) |
Sets the desired ground speed acceleration of point i (in a linear plan)
Note: This is used by TrajGen.makeKinematicPlan to create a BGS-EGS with a user-specified gs acceleration rather than one generated using the parameter. This enables different accelerations at different points.
i | index of point |
accel | ground speed acceleration to be set |
void larcfm::Plan::setID | ( | const std::string & | s | ) |
Set the name of this plan (probably the aircraft name).
s | name |
void larcfm::Plan::setInfo | ( | int | i, |
const std::string & | info | ||
) |
Set information field
i | index |
info | value |
|
static |
Restores TrajGen generation parameters back to default values
int larcfm::Plan::setNavPoint | ( | int | i, |
const NavPoint & | v | ||
) |
Attempt to replace the i-th point with the given NavPoint. The TcpData from the old point is retained. If successful, this returns the index of the new point (which may change because of a new time relative to the old point). This method returns -1 and sets an error if the given index is out of bounds or a warning if the new point overlaps with (and replaces) a different existing point.
i | the index of the point to be replaced |
v | the new NavPoint to replace it with |
void larcfm::Plan::setNote | ( | const std::string & | s | ) |
Set the note of this plan (probably the aircraft name).
s | note |
void larcfm::Plan::setOriginal | ( | int | i | ) |
Returns true if the point at index i is an original point
i | plan index |
int larcfm::Plan::setTcpData | ( | int | i, |
TcpData | v | ||
) |
Attempt to replace the i-th point's tcp data with the given data. The navpoint from the old point is retained. If successful, this returns the index of the new point. This method returns -1 and sets an error if the given index is out of bounds.
i | the index of the point to be replaced |
v | the new TcpData to replace it with |
void larcfm::Plan::setTime | ( | int | i, |
double | t | ||
) |
Set the time of the given point to the given value. Note the index of the point may change due to a new time.
i | the index of the point to change |
t | the new time |
void larcfm::Plan::setTimeGsIn | ( | int | i, |
double | gs | ||
) |
Set the time at a point such that the ground speed into that point is "gs", given the ground speed accelerations (possibly ignored);
Note: This does not leave speeds after this point unchanged as "mkGsIn" does
i | index |
gs | ground speed |
void larcfm::Plan::setVertexRadius | ( | int | i, |
double | radius | ||
) |
Sets the radius of point i (in a linear plan)
Note: This is used by TrajGen.makeKinematicPlan to create a turn with a user-specified radius rather than one generated from a bank angle and ground speed.
i | index of point |
radius | value to be set |
Note: the radius may be either signed or unsigned. The TrajGen generators use the absolute value of this parameter. Note that the radius stored in a BOT must be signed. This is done in the turn generators.
void larcfm::Plan::setVirtual | ( | int | i | ) |
makes point a virtual point
Note: virtual points are temporarily added during conflict detection and resolution
i | plan index |
void larcfm::Plan::setVsAccel | ( | int | i, |
double | accel | ||
) |
Sets the desired vertical speed acceleration of point i (in a linear plan)
Note: This is used by TrajGen.makeKinematicPlan to create a BVS-EVS with a user-specified vs acceleration rather than one generated using the parameter. This enables different accelerations at different points.
i | index of point |
accel | vertical speed acceleration to be set |
double larcfm::Plan::signedRadius | ( | int | i | ) | const |
Return the (signed) radius for the given index. This is the radius defined at the vertex. See method setVertexRadius.
i | index of point |
int larcfm::Plan::size | ( | ) | const |
If size() == 0 then this is a "null" plan.
std::string larcfm::Plan::strWellFormed | ( | ) | const |
This returns a string representing which part of the plan is not "well formed", i.e. all acceleration zones have a matching beginning and end point. See isWellFormed().
This returns a string representing which part of the plan is not "well formed", i.e. all acceleration zones have a matching beginning and end point.
double larcfm::Plan::time | ( | int | i | ) | const |
Given an index i, returns the corresponding point's time in seconds. If the index is outside the range of points, then an error is set.
i | the segment number |
double larcfm::Plan::timeFromDistance | ( | double | dist | ) | const |
Return the time that corresponds to the point that is path distance "rdist" from the start of plan
dist | non-negative distance from start of plan |
|
static |
time required to cover distance "dist" if initial speed is "vo" and acceleration is "gsAccel"
vo | initial velocity |
gsAccel | ground speed acceleration |
dist | distance |
time required to cover distance "dist" if initial speed is "vo" and acceleration is "gsAccel"
gsAccel | |
vo | |
dist |
double larcfm::Plan::timeFromDistance | ( | int | startSeg, |
double | dist | ||
) | const |
Return the absolute time that corresponds to the point that is path distance "dist" from startSeg
startSeg | starting segment |
dist | non-negative distance from start of segment |
Return the absolute time that corresponds to the point that is path distance "dist" from startSeg
dist | distance from start of plan |
double larcfm::Plan::timeFromDistanceWithinSeg | ( | int | seg, |
double | rdist | ||
) | const |
Return the delta time that corresponds to the point that is path distance "rdist" from the start of segment "seg"
seg | segment of interest |
rdist | non-negative distance from "seg" |
Note: if there is a gs0=0 segment, return the time of the start of the segment return -1 on out of bounds input
bool larcfm::Plan::timeShiftPlan | ( | int | start, |
double | st | ||
) |
Temporally shift all points in the plan (starting at index start) by the provided amount st. This will drop any points that become negative or that become out of order. Note this also shifts the start point as well as any points marked as time-fixed.
std::string larcfm::Plan::toString | ( | ) | const |
String representation of the entire plan
std::string larcfm::Plan::toStringGs | ( | ) | const |
String representation of the entire plan
|
private |
std::string larcfm::Plan::toStringProfile | ( | ) | const |
String representation of the entire plan in a tabular form
std::string larcfm::Plan::toStringTrk | ( | ) | const |
String representation of the entire plan
std::string larcfm::Plan::toStringVelocity | ( | int | velField | ) | const |
String representation of the entire plan
std::string larcfm::Plan::toStringVs | ( | ) | const |
String representation of the entire plan
std::string larcfm::Plan::toUnitTest | ( | std::string | prefix, |
bool | asserts, | ||
bool | si | ||
) |
used to create a unit test from the plan. It creates a Java version of the Plan
prefix | create variable names using this prefix (prevents duplicate variable defs) |
asserts | if true, create some assert statements |
si | if true, create Java code to use SI units |
double larcfm::Plan::trkFinal | ( | int | seg, |
bool | linear | ||
) | const |
Calculate track angle at the end of segment "seg"
seg | The index of the point of interest |
linear | If true, then interpret plan in a linear manner |
double larcfm::Plan::trkInTurn | ( | int | ix, |
int | ixBOT | ||
) | const |
return track angle at point ix within a turn starting at ixBOT
ix | an index between an ixBOT and ixEOT |
ixBOT | index of the beginning of turn |
double larcfm::Plan::trkOut | ( | int | seg, |
bool | linear | ||
) | const |
Calculate track angle out of point "seg"
seg | The index of the point of interest |
linear | If linear is true, then interpret plan in a linear manner |
Position larcfm::Plan::turnCenter | ( | int | i | ) | const |
This method returns a center of turn position with the same altitude as the current point. If the current point is not a turn point, and has a zero stored radius, this returns an invalid position.
i | index of BOT where turn info is stored |
int larcfm::Plan::turnDir | ( | int | i | ) | const |
turn direction at index i
i | plan index (of BOT containing turn info) |
double larcfm::Plan::turnRadiusAtTime | ( | double | t | ) | const |
If time t is in a turn, this returns the radius, otherwise returns a negative value.
t | time |
bool larcfm::Plan::validIndex | ( | int | i | ) | const |
Checks if index is in range of the plan
i | index to be checked |
Velocity larcfm::Plan::velocity | ( | double | tm | ) | const |
Estimate the initial velocity at the given time for this aircraft.
A time before the beginning of the plan returns a zero velocity.
tm | time |
Estimate the initial velocity at the given time for this aircraft. A time before the beginning of the plan returns a zero velocity.
Velocity larcfm::Plan::velocity | ( | double | tm, |
bool | linear | ||
) | const |
Estimate the initial velocity at the given time for this aircraft.
A time before the beginning of the plan returns a zero velocity.
tm | time |
linear | true, if linear plan is to be used |
Estimate the initial velocity at the given time for this aircraft. A time before the beginning of the plan returns a zero velocity.
Velocity larcfm::Plan::velocityFromDistance | ( | double | d | ) | const |
Return the velocity of the point that is path distance "rdist" from the start of plan
d | non-negative distance from start of plan |
double larcfm::Plan::vertDistance | ( | int | i | ) | const |
calculates vertical distance from point i to point i+1
i | point of interest |
double larcfm::Plan::vertDistance | ( | int | i, |
int | j | ||
) | const |
Find the cumulative vertical distance between points i and j [meters].
i | first point |
j | second point |
Find the cumulative horizontal (curved) path distance between points i and j [meters].
|
static |
Calculate the vertex point from which a turn was generated using botPos, eotPos, radius, center , etc
botPos | position of turn beginning |
eotPos | position of end of turn |
radius | radius of turn |
dir | direction +1 = right, -1 = left |
center | center position |
altMid | altitude at middle of turn |
botPos | position of turn beginning |
eotPos | position of end of turn |
radius | radius of turn |
dir | direction +1 = right, -1 = left |
center | center position |
altMid | altitude at middle of turn |
|
static |
botPos | position of turn beginning |
eotPos | position of end of turn |
signedRadius | signed radius of turn: +1 = right, -1 = left |
trkInit | initial track at botPos |
altMid | altitude at middle of turn |
Position larcfm::Plan::vertexFromTurnTcps | ( | int | ixBOT, |
int | ixEOT, | ||
double | altMid | ||
) | const |
Structurally calculate vertex of turn from BOT and EOT. If altMid ≥ 0 THEN use it for the altitude. Otherwise search for a middle point to get altitude.
ixBOT | index of Beginning of Turn (BOT) |
ixEOT | index of End of Turn (BOT) |
altMid | altitude at middle point of turn |
NavPoint larcfm::Plan::vertexPointTurnTcps | ( | int | ixBOT, |
int | ixEOT, | ||
double | altMid | ||
) | const |
Calculate the vertex point from which a turn was generated using BOT and EOT
ixBOT | index of BOT |
ixEOT | index of EOT |
altMid | altitude to assign to vertex |
double larcfm::Plan::vertexRadius | ( | int | i | ) | const |
An unsigned radius value that is stored at a vertex. See method setVertexRadius.
i | vertex index |
double larcfm::Plan::verticalSpeed | ( | int | i | ) | const |
Calculate vertical speed from point i to point i+1 (at point i).
i | index of the point |
double larcfm::Plan::vsAccelAtTime | ( | double | t | ) | const |
Return the vertical speed rate of change (i.e., acceleration in the vertical dimension) associated with the point at time t.
t | time |
double larcfm::Plan::vsAtTime | ( | double | t, |
bool | linear | ||
) | const |
vertical speed at time t
t | time of interest |
linear | If true, then interpret plan in a linear manner |
double larcfm::Plan::vsAtTime | ( | int | seg, |
double | vsAtSeg, | ||
double | t, | ||
bool | linear | ||
) | const |
vertical speed at time t (which must be in segment "seg")
seg | segment where time "t" is located |
vsAtSeg | vertical speed out of segment "seg" |
t | time of interest |
linear | If true, then interpret plan in a linear manner |
double larcfm::Plan::vsFinal | ( | int | i, |
bool | linear | ||
) | const |
vertical speed at the end of segment "i"
Note. if there is no acceleration, this will be the same as vsOut
i | The index of the point of interest |
linear | If true, then interpret plan in a linear manner |
double larcfm::Plan::vsIn | ( | int | seg | ) | const |
seg | The index of the point of interest |
double larcfm::Plan::vsIn | ( | int | seg, |
bool | linear | ||
) | const |
vertical speed into point "seg"
seg | The index of the point of interest |
linear | If true, then interpret plan in a linear manner |
double larcfm::Plan::vsOut | ( | int | i, |
bool | linear | ||
) | const |
vertical speed out of point "i"
i | The index of the point of interest |
linear | If true, then interpret plan in a linear manner |
double larcfm::Plan::vsOut | ( | int | seg | ) | const |
seg | The index of the point of interest |
|
staticprivate |
Do not rely on this like an invalid value in Vect3::INVALID