ICAROUS
All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros Modules Pages
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Types | Protected Member Functions | Protected Attributes | Static Protected Attributes | Private Member Functions | Static Private Attributes | Friends | List of all members
larcfm::Plan Class Reference

#include <Plan.h>

Inheritance diagram for larcfm::Plan:
larcfm::ErrorReporter

Public Member Functions

 Plan ()
 
 Plan (const std::string &name)
 
 Plan (const std::string &name, const std::string &note)
 
 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, TcpDataget (int i) const
 
TcpData getTcpData (int i) const
 
TcpDatagetTcpDataRef (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, VelocityposVelWithinSeg2D (int seg, double t, bool linear, double gsAt_d) const
 
std::pair< Position, VelocityadvanceDistanceWithinSeg2D (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, VelocityposVelWithinSeg (int seg, double t, bool linear, double gsAt_d) const
 
std::pair< Position, VelocitypositionVelocity (double t, bool linear) const
 
std::pair< Position, VelocitypositionVelocity (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 &center, 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, TcpDatamakeBOT (Position p, double t, double signedRadius, const Position &center)
 
static std::pair< NavPoint, TcpDatamakeEOT (Position p, double t)
 
static std::pair< NavPoint, TcpDatamakeEOTBOT (Position p, double t, double signedRadius, const Position &center)
 
static std::pair< NavPoint, TcpDatamakeBGS (const std::string &name, Position p, double t, double a)
 
static std::pair< NavPoint, TcpDatamakeEGS (Position p, double t)
 
static std::pair< NavPoint, TcpDatamakeEGSBGS (const std::string &name, Position p, double t, double a)
 
static std::pair< NavPoint, TcpDatamakeBVS (const std::string &name, Position p, double t, double a)
 
static std::pair< NavPoint, TcpDatamakeEVS (Position p, double t)
 
static std::pair< NavPoint, TcpDatamakeEVSBVS (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< NavPointnavPointVector
 
typedef navPointVector::iterator navPointIterator
 
typedef std::vector< TcpDatatcpDataVector
 
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
 

Detailed Description

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:

  1. create a Plan from a linear Plan using TrajectoryGen.makePlan( ... )
  2. compute position as a function of time using Plan.position(t)

Constructor & Destructor Documentation

◆ Plan() [1/4]

larcfm::Plan::Plan ( )

Create an empty Plan

◆ Plan() [2/4]

larcfm::Plan::Plan ( const std::string &  name)
explicit

Create an empty Plan with the given id

Parameters
namename of this plan, typically the aircraft id

◆ Plan() [3/4]

larcfm::Plan::Plan ( const std::string &  name,
const std::string &  note 
)

Create an empty Plan with the given id

Parameters
namename of this plan, typically the aircraft id
notegeneral information about this Plan.

◆ Plan() [4/4]

larcfm::Plan::Plan ( const Plan fp)

Construct a new object that is a deep copy of the supplied object

Parameters
fpplan to copy

Member Function Documentation

◆ add()

int larcfm::Plan::add ( const Position p,
double  time 
)

Add a NavPoint to the plan constructed from a Position and a time

Parameters
pPosition
timeTime
Returns
updated plan

◆ addBOT()

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)

Parameters
iplan index
signedRadiussigned radius, positive indicates turn right, negative indicated turn left
centercenter of turn

◆ addEGS()

void larcfm::Plan::addEGS ( int  i)

makes the point at index i to be either a BGS or EGSBGS)

Parameters
iplan index
signedRadiussigned radius, positive indicates turn right, negative indicated turn left
centercenter of turn

◆ addEOT()

void larcfm::Plan::addEOT ( int  i)

makes the point at index i to be an end of turn (either BOT or EOTBOT)

Parameters
iplan index
signedRadiussigned radius, positive indicates turn right, negative indicated turn left
centercenter of turn

◆ addEVS()

void larcfm::Plan::addEVS ( int  i)

makes the point at index i to be either a BGS or EGSBGS)

Parameters
iplan index
signedRadiussigned radius, positive indicates turn right, negative indicated turn left
centercenter of turn

◆ addNavPoint()

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.

Parameters
pthe point to add
Returns
the (non-negative) index of the point if the point is added without problems, otherwise it will return a negative value.

◆ advanceDistance2D()

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

Parameters
seg
distFromSeg
linear
gsAt_d
Returns

◆ advanceDistanceWithinSeg2D() [1/2]

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)

Parameters
segstarting point index
distFromSegdistance to advance from starting point
linearif linear, use straight segments only
Returns
position

◆ advanceDistanceWithinSeg2D() [2/2]

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)

Parameters
segstarting point index
distFromSegdistance to advance from starting point
linearif linear, use straight segments only
Returns

◆ almostEquals() [1/2]

bool larcfm::Plan::almostEquals ( const Plan p) const

determines if plans are almost equals (not exactly equal because of floating point calculations

Parameters
pplan of interest
Returns
true if almost equal in location and time

◆ almostEquals() [2/2]

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

Parameters
pPlan to compare with
epsilon_horizallowable horizontal deviation [m]
epsilon_vertallowable vertical deviation [m]
Returns
true if almost equal in location and time

◆ alt()

double larcfm::Plan::alt ( int  i) const

Altitude at index i

Parameters
iplan index
Returns
Altitude at index i

◆ appendInfo()

void larcfm::Plan::appendInfo ( int  i,
const std::string &  info 
)

Append info at index i

Parameters
iplan index
infoinformation to be appended

◆ averageGroundSpeed()

double larcfm::Plan::averageGroundSpeed ( ) const

calculate average ground speed over entire plan

Returns
average ground speed

◆ averageVelocity() [1/2]

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.

Parameters
iindex
Returns
velocity

◆ averageVelocity() [2/2]

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.

Parameters
iindex
linearif true, calculate the linear velocity, otherwise calculate the kinematic velocity (use pathdistance for gs)
Returns
velocity

◆ calcDtGsIn()

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

Parameters
iindex of interest
gstarget ground speed
Returns
delta time needed

calculate delta time for point i to make ground speed into it = gs

Parameters
i
gs
Returns
delta time

◆ calcRadius()

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

Parameters
iindex
Returns
the calculated radius

◆ calcTimeGsIn()

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

Parameters
iindex
gsground speed
Returns
time

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

◆ cleanPlan()

void larcfm::Plan::cleanPlan ( )

Remove records of deleted points and make all remaining points "original"

Parameters
fp

◆ clear()

void larcfm::Plan::clear ( )

Clear a plan of its contents.

◆ clearVirtuals()

void larcfm::Plan::clearVirtuals ( )

Clear all virtual points in a plan.

◆ closestPoint() [1/2]

NavPoint larcfm::Plan::closestPoint ( const Position p) const

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.

Parameters
pposition
Returns
closest point

◆ closestPoint() [2/2]

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

Parameters
startstart point
endend point
pposition to check against
horizOnlyif true, only consider horizontal distances, if false, also compare vertical distances if the closest points on 2 segments are within maxHdist of each other
maxHdistonly used if horizOnly is false: compare vertical distances if candidate points are within this range of each other
Returns
closest point

◆ closestPoint3D() [1/2]

NavPoint larcfm::Plan::closestPoint3D ( const Position p) const

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.

Parameters
preference point
Returns
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.)

