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

#include <TcpData.h>

Public Types

enum  WayType { Orig , Virtual , AltPreserve , UNKNOWN_WT }
 
enum  TrkTcpType {
  NONE , BOT , EOT , EOTBOT ,
  MOT , UNKNOWN_TRK
}
 
enum  GsTcpType {
  NONEg , BGS , EGS , EGSBGS ,
  UNKNOWN_GS
}
 
enum  VsTcpType {
  NONEv , BVS , EVS , EVSBVS ,
  UNKNOWN_VS
}
 

Public Member Functions

 TcpData (const TcpData &data)
 
std::string getTypeString () const
 
bool isVirtual () const
 
bool isOriginal () const
 
bool isAltPreserve () const
 
void setType (const std::string &t)
 
TcpData copy () const
 
TcpData setVirtual ()
 
TcpData setOriginal ()
 
TcpData setAltPreserve ()
 
void reset ()
 
std::string getTrkTypeString () const
 
std::string getGsTypeString () const
 
std::string getVsTypeString () const
 
double getRadiusSigned () const
 
int turnDir () const
 
TcpData setRadiusSigned (double r)
 
Position turnCenter () const
 
TcpData setTurnCenter (const Position &center)
 
double getGsAccel () const
 
TcpData setGsAccel (double ga)
 
double getVsAccel () const
 
TcpData setVsAccel (double va)
 
TcpData setVelocityInit (const Velocity &v)
 
std::string getInformation () const
 
void setInformation (const std::string &info)
 
void appendInformation (const std::string &info)
 
void appendInformationNoDuplication (const std::string &info)
 
TcpData setBOT (double signedRadius, const Position &center)
 
void clearTrk ()
 
TcpData clearBOT ()
 
TcpData clearEOT ()
 
TcpData clearBGS ()
 
TcpData clearEGS ()
 
TcpData clearBVS ()
 
TcpData clearEVS ()
 
TcpData setEOT ()
 
TcpData addBOT (double signedRadius, Position center)
 
TcpData addEOT ()
 
TcpData setEOTBOT (double signedRadius, const Position &center)
 
TcpData setMOT (bool b)
 
TcpData setBGS (double a)
 
TcpData addEGS ()
 
void clearGs ()
 
TcpData setEGS ()
 
TcpData setEGSBGS (double a)
 
TcpData setBVS (double a)
 
void clearVs ()
 
TcpData setEVS ()
 
TcpData addEVS ()
 
TcpData setEVSBVS (double a)
 
bool isInvalid () const
 
bool isTCP () const
 
bool isTrkTCP () const
 
bool isBOT () const
 
bool isEOT () const
 
bool isMOT () const
 
bool isGsTCP () const
 
bool isEGSBGS () const
 
bool isBGS () const
 
bool isEGS () const
 
bool isEVSBVS () const
 
bool isVsTCP () const
 
bool isBVS () const
 
bool isEVS () const
 
bool isBeginTCP () const
 
bool isEndTCP () const
 
bool isDefined () const
 
bool mergeable (const TcpData &point) const
 
TcpData mergeTCPData (const TcpData &point) const
 
std::pair< TcpData, std::string > parseMetaDataLabel (const std::string &tlabel)
 
std::string tcpTypeString () const
 
std::string metaDataLabel (int precision) const
 
std::string toString () const
 
std::string toStringTcpType () const
 

Static Public Member Functions

static std::string toStringWayType (WayType t)
 
static TcpData::WayType valueOfWayType (const std::string &t)
 
static std::string toStringTrkType (TrkTcpType t)
 
static TcpData::TrkTcpType valueOfTrkType (const std::string &t)
 
static std::string toStringGsType (GsTcpType t)
 
static TcpData::GsTcpType valueOfGsType (const std::string &t)
 
static std::string toStringVsType (VsTcpType t)
 
static TcpData::VsTcpType valueOfVsType (const std::string &t)
 
static TcpData makeFull (const std::string &ty, const std::string &tcp_trk, const std::string &tcp_gs, const std::string &tcp_vs, double radiusSigned, const Position &center, double accel_gs, double accel_vs)
 
