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

#include <GsPlan.h>

Public Member Functions

 GsPlan (double startTime)
 
 GsPlan (const std::string &s)
 
 GsPlan (const Plan &lpc, int start, int end)
 
 GsPlan (const Plan &lpc)
 
 GsPlan (const GsPlan &gsp)
 
 GsPlan (const Route &r, const std::string &name, double start, double gsAll)
 
int size () const
 
std::string getID () const
 
void setID (const std::string &s)
 
void setInfo (int i, const std::string &s)
 
double gs (int i) const
 
Route route () const
 
void add (const Position &pos, const std::string &label, const std::string &info, double gsOut, double rad)
 
void add (const Position &pos, const std::string &label, const std::string &info, double gsOut)
 
void add (const Position &pos, const std::string &label, const std::string &info)
 
void add (const GsPlan &p, int ix)
 
void addAll (const GsPlan &p)
 
void set (int ix, const Position &pos, const std::string &label, const std::string &info, double gsOut, double radius)
 
Position position (int i) const
 
Position last () const
 
std::string name (int i) const
 
std::string info (int i) const
 
double radius (int i) const
 
void setRadius (int i, double rad)
 
std::vector< double > getGsInits () const
 
GsPlan append (const GsPlan &p2)
 
void remove (int i)
 
void setGs (int i, double gsin)
 
double startTime () const
 
void setStartTime (double startTime)
 
int findName (const std::string &nm) const
 
double pathDistance (int i, int j, bool linear) const
 
double ETA (bool linear) const
 
Plan linearPlan () const
 
int closestSegment (const Position &pos) const
 
Position positionFromDistance (double dist, double defaultBank, bool linear) const
 
Velocity velocityFromDistance (double dist, double defaultBank, bool linear) const
 
bool equals (const GsPlan &fp) const
 
bool almostEquals (const GsPlan &p) const
 
std::string toString () const
 

Static Public Member Functions

static GsPlan makeGsPlanConstant (const GsPlan &gsp, double gsNew)
 
static GsPlan mkGsPlanBankAngle (const Plan &lpc, double bankAngle)
 

Private Attributes

Route rt
 
std::vector< double > gsOuts
 
std::string id
 
double starttime
 

Detailed Description

GsPlan – an alternate yet convenient way to store a linear plan. There are no times stored. Instead the ground speed at each point is specified.

Since there are no times in a GsPlan, only the order of the points is maintained. This often eliminates the need to continually recalculate times. After an appropriate GsPlan is constructed it can be converted to a linear plan using the "linearPlan" method

Constructor & Destructor Documentation

◆ GsPlan() [1/3]

larcfm::GsPlan::GsPlan ( const Plan lpc,
int  start,
int  end 
)

Converts a section of a linear plan into a GsPlan. The ground speeds correspond to the speeds in the "lcp" linear plan. However, no route radii values are set using this constructor

Parameters
lpclinear plan
startstarting index of the section to be used
endending index of the section to be used

◆ GsPlan() [2/3]

larcfm::GsPlan::GsPlan ( const Plan lpc)

Converts a full linear plan into a GsPlan. The ground speeds correspond to the speeds in the "lcp" linear plan. However, no route radii values are set using this constructor.

Parameters
lpclinear plan

◆ GsPlan() [3/3]

larcfm::GsPlan::GsPlan ( const GsPlan gsp)

Creates a copy of a GsPlan

Parameters
gspground speed plan

Member Function Documentation

◆ add() [1/3]

void larcfm::GsPlan::add ( const GsPlan p,
int  ix 
)

add point "ix" from GsPlan "p"

Parameters
pground speed plan
ixindex

◆ add() [2/3]

void larcfm::GsPlan::add ( const Position pos,
const std::string &  label,
const std::string &  info 
)

This method is primarily added to prevent accidental use of lower level Route method

It makes the ground speed the same as the last one, if there is a previous point, otherwise -1.0

Parameters
posposition
labellabel for this point
infoinfo string for this point