Parameters
seg
preference point
Returns

◆ closestPoint3D() [2/2]

std::pair< Vect3, double > larcfm::Plan::closestPoint3D ( int  seg,
const Vect3 v0 
) const

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.)

Parameters
seg
preference point
Returns

◆ closestPointHoriz() [1/2]

NavPoint larcfm::Plan::closestPointHoriz ( const Position p) const

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.

Parameters
pposition
Returns
point

◆ closestPointHoriz() [2/2]

NavPoint larcfm::Plan::closestPointHoriz ( int  seg,
const Position p 
) const

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.

Parameters
segsegment to check
preference position
Returns
closest point on the segment

◆ cut()

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

Parameters
firstIxfirst index
lastIxlast index
Returns
new cut down plan

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

◆ defTrkIn()

double larcfm::Plan::defTrkIn ( int  seg) const

This function generalizes trkIn to handle segments with zero ground speed.

Parameters
segThe index of the point of interest
Returns
defined track in

◆ defTrkOut()

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)

Parameters
segThe index of the point of interest
Returns
defined track out

◆ distFromPointToTime()

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)

Parameters
segstarting position
ttime of stopping position (must be in segment "seg")
linearIf true, then interpret plan in a linear manner
Returns
distance from NavPoint Always returns 0 if the time is less than minDt

Calculate the distance from the Navpoint at "seq" to plan position at time "t"

Parameters
seg
t
linear
Returns

◆ equals()

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.

Parameters
fpplan of interest
Returns
true, if equal

◆ extractParameters()

ParameterData larcfm::Plan::extractParameters ( ) const

Retrieve parameters stored in the plan's note field, if any.

Returns
ParameterData containing stored parameters, possibly empty.

◆ finalVelocity()

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)

Parameters
isegment of interest
linearif true, measure the straight distance, if false measure the curved distance
Returns
velocity at end of segment "i"

◆ findBot()

int larcfm::Plan::findBot ( int  i) const
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.

Parameters
pplan
iindex of some point within a turn
Returns
index of BOT, this index is less or equal to i.

◆ findInfo() [1/2]

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).

Parameters
infoinformation
Returns
index

◆ findInfo() [2/2]

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.

Parameters
infothe term to be searched for.
exactif 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.
Returns
Index of the first occurrence of the term, or -1 if not found

◆ findMOT()

int larcfm::Plan::findMOT ( int  ixBOT) const

Find middle of turn

Parameters
ixBOTindex of a BOT point
Returns
index of MOT

◆ findName() [1/2]

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.

Parameters
nameString to match
Returns
index

Return the index of first point that has a name equal to the given string, return -1 if there are no matches.

Parameters
nameString to match

◆ findName() [2/2]

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.

Parameters
namenane
startIxstart with this index
withWrapif true, go through whole list
Returns
index

Return the index of first point that has a name equal to the given string -1 if there are no matches.

Parameters
startIxstart with this index
nameString to match
withWrapif true, go through whole list

◆ fix()

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.

◆ getBoundBox()

BoundingBox larcfm::Plan::getBoundBox ( ) const

Get an approximation of the bounding rectangle around this plan

Returns
bounding box

Get an approximation of the bounding rectangle around this plan

◆ getFirstRealTime()

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

Returns
first time

◆ getFirstTime()

double larcfm::Plan::getFirstTime ( ) const

Return the time of the first point in the plan.

Returns
first time

◆ getGsAccel()

double larcfm::Plan::getGsAccel ( int  i)

Ground speed acceleration at a point

Parameters
iindex of BGS
Returns
ground speed acceleration stored in the BGS

◆ getID()

const std::string & larcfm::Plan::getID ( ) const

Return the name of this plan (probably the aircraft name).

◆ getIndex()

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}:

  • getIndex(-3.0) == -1 – before index 0
  • getIndex(1.0) == 1 – at index 1
  • getIndex(1.5) == -3 – between index 1 (-i-2) and 2 (-i-1)
  • getIndex(3.4) == -5 – between index 3 (-i-2) and 4 (-i-1)
  • getIndex(16.0) == -6 – after index 4 (-i-2)
Parameters
tma time
Returns
the index of the time, or negative if not found.

◆ getInfo()

std::string larcfm::Plan::getInfo ( int  i) const

Return information field

Parameters
iplan index
Returns
information stored at index i

◆ getLastPoint()

NavPoint larcfm::Plan::getLastPoint ( ) const

Return the last point in the plan.

Returns
last point

◆ getLastTime()

double larcfm::Plan::getLastTime ( ) const

Return the time of the last point in the plan.

Returns
last time

◆ getMessage()

std::string larcfm::Plan::getMessage ( )
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.

Returns
error and warning messages. If there are no messages, an empty string is returned.

Implements larcfm::ErrorReporter.

◆ getMessageNoClear()

std::string larcfm::Plan::getMessageNoClear ( ) const
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.)

Returns
error and warning messages. If there are no messages, an empty string is returned.

Implements larcfm::ErrorReporter.

◆ getName()

const std::string larcfm::Plan::getName ( int  i) const

Return the name of the point i.