static TcpData makeInvalid ()
 
static TcpData makeOrig ()
 
static std::string fullName (const NavPoint &p, const TcpData &d)
 
static std::pair< NavPoint, TcpDataparseLL (const std::string &s)
 
static std::pair< NavPoint, TcpDataparseXYZ (const std::string &s)
 
static TcpData::TrkTcpType toTrkTCP (int ty)
 
static TcpData::GsTcpType toGsTCP (int ty)
 
static TcpData::VsTcpType toVsTCP (int ty)
 

Static Public Attributes

static const int TCP_OUTPUT_COLUMNS = 20
 
static const int MIN_OUTPUT_COLUMNS = 5
 
static bool motFlagInInfo = false
 
static std::string MOTflag = ".<MOT>."
 

Private Attributes

WayType ty
 
TrkTcpType tcpTrk
 
GsTcpType tcpGs
 
VsTcpType tcpVs
 
double radiusSigned
 
Position centerTurn
 
double accelGs
 
double accelVs
 
std::string information
 

Detailed Description

A data structure to maintain certain information related to a trajectory change point (TCP). Typically, this information is associated with a NavPoint through a Plan. The major purpose of this class is to store the relevant TCP information (e.g., status information, acceleration values, etc.).

Possible types of points.

Each point can be a turn point (essentially a horizontal acceleration point), a ground speed acceleration point, or a vertical speed acceleration point. These points are indicated by either being the beginning of an acceleration zone or the end of an acceleration zone. Thus, there are methods to indicate the beginning of a turn (isBOT), or the end of the a turn (isEOT), similarly for ground speed of vertical speed.

Member Enumeration Documentation

◆ TrkTcpType

UNKNOWN values should ONLY be used when parsing a string representation fails

◆ WayType

Major types of NavPoints, UNKNOWN_WT only used when parsing a string representation

Member Function Documentation

◆ addBOT()

TcpData larcfm::TcpData::addBOT ( double  signedRadius,
Position  center 
)

Set this point as a "beginning of turn" point.

Parameters
signedRadiusright turns have a positive radius, left turns have a negative radius
centercenter of turn
Returns
a reference to the current TcpData object

◆ addEGS()

TcpData larcfm::TcpData::addEGS ( )

Set this point as an "end ground speed" point, either a EGS or an EGSBGS

Returns
a reference to the current TcpData object

◆ addEOT()

TcpData larcfm::TcpData::addEOT ( )

Set this point as an "end of turn" point, either an EOTBOT or an EOT

Returns
a reference to the current TcpData object

◆ addEVS()

TcpData larcfm::TcpData::addEVS ( )

Set this point as an "end vertical speed" point, either a EVS or an EVSBVS

Returns
a reference to the current TcpData object

◆ copy()

TcpData larcfm::TcpData::copy ( ) const

Make a new TcpData from the current

Returns
a new TcpData object

◆ fullName()

std::string larcfm::TcpData::fullName ( const NavPoint p,
const TcpData d 
)
static

Return a string including both the point name (if set) and any tcp metadata represented as a string. If neither exists, return the empty string.

Parameters
passociated NavPoint
dTcpData object
Returns
the full label

◆ getRadiusSigned()

double larcfm::TcpData::getRadiusSigned ( ) const

Get signed radius. Note: a return value of 0 indicates no specified radius

Returns
radius

◆ isBeginTCP()

bool larcfm::TcpData::isBeginTCP ( ) const

true if this point is one of the beginning TCP points, including the combined points (e.g., EOTBOT)

Returns
beginning TCP point status

◆ isBGS()

bool larcfm::TcpData::isBGS ( ) const

true if this point is a beginning of ground speed change point

Returns
BGS status

◆ isBOT()

bool larcfm::TcpData::isBOT ( ) const

true if this point is the start of a turn

Returns
BOT status

◆ isBVS()

bool larcfm::TcpData::isBVS ( ) const

true if this point is the start of a vs change

Returns
BVS status

◆ isDefined()

