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

#include <Route.h>

Public Member Functions

 Route (const Route &gsp)
 
 Route (const Plan &lpc, int start, int end)
 
 Route (const Plan &lpc)
 
int size () const
 
Position position (int i) const
 
Position positionFromDistance (double dist, bool linear) const
 
Position positionFromDistance (int i, double dist, bool linear) const
 
std::string name (int i) const
 
std::string info (int i) const
 
double radius (int i) const
 
void add (const Position &pos, const std::string &label, const std::string &data)
 
void add (const Position &pos, const std::string &label, const std::string &data, double rad)
 
void add (int ix, const Position &pos, const std::string &label, const std::string &data, double rad)
 
void add (const Route &p, int ix)
 
void addAll (const Route &p)
 
void set (int ix, const Position &pos, const std::string &label, const std::string &data, double)
 
void remove (int i)
 
void removeFirst ()
 
void removeLast ()
 
Route append (const Route &p2)
 
void updateWithDefaultRadius (double default_radius)
 
int findName (const std::string &nm, int startIx) const
 
int findName (const std::string &nm) const
 
void setName (int i, const std::string &name)
 
int findInfo (const std::string &nm, int startIx) const
 
int findInfo (const std::string &nm) const
 
void setInfo (int i, const std::string &data)
 
void setPosition (int i, const Position &pos)
 
void setRadius (int i, double rad)
 
Route copy () const
 
double pathDistance (int i, int j, bool linear) const
 
double pathDistance (bool linear) const
 
double pathDistance () const
 
Position positionFromDistance (double dist, double gs, double defaultBank, bool linear) const
 
Velocity velocityFromDistance (double dist, double gs, double defaultBank, bool linear) const
 
Plan linearPlan (double startTime, double gs) const
 
bool equals (const Route &fp) const
 
std::string toString () const
 
std::string toString (double startTime, double gs) const
 

Static Public Member Functions

static Route mkRoute (const Plan &fp, int start, int end, double radius)
 
static Route mkRouteNamedOnly (const Plan &fp)
 
static Route mkRoute (const Plan &fp, double radius)
 
static Route mkRouteBankAngle (const Plan &fp, double bankAngle)
 
static Route mkRouteCut (const Route &fp, int start, int end)
 

Static Public Attributes

static const std::string virtualName = "$virtual"
 

Private Attributes

std::vector< std::string > names
 
std::vector< std::string > infos
 
std::vector< Positionpositions
 
std::vector< double > radius_v
 

Detailed Description

A class (and tools) for creating a Route, that is, a sequence of 3D positions. Routes can be converted into Plans and vice versa.

Constructor & Destructor Documentation

◆ Route() [1/2]

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

Creates a route from a linear plan, all points have radius 0.0

Parameters
lpclinear plan
startstarting index
endending index

◆ Route() [2/2]

larcfm::Route::Route ( const Plan lpc)

Create a route from a linear plan, all points have radius 0.0

Parameters
lpclinear plan

Member Function Documentation

◆ add() [1/3]

void larcfm::Route::add ( const Position pos,
const std::string &  label,
const std::string &  data 
)

Add a position

Parameters
posposition
labellabel for point – if this equals Route.virtualName, then this will become a virtual point when make into a linear plan
datadata field for a point

◆ add() [2/3]

void larcfm::Route::add ( const Position pos,
const std::string &  label,
const std::string &  data,
double  rad 
)
Parameters
posposition
labellabel for point – if this equals Route.virtualName, then this will become a virtual point when make into a linear plan

◆ add() [3/3]

void larcfm::Route::add ( int  ix,
const Position pos,
const std::string &  label,
const std::string &  data,
double  rad 
)

Add a position

Parameters
ixindex
posposition
labellabel for point – if this equals Route.virtualName, then this will become a virtual point when make into a linear plan
datadata field for a point
radradius

◆ equals()

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

test equality of GsPlans

Parameters
fpanother route
Returns
true, if equal

◆ findName() [1/2]

int larcfm::Route::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
nmString to match
Returns
index of matching label

◆ findName() [2/2]

int larcfm::Route::findName ( const std::string &  nm,
int  startIx 
) const

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

Parameters
nmString to match
startIxindex to begin searching
Returns
index of matching label

◆ linearPlan()

Plan larcfm::Route::linearPlan ( double  startTime,
double  gs 
) const

Create a linear plan from this route using a constant ground speed "gs". It will copy the radius information into the plan.

Parameters
startTimeThe time that will be assigned to point 0
gsground speed to use
Returns
linear plan with a constant ground speed

◆ mkRoute() [1/2]

Route larcfm::Route::mkRoute ( const Plan fp,
double  radius 
)
static

Create a route from a linear plan and make all radii have the value "radius"

Parameters
fpsource plan
radiusradius to be used at every vertex (for path distance calculations)
Returns
new route

◆ mkRoute() [2/2]

Route larcfm::Route::mkRoute ( const Plan fp,
int  start,
int  end,
double  radius 
)
static

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

Parameters
fplinear plan
startstarting index
endending index
radiusthis radius value is inserted at all vertex points (used in path distance calculations)
Returns
route generated from linear plan

◆ mkRouteBankAngle()

Route larcfm::Route::mkRouteBankAngle ( const Plan fp,
double  bankAngle 
)
static

Create a route from a linear plan and calculate radii using "bankAngle" NOTE: If a radius is already stored in the source plan, this will not overwrite it

Parameters
fpsource plan
bankAnglebank angle used to calculate radii values (used in path distance calculations)
Returns
Route generated from a linear plan fp, radii added to vertexs

◆ mkRouteCut()

Route larcfm::Route::mkRouteCut ( const Route fp,
int  start,
int  end 
)
static

Create a route which is a subset of the given route (from the starting index, to the ending index)

Parameters
fpsource route
startstarting index
endending index
Returns
new route

◆ mkRouteNamedOnly()

Route larcfm::Route::mkRouteNamedOnly ( const Plan fp)
static

Create a route from a plan fp using only the named points. All other points are discarded

Parameters
fpsource plan
Returns
route constructed from named points in plan "fp"

◆ pathDistance()

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

Find the path distance between the given starting and ending indexes

Parameters
istarting index
jending index
linearif true, use linear distance
Returns
distance from i to j; returns -1 if the Route is ill-formed

Note: the distance is from MOT to MOT if linear = false and indices are vertices

◆ positionFromDistance()

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

Position along the route

Parameters
distdistance to query
gsground speed (must be greater than zero, but otherwise only used for turn generation)
defaultBankdefault bank angle for turns (overridden by radius info)
lineartrue to remain linear, false to generate turns.
Returns
Position at distance (does not incorporate vertical or ground speed accelerations)

◆ velocityFromDistance()

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

Velocity along the route (primarily track)

Parameters
distdistance to query
gsground speed (must be greater than zero, but otherwise only used for turn generation)
defaultBankdefault bank angle for turns (overridden by radius info)
lineartrue to remain linear, false to generate turns.
Returns
Velocity at distance (does not incorporate vertical or ground speed accelerations)

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