Parameters
iindex
Returns
name of point

◆ getNearestIndex()

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.

Parameters
tmtime
Returns
index

◆ getNote()

const std::string & larcfm::Plan::getNote ( ) const

Return the note of this plan.

◆ getPos()

const Position larcfm::Plan::getPos ( int  i) const

Position at index "i"

Parameters
iindex
Returns
position at index "i"

◆ getSegment()

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.

◆ getSegmentByDistance() [1/2]

int larcfm::Plan::getSegmentByDistance ( double  d) const

Return segment that is distance "d" from beginning of plan

Parameters
ddistance of interest
Returns
segment number

◆ getSegmentByDistance() [2/2]

int larcfm::Plan::getSegmentByDistance ( int  startIx,
double  d 
) const

Return segment that is distance "d" from segment startIx

Parameters
startIxstarting index
ddistance of interest
Returns
segment number

◆ getTcpData()

TcpData larcfm::Plan::getTcpData ( int  i) const
Parameters
iplan index
Returns
TCP data at index i

◆ getVsAccel()

double larcfm::Plan::getVsAccel ( int  i)

Vertical speed acceleration at a point

Parameters
iindex of BVS
Returns
vertical speed acceleration stored in the BVS

◆ gsAccelAtTime()

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.

Parameters
ttime
Returns
gs accel

◆ gsAtTime() [1/3]

double larcfm::Plan::gsAtTime ( double  t) const
Parameters
ttime
Returns
ground speed at time t

◆ gsAtTime() [2/3]

double larcfm::Plan::gsAtTime ( double  t,
bool  linear 
) const

ground speed at time t

Parameters
ttime of interest
linearIf true, then interpret plan in a linear manner
Returns
ground speed at time t

◆ gsAtTime() [3/3]

double larcfm::Plan::gsAtTime ( int  seg,
double  gsAtSeg,
double  t,
bool  linear 
) const

ground speed at time t (which must be in segment "seg")

Parameters
segsegment where time "t" is located
gsAtSegground speed out of segment "seg"
ttime of interest
linearIf true, then interpret plan in a linear manner
Returns
ground speed at time t (which must be in segment "seg")

◆ gsFinal()

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

Parameters
iThe index of the point of interest
linearIf true, then interpret plan in a linear manner
Returns
ground speed at the end of segment "i"

◆ gsFinalCalc()

double larcfm::Plan::gsFinalCalc ( int  i,
bool  linear 
) const
private

ground speed at the end of segment "i"

Note. if there is no acceleration, this will be the same as gsOut

Parameters
iThe index of the point of interest
linearIf true, then interpret plan in a linear manner
Returns
ground speed at the end of segment "i"

◆ gsIn() [1/2]

double larcfm::Plan::gsIn ( int  seg) const
Parameters
segThe index of the point of interest
Returns
ground speed into point "seg"

◆ gsIn() [2/2]

double larcfm::Plan::gsIn ( int  seg,
bool  linear 
) const

ground speed into point "seg"

Parameters
segThe index of the point of interest
linearIf true, then interpret plan in a linear manner
Returns
ground speed, or NaN for segment 0.

◆ gsOut() [1/2]

double larcfm::Plan::gsOut ( int  i,
bool  linear 
) const

ground speed out of point "i"

Parameters
iThe index of the point of interest
linearIf true, then interpret plan in a linear manner
Returns
ground speed at the beginning of segment "i"

◆ gsOut() [2/2]

double larcfm::Plan::gsOut ( int  seg) const
Parameters
segThe index of the point of interest
Returns
ground speed out of point "seg"

◆ gsOutCalc()

double larcfm::Plan::gsOutCalc ( int  i,
bool  linear 
) const

ground speed out of point "i"

Parameters
iThe index of the point of interest
linearIf true, then interpret plan in a linear manner
Returns
ground speed at the beginning of segment "i"

◆ hasError()

bool larcfm::Plan::hasError ( ) const
inlinevirtual

Does this object have an error?

Returns
true if there is an error.

Implements larcfm::ErrorReporter.

◆ hasMessage()

bool larcfm::Plan::hasMessage ( ) const
inlinevirtual

Does this object have an error or a warning?

Returns
true if there is an error or warning.

Implements larcfm::ErrorReporter.

◆ inAccel()

bool larcfm::Plan::inAccel ( double  t) const

Is the aircraft accelerating (either horizontally or vertically) at this time?

Parameters
ttime to check for acceleration
Returns
true if accelerating

◆ inAccelZone()

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!

Parameters
ixindex
Returns
true if in accel zone

◆ includeParameters()

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.

Parameters
pdparameters to include. If empty, do not include parameter information in the note field (and delete any such previously in it)

◆ indexWellFormed()

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.

Returns
index of well formed point

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

◆ inGsAccel()

bool larcfm::Plan::inGsAccel ( int  ix) const

In ground speed acceleration at index ix ?

Parameters
ixpoint index
Returns
Returns true if point ix is in a ground speed acceleration zone

◆ inGsChange()

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

Parameters
ttime
Returns
true if in gs change

◆ init()

void larcfm::Plan::init ( )
protected

initialize class variables

◆ initialVelocity() [1/2]

Velocity larcfm::Plan::initialVelocity ( int  i) const

estimate the velocity from point i to point i+1 (at point i).

Parameters
iindex of point
Returns
velocity at point i

◆ initialVelocity() [2/2]

Velocity larcfm::Plan::initialVelocity ( int  i,
bool  linear 
) const

calculate the velocity out of point i.

Parameters
iindex of point
linearif true, measure the straight distance, if false measure the curved distance
Returns
velocity out of point i

◆ insert()

void larcfm::Plan::insert ( int  i,
const NavPoint v,
const TcpData d 
)
private

Adds a point at index i. This may not preserve time ordering! This may result in inconsistencies between implied and stored ground and vertical speeds for TCP points.

Parameters
ithe index to place the new point
vthe new NavPoint
dthe new TcpData associated with this NavPoint

◆ insertByDistance() [1/2]

int larcfm::Plan::insertByDistance ( double  d)

Insert a navpoint at the indicated distance from plan start.

Parameters
ddistance (cannot be negative)
Returns
index of new point, or -1 if there is an error.