bool larcfm::TcpData::isDefined ( ) const

Return true if, for the given type, this TcpData has values for the necessary fields

Returns
true, if acceleration fields are defined

◆ isEGS()

bool larcfm::TcpData::isEGS ( ) const

true if this point is a end of ground speed change point

Returns
EGS status

◆ isEGSBGS()

bool larcfm::TcpData::isEGSBGS ( ) const

true if this point is a beginning of ground speed change point

Returns
BGS status

◆ isEndTCP()

bool larcfm::TcpData::isEndTCP ( ) const

true if this point is one of the ending TCP points, including the combined points (e.g., EOTBOT)

Returns
ending TCP point status

◆ isEOT()

bool larcfm::TcpData::isEOT ( ) const

true if this point is the end of a turn

Returns
EOT status

◆ isEVS()

bool larcfm::TcpData::isEVS ( ) const

true if this point is the end of a vs change

Returns
EVS status

◆ isEVSBVS()

bool larcfm::TcpData::isEVSBVS ( ) const

true if this point is the start of a vs change

Returns
BVS status

◆ isGsTCP()

bool larcfm::TcpData::isGsTCP ( ) const

true if this point is a ground speed point

Returns
groundspeed tcp status

◆ isTCP()

bool larcfm::TcpData::isTCP ( ) const

true if this point is a TCP

Returns
tcp status

◆ isTrkTCP()

bool larcfm::TcpData::isTrkTCP ( ) const

true if this point is part of a turn

Returns
track tcp status

◆ isVsTCP()

bool larcfm::TcpData::isVsTCP ( ) const

true if this point is part of a vs change

Returns
vertical speed tcp status

◆ makeOrig()

TcpData larcfm::TcpData::makeOrig ( )
static

Make a new TcpData object with default parameters. This is essentially a factory method for the no parameter constructor. Sometimes it is convenient to have a constructor.

Returns
a new TcpData object with default parameters.

◆ mergeable()

bool larcfm::TcpData::mergeable ( const TcpData point) const

Can this point be merged with the given point p?

Parameters
pointthe other point
Returns
true, if the points can be merged.

Can this point be merged with the given point p? Merged points only apply to TCP points.

Parameters
pointthe other point
Returns
true, if the points can be merged.

◆ mergeTCPData()

TcpData larcfm::TcpData::mergeTCPData ( const TcpData point) const

Creates a new point that is the merger of the this point and the given point. Assumes that mergeable() on the two points would return true, if not, then approximately the original point is returned.

Merging rules:

  • mergeTCPInfo() is commutative
  • If both points are linear points, then the points are merged.
  • If one point is a linear point (aka, not a TCP), then the TCP info (velocity and acceleration) from the TCP point is used.
  • If both points are TCP (aka acceleration points) of different types (Trk, Gs, Vs), then the points should merge without an issue
  • If both points are TCP (aka acceleration points) of the same type (Trk, Gs, or Vs), but one is a beginning point and one is an ending point, then the resulting point should be a combined point (e.g., EOTBOT), and the TCP information should be the information from the beginning point.
  • If both points are TCP "begin" points, then a message is provided if they have different source positions
Parameters
pointthe other point
Returns
a new point that is the merger of the two points.

Creates a new point that is the merger of the this point and the given point. Assumes that mergeable() on the two points would return true, if not, then approximately the original point is returned.

Merging rules:

  • mergeTCPInfo() is commutative
  • If both points are linear points, then the points are merged.
  • If one point is a linear point (aka, not a TCP), then the TCP info (velocity and acceleration) from the TCP point is used.
  • If both points are TCP (aka acceleration points) of different types (Trk, Gs, Vs), then the points should merge without an issue, note: they are required to have the same "velocity in"
  • If both points are TCP (aka acceleration points) of the same type (Trk, Gs, or Vs), then the resulting point should be a combined point (e.g., EOTBOT), and the TCP information should be the information from the beginning point.
  • If both points are TCP "begin" points, then a message is provided if they have different source positions
Parameters
pointthe other point
Returns
a new point that is the merger of the two points.