◆ add() [3/3]

void larcfm::GsPlan::add ( const Position pos,
const std::string &  label,
const std::string &  info,
double  gsOut 
)

Add a position

Parameters
posposition
labellabel for point – if this equals GsPlan.virtualName, then this will become a virtual point when make into a linear plan
infoinformation for a point
gsOutground speed out

◆ addAll()

void larcfm::GsPlan::addAll ( const GsPlan p)

Add all of the points of GsPlan "p" to this plan

Parameters
pground speed plan

◆ append()

GsPlan larcfm::GsPlan::append ( const GsPlan p2)

Create a new GsPlan that is a copy of this one, then add all the elements from p2 to this new GsPlan

Parameters
p2point
Returns
groundspeed

◆ closestSegment()

int larcfm::GsPlan::closestSegment ( const Position pos) const

Return the segment containing the point closest to the given position.

Parameters
posposition
Returns
segment number

◆ equals()

bool larcfm::GsPlan::equals ( const GsPlan fp) const

test equality of GsPlans

◆ ETA()

double larcfm::GsPlan::ETA ( bool  linear) const

Calculate ETA for this GsPlan

Parameters
linearfalse to include kinematic plans
Returns
estimated final time for this plan

◆ findName()

int larcfm::GsPlan::findName ( const std::string &  nm) const

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

Parameters
nmname
Returns
index of name

◆ gs()

double larcfm::GsPlan::gs ( int  i) const

Get groundspeed

Parameters
iindex
Returns
ground speed

◆ linearPlan()

Plan larcfm::GsPlan::linearPlan ( ) const

Make linear plan from GsPlan. Note: in order to not generate invalid Plans, this ensures each segment has a positive groundspeed (currently ≥ 0.001 m/s)

Returns
plan

◆ makeGsPlanConstant()

GsPlan larcfm::GsPlan::makeGsPlanConstant ( const GsPlan gsp,
double  gsNew 
)
static

Create a new GsPlan from "gsp" with every segment given a ground speed of "gsNew"

Parameters
gspThe source GsPlan
gsNewthe ground speed used on every segment
Returns
a new GsPlan

◆ mkGsPlanBankAngle()

GsPlan larcfm::GsPlan::mkGsPlanBankAngle ( const Plan lpc,
double  bankAngle 
)
static

Create a route from a linear plan and calculate radii using "bankAngle"

Parameters
lpclinear plan
bankAnglebank angle used for turn generation
Returns
a new GsPlan

◆ positionFromDistance()

Position larcfm::GsPlan::positionFromDistance ( double  dist,
double  defaultBank,
bool  linear 
) const

Position at distance

Parameters
distdistance to query
defaultBankdefault bank angle for turns (overridden by radius)
linearflag to generate turns
Returns
position at horizontal distance (does not incorporate vertical or ground speed accelerations)

◆ route()

Route larcfm::GsPlan::route ( ) const

Provide a copy of the route in this GsPlan

Returns
route

◆ set()

void larcfm::GsPlan::set ( int  ix,
const Position pos,
const std::string &  label,
const std::string &  info,
double  gsOut,
double  radius 
)

Sets a point

Parameters
ixindex of the point
posposition
labellabel for point – if this equals GsPlan.virtualName, then this will become a virtual point when make into a linear plan
infoinformation for a point
gsOutground speed out of "ix"

◆ setID()

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

set aircraft id

Parameters
sstring name

◆ setRadius()

void larcfm::GsPlan::setRadius ( int  i,
double  rad 
)

Set the radius at point "i" to be "rad"

Parameters
iindex
radradius to be stored

◆ velocityFromDistance()

Velocity larcfm::GsPlan::velocityFromDistance ( double  dist,
double  defaultBank,
bool  linear 
) const

Velocity at distance

Parameters
distdistance to query
defaultBankdefault bank angle for turns (overridden by radius)
linearflse to generate turns
Returns
velocity at horizontal distance (does not incorporate vertical or ground speed accelerations)

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