Insert a navpoint at the indicated distance from plan start.

Parameters
ddistance (can be negative)
Returns
index of new point, or -1 if there is an error.

◆ insertByDistance() [2/2]

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.

Parameters
iindex
ddistance (may be positive or negative)
Returns
index of new point, or -1 if there is an error.

Insert a navpoint at the indicated distance from the given index point. Negative distances are before the given point.

Parameters
ddistance
Returns
index of new point, or -1 if there is an error.

◆ interpolateAltVs()

std::pair< double, double > larcfm::Plan::interpolateAltVs ( int  seg,
double  dt,
bool  linear 
) const

Return interpolated altitude in this segment at absolute time t

Parameters
seggetSegment(t)
ttime of interest
linearlinear flag
Returns

◆ inTrkAccel()

bool larcfm::Plan::inTrkAccel ( int  ix) const

In track acceleration at index ix ?

Parameters
ixpoint index
Returns
Returns true if point ix is in a track acceleration zone

◆ inTrkChange()

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

Parameters
ttime
Returns
true if in track change

◆ inVsAccel()

bool larcfm::Plan::inVsAccel ( int  ix) const

In vertical speed acceleration at index ix ?

Parameters
ixpoint index
Returns
Returns true if point ix is in a vertical speed acceleration zone

◆ inVsChange()

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

Parameters
ttime
Returns
true if in vs change

◆ isAltPreserve()

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()

Parameters
iindex
Returns
true/false

◆ isConsistent() [1/2]

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.

Returns
true if consistent

◆ isConsistent() [2/2]

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.

Parameters
silentuse true to ensure limited console messages
Returns
true if consistent

◆ isFlyable() [1/2]

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.

Returns
True, if the entire plan contains reasonable accelerations.

◆ isFlyable() [2/2]

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.

Parameters
silentUse true to suppress messages to console.
Returns
True, if the entire plan produces reasonable accelerations.

This returns true if the entire plan is "sound"

◆ isGsConsistent()

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.

Parameters
silentuse true to ensure limited console messages
Returns
true if consistent

◆ isGsContinuous()

bool larcfm::Plan::isGsContinuous ( int  i,
double  gsEpsilon,
bool  silent 
) const

Determines if the ground speed component of velocity is continuous at index i

Parameters
iindex i
gsEpsilontolerance of the test
silentif false, info about a discontinuity is printed
Returns
true if ground speed component of velocity is continuous at index i

◆ isLatLon() [1/2]

bool larcfm::Plan::isLatLon ( ) const

Are points specified in Latitude and Longitude

Returns
true if lat/lon

◆ isLatLon() [2/2]

bool larcfm::Plan::isLatLon ( bool  latlon) const

Is the geometry of this Plan the same as the given parameter. Note if this Plan has no points, then it always agrees with the parameter.

Parameters
latlontrue if geometry is expected to be lat/lon
Returns
true if geometry matches given geometry

◆ isLinear()

bool larcfm::Plan::isLinear ( ) const

search plan to see if there are any TCPs

Returns
true if the plan does not contain any TCPs

◆ isOriginal()

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()

Parameters
iindex
Returns
true/false

◆ isTrkContinuous()

bool larcfm::Plan::isTrkContinuous ( int  i,
double  trkEpsilon,
bool  silent 
) const

Determines if the track component of velocity is continuous at index i

Parameters
iindex i
trkEpsilontolerance of the test
silentif false, info about a discontinuity is printed
Returns
true if track component of velocity is continuous at index i

◆ isTurnConsistent() [1/2]

bool larcfm::Plan::isTurnConsistent ( bool  silent) const

Check the Turn consistency of all of the points.

Parameters
silentif true, then do not display anything to the console
Returns
true if turns are consistent

◆ isTurnConsistent() [2/2]

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.

Parameters
pplan
iindex of a point in a turn (typically the BOT)
distH_Epsilonhorizontal epsilon
silentif true, then do not display anything to the console
Returns
true, if the EOT is consistent with the BOT.

◆ isVelocityContinuous() [1/2]

bool larcfm::Plan::isVelocityContinuous ( ) const

Checks if each point in the plan has approximately the same velocity in and velocity out.

Returns
true if velocity continuous

◆ isVelocityContinuous() [2/2]

bool larcfm::Plan::isVelocityContinuous ( bool  silent) const

Checks if each point in the plan has approximately the same velocity in and velocity out.

Parameters
silenttrue if limited console messages
Returns
true if velocity continuous

◆ isVirtual()

bool larcfm::Plan::isVirtual ( int  i) const

Returns true if the point at index i is a virtual point, false otherwise. 0 <= i < size()

Parameters
iindex
Returns
true/false

◆ isVsConsistent()

bool larcfm::Plan::isVsConsistent ( bool  silent) const

Check the Vertical Speed consistency of all of the points.

Parameters
silentif true, then do not display anything to the console
Returns
is vertical speed consistent

◆ isVsContinuous()

bool larcfm::Plan::isVsContinuous ( int  i,
double  velEpsilon,
bool  silent 
) const

Determines if the vertical speed component of velocity is continuous at index i

Parameters
iindex i
velEpsilontolerance of the test
silentif false, info about a discontinuity is printed
Returns
true if vertical speed component of velocity is continuous at index i

◆ isWeakConsistent() [1/2]

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.

Returns
true if weakly consistent

◆ isWeakConsistent() [2/2]

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.

Parameters
silentuse true to ensure limited console messages
Returns
true if weakly consistent

◆ isWeakFlyable() [1/2]

bool larcfm::Plan::isWeakFlyable ( ) const

A weak flyable plan is both weakly consistent and weakly continuous.

Returns
true if flyable

◆ isWeakFlyable() [2/2]

bool larcfm::Plan::isWeakFlyable ( bool  silent) const

A flyable plan is both consistent and continuous.

Parameters
silentUse true to suppress messages to console.
Returns
true if flyable

This returns true if the entire plan is "sound"

◆ isWeakVelocityContinuous()

bool larcfm::Plan::isWeakVelocityContinuous ( bool  silent) const

Checks if each point in the plan has approximately the same velocity in and velocity out.