◆ metaDataLabel()

std::string larcfm::TcpData::metaDataLabel ( int  precision) const

Return a string representation of TCP meta data (or the empty string if none)

Parameters
ttime of the associated NavPoint
precisionnumber of digits of precision
Returns
a string

◆ parseMetaDataLabel()

std::pair< TcpData, std::string > larcfm::TcpData::parseMetaDataLabel ( const std::string &  tlabel)

This parses the label generated for TCP types to reconstruct the meta-data of the point.
It returns either the same point (if no significant data is in the label) or a fully reconstructed TCP type. The reconstructed TCP will have a label field that does not contain any TCP metadata – you will need to call name() or tcpLabel() to retrieve the full string. If it is detected that this string uses the old metatdata format, this returns an invalid NavPoint::

◆ reset()

void larcfm::TcpData::reset ( )

Reset the TcpData into a blank configuration, except for the source position, source time, and linear index, these are retained.

◆ setAltPreserve()

TcpData larcfm::TcpData::setAltPreserve ( )

Set this object to "AltPreserve"

Returns
this TcpData object (for a.setX() type operations)

◆ setBGS()

TcpData larcfm::TcpData::setBGS ( double  a)

Set this point as a "beginning of ground speed change" point

Parameters
aacceleration
Returns
this TcpData object (for a.setX() type operations)

◆ setBOT()

TcpData larcfm::TcpData::setBOT ( double  signedRadius,
const Position center 
)

Set this point as a "beginning of turn" point.

Parameters
signedRadiusright turns have a positive radius, left turns have a negative radius
centercenter of turn
Returns
a reference to the current TcpData object

◆ setBVS()

TcpData larcfm::TcpData::setBVS ( double  a)

Set this point as a "beginning of vertical speed change" point

Parameters
aacceleration
Returns
this TcpData object (for a.setX() type operations)

◆ setEGS()

TcpData larcfm::TcpData::setEGS ( )

Set this point as a "ending of ground speed change" point

Returns
this TcpData object (for a.setX() type operations)

◆ setEGSBGS()

TcpData larcfm::TcpData::setEGSBGS ( double  a)

Set this point as a combined "end of ground speed change and beginning of ground speed change" point

Parameters
aacceleration
Returns
this TcpData object (for a.setX() type operations)

◆ setEOT()

TcpData larcfm::TcpData::setEOT ( )

Set this point as a "end of turn" point.

Returns
this TcpData object (for a.setX() type operations)

◆ setEOTBOT()

TcpData larcfm::TcpData::setEOTBOT ( double  signedRadius,
const Position center 
)

Set this point as a combined "end of turn and beginning of turn" point.

Parameters
signedRadiusradius
centerthe center of turn
Returns
this TcpData object (for a.setX() type operations)

◆ setEVS()

TcpData larcfm::TcpData::setEVS ( )

Set this point as an "ending of vertical speed change" point

Returns
this TcpData object (for a.setX() type operations)

◆ setEVSBVS()

TcpData larcfm::TcpData::setEVSBVS ( double  a)

Set this point as a combined "ending of vertical speed change and beginning of vertical speed change" point

Parameters
aacceleration
Returns
this TcpData object (for a.setX() type operations)

◆ setOriginal()

TcpData larcfm::TcpData::setOriginal ( )

Set this object to "Original"

Returns
this TcpData object (for a.setX() type operations)

◆ setVelocityInit()

TcpData larcfm::TcpData::setVelocityInit ( const Velocity v)

Set the initial velocity for this TcpData data object to the given value. This must be the correct value for points defining the entry into acceleration zones (BOT, BGSC, BVSC).

◆ setVirtual()

TcpData larcfm::TcpData::setVirtual ( )

Set this object to "Virtual"

Returns
this TcpData object (for a.setX() type operations)

◆ setVsAccel()

TcpData larcfm::TcpData::setVsAccel ( double  va)

Set the vertical acceleration rate to the given value

Parameters
vavertical acceleration
Returns
this TcpData object (for a.setX() type operations)

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