Parameters
silenttrue if limited console messages
Returns
true if velocity continuous

◆ isWellFormed()

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.

Returns
true if well formed

◆ mergeClosePoints()

int larcfm::Plan::mergeClosePoints ( int  i,
double  minDt 
)

merge together all points closer together in time than "minDt".

Parameters
minDtthe smallest delta time allowed between points. See also wellFormed()

◆ mergeClosePointsByDist()

int larcfm::Plan::mergeClosePointsByDist ( int  j,
double  minDist 
)

merge points j-1 and j if they are closer together (in distance2D) than minDist

Parameters
jindex to be merged
minDistminimum horizontal distance
Returns
index of merged point if merged otherwise return j

Note: it retains position of "j" (i.e. removes j-1)

◆ mkAlt()

void larcfm::Plan::mkAlt ( int  ix,
double  newAlt 
)

Change the altitude at point ix to "newAlt"

Parameters
ixplan index
newAltnew altitude

◆ mkGsConstant()

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

Parameters
wp1starting index
wp2ending index
gsnew ground speed

◆ mkGsIn()

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

Parameters
ixindex
gsnew ground speed
Returns
true if successful

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)

Parameters
ixindex
gsnew ground speed

◆ mkGsOut()

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

Parameters
ixindex
gsnew ground speed
Returns
true if successful

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

Parameters
pPlan of interest
ixindex
gsnew ground speed
Returns
revised plan

◆ nextBGS()

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.

Parameters
currentcurrent index
Returns
index

◆ nextBOT()

int larcfm::Plan::nextBOT ( int  current) const

This returns the index of the next Beginning of Turn (BOT) point that occurs after "current"

Parameters
currentstart search after this index
Returns
index of next BOT, or -1 if there is no next BOT

◆ nextBVS()

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.

Parameters
currentcurrent index
Returns
index

◆ nextEGS()

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.

Parameters
currentstarting index
Returns
index

◆ nextEOT()

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.

Parameters
currentcurrent index
Returns
index

◆ nextEVS()

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.

Parameters
currentcurrent index
Returns
index

◆ nextGsTCP()

int larcfm::Plan::nextGsTCP ( int  current) const

This finds the next Gs TCP

◆ nextPtOrEnd()

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

Parameters
startWpindex
Returns
index

◆ nextTCP()

int larcfm::Plan::nextTCP ( int  current) const

Return the lowest indexed TCP point that is greater than current, or -1 if none

Parameters
currentstart point for search
Returns
greatest tcp index that is greater than current, or -1 if none

◆ nextTrkTCP()

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.

Parameters
currentthe index of the point to begin the search
Returns
index after current which has a TCP type of BOT or EOT

◆ nextVsTCP()

int larcfm::Plan::nextVsTCP ( int  current) const

This finds the last previous index where the TCP is of type tcp1 or tcp2

◆ operator!=()

bool larcfm::Plan::operator!= ( const Plan o) const

Inequality

◆ operator==()

bool larcfm::Plan::operator== ( const Plan o) const

Tests if one plan object has the same contents as another.

◆ partialPathDistance()

double larcfm::Plan::partialPathDistance ( double  t,
bool  linear 
) const

return the path distance from the location at time t until the next point

Parameters
tcurrent time of interest
linearif "linear" then ignore BOTs
Returns
path distance

◆ pathDistance() [1/5]

double larcfm::Plan::pathDistance ( ) const

Find the cumulative horizontal (curved) path distance for whole plan.

Returns
path distance

◆ pathDistance() [2/5]

double larcfm::Plan::pathDistance ( int  i) const

Find the horizontal (curved) distance between points i and i+1 [meters].

Parameters
iindex of starting point
Returns
path distance (horizontal only)

◆ pathDistance() [3/5]

double larcfm::Plan::pathDistance ( int  i,
bool  linear 
) const

Calculate the horizontal distance between points i and i+1 [meters].

Parameters
iindex of starting point
linearif true, measure the straight distance, if false measure the curved distance
Returns
path distance (horizontal only)

◆ pathDistance() [4/5]

double larcfm::Plan::pathDistance ( int  i,
int  j 
) const

Find the cumulative horizontal (curved) path distance between points i and j [meters].

Parameters
ifirst index
jsecond index
Returns
path distance

◆ pathDistance() [5/5]

double larcfm::Plan::pathDistance ( int  i,
int  j,
bool  linear 
) const

Find the cumulative horizontal path distance between points i and j [meters].

Parameters
ibeginning index
jending index
linearif true, then TCP turns are ignored. Otherwise, the length of the circular turns are calculated.
Returns
cumulative path distance (horizontal only)

◆ pathDistanceToPoint()

double larcfm::Plan::pathDistanceToPoint ( double  t,
int  j 
) const

calculate path distance from the current position at time t to point j

Parameters
tcurrent time
jnext point
Returns
path distance

◆ planFromState()

Plan larcfm::Plan::planFromState ( const std::string &  id,
const Position pos,
const Velocity v,
double  startTime,
double  endTime 
)
static

Create a (simple) new Plan by projecting state information.

Parameters
idName of aircraft
posInitial position of aircraft
vInitial velocity of aircraft (if pos in in lat/lon, then this assumes a great circle initial heading)
startTimeTime of initial state
endTimeFinal time when projection ends
Returns
new Plan, with a Fixed starting point. If endTime <= startTime, returns an empty Plan.

◆ point()

const NavPoint larcfm::Plan::point ( int  i) const

Return the NavPoint at the given index (segment number)

Parameters
ithe segment number
Returns
the NavPoint of this index

◆ position() [1/2]

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.

Parameters
ttime
Returns
linear interpolated position at time t

◆ position() [2/2]

Position larcfm::Plan::position ( double  t,
bool  linear 
) const

Return the position at the given time.

Parameters
ttime
linearif true, ignore accelerations
Returns
Interpolated position at time t

◆ positionVelocity()

std::pair< Position, Velocity > larcfm::Plan::positionVelocity ( double  t,
bool  linear 
) const

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.

Parameters
ttime of interest
Returns

◆ posVelWithinSeg()

std::pair< Position, Velocity > larcfm::Plan::posVelWithinSeg ( int  seg,
double  t,
bool  linear,
double  gsAt_d 
) const

Assumes seg = getSegment(t)

Parameters
ttime
linearIf true, then interpret plan in a linear manner
Returns
position and velocity at time t
Parameters
gsAt_dground speed at time t
Returns

◆ posVelWithinSeg2D()

std::pair< Position, Velocity > larcfm::Plan::posVelWithinSeg2D ( int  seg,
double  t,
bool  linear,
double  gsAt_d 
) const

Assumes seg = getSegment(t)

Parameters
ttime of interest
linearIf true, then interpret plan in a linear manner
Returns
position and velocity at time t
Parameters
gsAt_dground speed at time t
Returns

◆ prevBGS()

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.

Parameters
currentthe 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.)
Returns
index before current which has a TCP type of BGS

◆ prevBOT()

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.

Parameters
currentthe 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.)
Returns
index before current which has a TCP type of BOT or EOT

◆ prevBVS()

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.

Parameters
currentthe 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.)
Returns
index before current which has a TCP type of BVS

◆ prevEGS()

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.

Parameters
currentthe 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.)
Returns
index before current which has a TCP type of EGS

◆ prevEOT()

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.

Parameters
currentthe 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.)
Returns
index before current which has a TCP type of EOT

◆ prevEVS()

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.

Parameters
currentthe 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.)
Returns
index before current which has a TCP type of EVS

◆ prevGS()

int larcfm::Plan::prevGS ( int  current) const

Find the last BGS or EGS before "current" point. Will not return "current"

Parameters
currentindex point
Returns
the last BGS or EGS before "current" point. If there is none return -1

◆ prevGsTCP()

int larcfm::Plan::prevGsTCP ( int  current) const

This finds the last previous index where the TCP is a speed change type

◆ prevTCP()

int larcfm::Plan::prevTCP ( int  current) const

Return the highest indexed TCP point that is less than current, or -1 if none

Parameters
currentstart point for search
Returns
greatest tcp index that is less than current, or -1 if none

◆ prevTRK()

int larcfm::Plan::prevTRK ( int  current) const

Find the last BOT or EOT before "current" point. Will not return "current"

Parameters
currentindex point
Returns
the last BOT or EOT before "current" point. If there is none return -1

◆ prevTrkTCP()

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.

Parameters
currentthe index of the point to begin the search
Returns
index before current which has a TCP type of BOT or EOT

◆ prevVS()

int larcfm::Plan::prevVS ( int  current) const

Find the last BVS or EVS before "current" point. Will not return "current"

Parameters
currentindex point
Returns
the last BVS or EVS before "current" point. If there is none return -1

◆ prevVsTCP()

int larcfm::Plan::prevVsTCP ( int  current) const

This finds the last previous index where the TCP is of type tcp1 or tcp2

◆ remove() [1/2]

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.)

Parameters
iindex

◆ remove() [2/2]

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.)

◆ removeAltPreserves()

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.

◆ removeIfRedundant() [1/3]

int larcfm::Plan::removeIfRedundant ( int  ix)

Remove point from plan if it passes trk and gs tests

Parameters
ixindex of interest
Returns
ix if point is removed, -1 otherwise

◆ removeIfRedundant() [2/3]

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

Parameters
ixindex of interest
trkFtrack flag: perform track continuity test
gsFground speed flag: perform ground speed continuity test
vsFvertical speed flag: perform vertical speed continuity test
Returns
ix if point is removed, -1 otherwise

◆ removeIfRedundant() [3/3]

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,

Parameters
ixindex of interest
trkFtrack flag: perform track continuity test
gsFground speed flag: perform ground speed continuity test
vsFvertical speed flag: perform vertical speed continuity test
minTrkminimum track
minGsminimum ground speed
minVsminimum vertical speed
repairtrue if method should repair points
Returns
index if point is removed, -1 otherwise

◆ removeRedundantPoints()

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.

Parameters
fromstarting location
toending location

◆ repairGsConsistency()

void larcfm::Plan::repairGsConsistency ( )

Attempt to fix (gs) acceleration inconsistencies in this plan by adjusting accel values and/or point times.

Returns
new plan with fixed inconsistencies, or null if unfixable. This new plan may have warnings (informational, possibly not concerning) or errors (possibly concerning).

◆ repairGsContinuity()

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

Parameters
pPlan to be fixed
ixBGSindex of BGS
ixEGSindex of EGS
votarget gsOut at ixBGS
vftarget gsIn at ixEGS
maxGsAccelmaximum 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

◆ repairMOT()

void larcfm::Plan::repairMOT ( int  ixBOT)

supply missing MOTs

Parameters
ixBOTindex of a BOT

◆ repairNegGsIn()

void larcfm::Plan::repairNegGsIn ( int  ix)

Repair a negative GsIn value at ix

Parameters
ix

◆ repairNegGsOut()

void larcfm::Plan::repairNegGsOut ( int  ix)

Repair a negative GsOut value at ix

Parameters
ix

◆ repairPlan()

void larcfm::Plan::repairPlan ( )

Clean up mismatched begin or end tcp markers.

◆ revertGsTCP()

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

Parameters
ixindex
Returns
index of reverted BGS

◆ revertGsTCPs()

void larcfm::Plan::revertGsTCPs ( )

Revert all BGS-EGS pairs

◆ revertTurnTCP()

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

Parameters
ixBOTindex of point to be reverted

◆ revertTurnTCPs()

void larcfm::Plan::revertTurnTCPs ( )

Revert all BOT-EOT pairs in range "start" to "end"

◆ revertVsTCP()

int larcfm::Plan::revertVsTCP ( int  ix)

Revert BVS at ix to an instantaneous vertical speed change

Parameters
ixBVSindex of a BVS point
Returns
index of reverted point, -1 if not reverted

◆ revertVsTCPs()

void larcfm::Plan::revertVsTCPs ( )

Revert all BVS-EVS pairs

◆ set()

int larcfm::Plan::set ( int  i,
const NavPoint v,
const TcpData d 
)

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.

Parameters
ithe index of the point to be replaced
vthe new point to replace it with
dthe new TcpData to replace
Returns
the actual index of the new point

◆ setAlt()

void larcfm::Plan::setAlt ( int  i,
double  alt 
)

Set altitude of point "i" to "alt"

Parameters
iindex
altaltitude

◆ setAltPreserve()

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".

Parameters
iindex of point set as "AltPReserve"

◆ setAltVSin()

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)

Parameters
iindex
vsvertical speed
preservepreserve flag

◆ setBOT()

void larcfm::Plan::setBOT ( int  i,
double  signedRadius,
Position  center 
)

makes the point at index i to be a BOT

Parameters
iplan index
signedRadiussigned radius, positive indicates turn right, negative indicated turn left
centercenter of turn

◆ setBVS()

void larcfm::Plan::setBVS ( int  i,
double  acc 
)

makes the point at index i to be a BVS

Parameters
iplan index
accvertical speed acceleration

◆ setEOT()

void larcfm::Plan::setEOT ( int  i)

makes the point at index i to be an EOT

Parameters
iplan index

◆ setEOTBOT()

void larcfm::Plan::setEOTBOT ( int  i,
double  signedRadius,
Position  center 
)

makes the point at index i to be an EOTBOT

Parameters
iplan index
signedRadiussigned radius, positive indicates turn right, negative indicated turn left
centercenter of turn

◆ setGsAccel()

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.

Parameters
iindex of point
accelground speed acceleration to be set

◆ setID()

void larcfm::Plan::setID ( const std::string &  s)

Set the name of this plan (probably the aircraft name).

Parameters
sname

◆ setInfo()

void larcfm::Plan::setInfo ( int  i,
const std::string &  info 
)

Set information field

Parameters
iindex
infovalue

◆ setMinDeltaGen_BackToDefaults()

void larcfm::Plan::setMinDeltaGen_BackToDefaults ( )
static

Restores TrajGen generation parameters back to default values

◆ setNavPoint()

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.

Parameters
ithe index of the point to be replaced
vthe new NavPoint to replace it with
Returns
the actual index of the new point

◆ setNote()

void larcfm::Plan::setNote ( const std::string &  s)

Set the note of this plan (probably the aircraft name).

Parameters
snote

◆ setOriginal()

void larcfm::Plan::setOriginal ( int  i)

Returns true if the point at index i is an original point

Parameters
iplan index

◆ setTcpData()

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.

Parameters
ithe index of the point to be replaced
vthe new TcpData to replace it with
Returns
the actual index of the new point

◆ setTime()

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.

Parameters
ithe index of the point to change
tthe new time

◆ setTimeGsIn()

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

Parameters
iindex
gsground speed

◆ setVertexRadius()

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.

Parameters
iindex of point
radiusvalue 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.

◆ setVirtual()

void larcfm::Plan::setVirtual ( int  i)

makes point a virtual point

Note: virtual points are temporarily added during conflict detection and resolution

Parameters
iplan index

◆ setVsAccel()

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.

Parameters
iindex of point
accelvertical speed acceleration to be set

◆ signedRadius()

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.

Parameters
iindex of point
Returns
the radius, negative means to the left, positive to the right.

◆ size()

int larcfm::Plan::size ( ) const

If size() == 0 then this is a "null" plan.

Returns
size

◆ strWellFormed()

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().

Returns
string representation

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.

◆ time()

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.

Parameters
ithe segment number
Returns
the time at point i

◆ timeFromDistance() [1/3]

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

Parameters
distnon-negative distance from start of plan
Returns
time of point that is "rdist" distance from start of plan

◆ timeFromDistance() [2/3]

double larcfm::Plan::timeFromDistance ( double  vo,
double  gsAccel,
double  dist 
)
static

time required to cover distance "dist" if initial speed is "vo" and acceleration is "gsAccel"

Parameters
voinitial velocity
gsAccelground speed acceleration
distdistance
Returns
time required to cover distance

time required to cover distance "dist" if initial speed is "vo" and acceleration is "gsAccel"

Parameters
gsAccel
vo
dist
Returns

◆ timeFromDistance() [3/3]

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

Parameters
startSegstarting segment
distnon-negative distance from start of segment
Returns
time of point that is "rdist" horizontal distance from start of plan

Return the absolute time that corresponds to the point that is path distance "dist" from startSeg

Parameters
distdistance from start of plan
Returns
time of point that is "rdist" distance from start of plan

◆ timeFromDistanceWithinSeg()

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"

Parameters
segsegment of interest
rdistnon-negative distance from "seg"
Returns
time of point that is "rdist" distance from start of segment "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

◆ timeShiftPlan()

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.

◆ toString()

std::string larcfm::Plan::toString ( ) const

String representation of the entire plan

◆ toStringGs()

std::string larcfm::Plan::toStringGs ( ) const

String representation of the entire plan

Returns
string

◆ toStringPoint()

std::string larcfm::Plan::toStringPoint ( int  i) const
private

Return a string representation that includes NavPoint and TcpData from index i

◆ toStringProfile()

std::string larcfm::Plan::toStringProfile ( ) const

String representation of the entire plan in a tabular form

Returns
a string

◆ toStringTrk()

std::string larcfm::Plan::toStringTrk ( ) const

String representation of the entire plan

Returns
string

◆ toStringVelocity()

std::string larcfm::Plan::toStringVelocity ( int  velField) const

String representation of the entire plan

◆ toStringVs()

std::string larcfm::Plan::toStringVs ( ) const

String representation of the entire plan

Returns
string

◆ toUnitTest()

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

Parameters
prefixcreate variable names using this prefix (prevents duplicate variable defs)
assertsif true, create some assert statements
siif true, create Java code to use SI units
Returns
string

◆ trkFinal()

double larcfm::Plan::trkFinal ( int  seg,
bool  linear 
) const

Calculate track angle at the end of segment "seg"

Parameters
segThe index of the point of interest
linearIf true, then interpret plan in a linear manner
Returns
track angle at the end of segment "seg"

◆ trkInTurn()

double larcfm::Plan::trkInTurn ( int  ix,
int  ixBOT 
) const

return track angle at point ix within a turn starting at ixBOT

Parameters
ixan index between an ixBOT and ixEOT
ixBOTindex of the beginning of turn
Returns
track angle

◆ trkOut()

double larcfm::Plan::trkOut ( int  seg,
bool  linear 
) const

Calculate track angle out of point "seg"

Parameters
segThe index of the point of interest
linearIf linear is true, then interpret plan in a linear manner
Returns
track angle out of point "seg"

◆ turnCenter()

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.

Parameters
iindex of BOT where turn info is stored
Returns
position of center

◆ turnDir()

int larcfm::Plan::turnDir ( int  i) const

turn direction at index i

Parameters
iplan index (of BOT containing turn info)
Returns
+1 if turn right, -1 if turn left

◆ turnRadiusAtTime()

double larcfm::Plan::turnRadiusAtTime ( double  t) const

If time t is in a turn, this returns the radius, otherwise returns a negative value.

Parameters
ttime
Returns
radius

◆ validIndex()

bool larcfm::Plan::validIndex ( int  i) const

Checks if index is in range of the plan

Parameters
iindex to be checked
Returns
true if valid

◆ velocity() [1/2]

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.

Parameters
tmtime
Returns
velocity

Estimate the initial velocity at the given time for this aircraft. A time before the beginning of the plan returns a zero velocity.

◆ velocity() [2/2]

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.

Parameters
tmtime
lineartrue, if linear plan is to be used
Returns
velocity

Estimate the initial velocity at the given time for this aircraft. A time before the beginning of the plan returns a zero velocity.

◆ velocityFromDistance()

Velocity larcfm::Plan::velocityFromDistance ( double  d) const

Return the velocity of the point that is path distance "rdist" from the start of plan

Parameters
dnon-negative distance from start of plan
Returns
velocity of point that is "rdist" distance from start of plan

◆ vertDistance() [1/2]

double larcfm::Plan::vertDistance ( int  i) const

calculates vertical distance from point i to point i+1

Parameters
ipoint of interest
Returns
vertical distance

◆ vertDistance() [2/2]

double larcfm::Plan::vertDistance ( int  i,
int  j 
) const

Find the cumulative vertical distance between points i and j [meters].

Parameters
ifirst point
jsecond point
Returns
vertical distance

Find the cumulative horizontal (curved) path distance between points i and j [meters].

◆ vertexFromTurnTcps() [1/3]

Position larcfm::Plan::vertexFromTurnTcps ( const Position botPos,
const Position eotPos,
double  radius,
int  dir,
const Position center,
double  altMid 
)
static

Calculate the vertex point from which a turn was generated using botPos, eotPos, radius, center , etc

Parameters
botPosposition of turn beginning
eotPosposition of end of turn
radiusradius of turn
dirdirection +1 = right, -1 = left
centercenter position
altMidaltitude at middle of turn
Returns
vertex of turn
Parameters
botPosposition of turn beginning
eotPosposition of end of turn
radiusradius of turn
dirdirection +1 = right, -1 = left
centercenter position
altMidaltitude at middle of turn
Returns
vertex of turn

◆ vertexFromTurnTcps() [2/3]

Position larcfm::Plan::vertexFromTurnTcps ( const Position botPos,
const Position eotPos,
double  signedRadius,
double  trkInit,
double  altMid 
)
static
Parameters
botPosposition of turn beginning
eotPosposition of end of turn
signedRadiussigned radius of turn: +1 = right, -1 = left
trkInitinitial track at botPos
altMidaltitude at middle of turn
Returns
vertex of turn

◆ vertexFromTurnTcps() [3/3]

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.

Parameters
ixBOTindex of Beginning of Turn (BOT)
ixEOTindex of End of Turn (BOT)
altMidaltitude at middle point of turn
Returns
vertex of the turn

◆ vertexPointTurnTcps()

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

Parameters
ixBOTindex of BOT
ixEOTindex of EOT
altMidaltitude to assign to vertex
Returns
point

◆ vertexRadius()

double larcfm::Plan::vertexRadius ( int  i) const

An unsigned radius value that is stored at a vertex. See method setVertexRadius.

Parameters
ivertex index
Returns
specified radius; a return value of 0 indicates no specified radius

◆ verticalSpeed()

double larcfm::Plan::verticalSpeed ( int  i) const

Calculate vertical speed from point i to point i+1 (at point i).

Parameters
iindex of the point
Returns
vertical speed

◆ vsAccelAtTime()

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.

Parameters
ttime
Returns
vs accel

◆ vsAtTime() [1/2]

double larcfm::Plan::vsAtTime ( double  t,
bool  linear 
) const

vertical speed at time t

Parameters
ttime of interest
linearIf true, then interpret plan in a linear manner
Returns
vertical speed

◆ vsAtTime() [2/2]

double larcfm::Plan::vsAtTime ( int  seg,
double  vsAtSeg,
double  t,
bool  linear 
) const

vertical speed at time t (which must be in segment "seg")

Parameters
segsegment where time "t" is located
vsAtSegvertical speed out of segment "seg"
ttime of interest
linearIf true, then interpret plan in a linear manner
Returns
vertical speed

◆ vsFinal()

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

Parameters
iThe index of the point of interest
linearIf true, then interpret plan in a linear manner
Returns
vertical speed at the end of segment "i"

◆ vsIn() [1/2]

double larcfm::Plan::vsIn ( int  seg) const
Parameters
segThe index of the point of interest
Returns
vertical speed into point "seg"

◆ vsIn() [2/2]

double larcfm::Plan::vsIn ( int  seg,
bool  linear 
) const

vertical speed into point "seg"

Parameters
segThe index of the point of interest
linearIf true, then interpret plan in a linear manner
Returns
vertical speed into point "seg"

◆ vsOut() [1/2]

double larcfm::Plan::vsOut ( int  i,
bool  linear 
) const

vertical speed out of point "i"

Parameters
iThe index of the point of interest
linearIf true, then interpret plan in a linear manner
Returns
vertical speed at the beginning of segment "i"

◆ vsOut() [2/2]

double larcfm::Plan::vsOut ( int  seg) const
Parameters
segThe index of the point of interest
Returns
vertical speed out of point "seg"

Member Data Documentation

◆ invalid_value

TcpData larcfm::Plan::invalid_value = TcpData::makeInvalid()
staticprivate

Do not rely on this like an invalid value in Vect3::INVALID


The documentation for this class was generated from the following files: