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

#include <IntentBands.h>

Inheritance diagram for larcfm::IntentBands:
larcfm::GenericIntentBands larcfm::ErrorReporter larcfm::GenericBands

Public Member Functions

 IntentBands (double D, const std::string &dunit, double H, const std::string &hunit, double B, double T, const std::string &tunit, double max_gs, const std::string &gsunit, double max_vs, const std::string &vsunit)
 
 IntentBands ()
 
void setLookaheadTime (double t, const std::string &unit)
 
void setTimeRange (double b, double t, const std::string &tunit)
 
double getLookaheadTime (const std::string &unit) const
 
double getStartTime (const std::string &unit) const
 
bool isLatLon () const
 
void setDiameter (double d, const std::string &unit)
 
double getDiameter (const std::string &unit) const
 
void setHeight (double h, const std::string &unit)
 
double getHeight (const std::string &unit) const
 
void setMaxGroundSpeed (double gs, const std::string &unit)
 
double getMaxGroundSpeed (const std::string &unit)
 
void setMaxVerticalSpeed (double vs, const std::string &unit)
 
double getMaxVerticalSpeed (const std::string &unit)
 
void setTrackTolerance (double trk, const std::string &unit)
 
double getTrackTolerance (const std::string &unit) const
 
void setGroundSpeedTolerance (double gs, const std::string &unit)
 
double getGroundSpeedTolerance (const std::string &unit) const
 
void setVerticalSpeedTolerance (double vs, const std::string &unit)
 
double getVerticalSpeedTolerance (const std::string &unit) const
 
void setOwnship (const Position &s, const Velocity &v, double t, const std::string &tunit)
 
void setOwnshipLL (double lat, double lon, const std::string &hunit, double alt, const std::string &vunit, double trk, const std::string &trkunit, double gs, const std::string &gsunit, double vs, const std::string &vsunit, double time, const std::string &tunit)
 
void setOwnshipXYZ (double sx, double sy, const std::string &hpunit, double sz, const std::string &vpunit, double vx, double vy, const std::string &hvunit, double vz, const std::string &vvunit, double time, const std::string &tunit)
 
bool addTraffic (const Plan &fp)
 
void clear ()
 
int trackLength ()
 
Interval track (int i, const std::string &unit)
 
BandsRegion::Region trackRegion (int i)
 
BandsRegion::Region regionOfTrack (double trk, const std::string &unit)
 
int groundSpeedLength ()
 
Interval groundSpeed (int i, const std::string &unit)
 
BandsRegion::Region groundSpeedRegion (int i)
 
BandsRegion::Region regionOfGroundSpeed (double gs, const std::string &unit)
 
int verticalSpeedLength ()
 
Interval verticalSpeed (int i, const std::string &unit)
 
BandsRegion::Region verticalSpeedRegion (int i)
 
BandsRegion::Region regionOfVerticalSpeed (double vs, const std::string &unit)
 
std::string toString () const
 
bool hasError () const
 
bool hasMessage () const
 
std::string getMessage ()
 
std::string getMessageNoClear () const
 
- Public Member Functions inherited from larcfm::GenericBands
virtual double getMaxGroundSpeed (const std::string &unit) const =0
 
virtual double getMaxVerticalSpeed (const std::string &unit) const =0
 

Private Member Functions

void init (double D, const std::string &dunit, double H, const std::string &hunit, double B, double T, const std::string &tunit, double max_gs, const std::string &gsunit, double max_vs, const std::string &vsunit)
 
void recompute ()
 
void trackCompute ()
 
void groundCompute ()
 
void verticalCompute ()
 
Interval track (int i, double unit)
 
Interval groundSpeed (int i, double unit)
 
Interval verticalSpeed (int i, double unit)
 
void toArrays (Interval interval[], BandsRegion::Region intRegion[], int &size, const IntervalSet &red, const IntervalSet &green)
 
void add (Interval arr[], int i, const Interval &r)
 
void add (BandsRegion::Region arr[], int i, BandsRegion::Region color)
 
int order (Interval arr[], int size, const Interval &n)
 

Private Attributes

IntentBandsCore red
 
bool ownship
 
bool needCompute
 
Position so
 
Velocity vo
 
double to
 
Interval trackArray [NUM_REGIONS]
 
BandsRegion::Region trackRegionArray [NUM_REGIONS]
 
int trackSize
 
Interval groundArray [NUM_REGIONS]
 
BandsRegion::Region groundRegionArray [NUM_REGIONS]
 
int groundSize
 
Interval verticalArray [NUM_REGIONS]
 
BandsRegion::Region verticalRegionArray [NUM_REGIONS]
 
int verticalSize
 
ErrorLog error
 

Static Private Attributes

static const int NUM_REGIONS = 400
 

Detailed Description

Objects of class "Bands" compute the 'no conflict' and near term conflict prevention (CP) bands using linear state-based preditions of ownship and (multiple) traffic aircraft positions. The bands consist of ranges of guidance maneuvers: track angles, ground speeds, and vertical speeds. If the ownship immediately executes a "NONE" guidance maneuver and no traffic aircraft maneuvers, then the new path is conflict free within a lookahead time. If the ownship immediately executes a "NEAR" guidance maneuver and no traffic aircraft maneuvers, then there will be a loss of separation within a lookahead time.

Note that in the case of geodetic coordinates this version of bands performs an internal projection of the coordinates and velocities into the Euclidean frame (see Util/Projection). Accuracy may be reduced if the traffic plans involve any segments longer than Util.Projection.projectionConflictRange(lat,acc), and an error will be logged if the distance between traffic and ownship exceeds Util.Projection.projectionMaxRange() at any point in the lookahead range.

Disclaimer: Only the mathematical core of these algorithms have been formally verified, certain book-keeping operations have not been verified. Even with a formal verification, there will still be certain assumptions. For instance, the formal proofs use real numbers while these implementations use floating point numbers, so numerical differences could result. In addition, the geodesic computations include certain inaccuracies, especially near the earth's poles.

The basic usage is

Bands b(..with configuration parameters..);
b.setOwnship(position of ownship, velocity of ownship);
b.addTraffic(position of traffic, velocity of traffic);
b.addTraffic(position of traffic, velocity of traffic);
...add other aircraft...

for (int i = 0; i < b.trackLength(); i++) {
   use band information from b.track(i) and b.trackRegion(i);
}
..similar for ground speed and vertical speed bands..

When any configuration parameter is set (horizontal separation distance, etc.), any previous bands information is cleared out; therefore, all configuration parameters must be set, before any traffic aircraft information is added. For more complete example usage see the file Batch.cpp.

Constructor & Destructor Documentation

◆ IntentBands() [1/2]

larcfm::IntentBands::IntentBands ( double  D,
const std::string &  dunit,
double  H,
const std::string &  hunit,
double  B,
double  T,
const std::string &  tunit,
double  max_gs,
const std::string &  gsunit,
double  max_vs,
const std::string &  vsunit 
)

Construct a Bands object with the given configuration parameters. The bands always begin as 'no conflict' bands: track bands from 0 to 2pi, ground speed bands from 0 to max_gs, and vertical speed bands from -max_vs to max_vs. Both the positions and velocities of the aircraft are assumed to be in Euclidean coordinates (see setLatLon() and setTrackVelocity() to change this behavior).

Parameters
Dthe minimum horizontal separation distance [nmi]
Hthe minimum vertical separation distance [feet]
Tthe near-term lookahead time [s]
max_gsthe maximum ground speed that is output by Bands, the minimum is 0. [knots]
max_vsthe range of vertical speeds is -max_vs to max_vs [feet/min]

◆ IntentBands() [2/2]

larcfm::IntentBands::IntentBands ( )

Construct a Bands object with default values for configuration parameters. These default values include: 5 nmi horizontal separation, 1000 ft vertical separation, 3 minutes for the lookahead time, 1000 knots max ground speed, 5000 fpm max vertical speed. The bands always begin as 'no conflict' bands: track bands from 0 to 2pi, ground speed bands from 0 to max_gs, and vertical speed bands from -max_vs to max_vs. Both the positions and velocities of the aircraft are assumed to be in Euclidean coordinates (see setLatLon() and setTrackVelocity() to change this behavior).

Member Function Documentation

◆ addTraffic()

bool larcfm::IntentBands::addTraffic ( const Plan fp)
virtual

Add a traffic aircraft flight plan to this set of conflict prevention band

Parameters
fptraffic flight plan (may be either latlon or Euclidean)

Implements larcfm::GenericIntentBands.

◆ clear()

void larcfm::IntentBands::clear ( )
virtual

Clear all bands information.

Implements larcfm::GenericBands.

◆ getLookaheadTime()

double larcfm::IntentBands::getLookaheadTime ( const std::string &  unit) const
virtual

Returns the time of the lookahead time. [s]

Implements larcfm::GenericBands.

◆ getMessage()

std::string larcfm::IntentBands::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::IntentBands::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.

◆ getStartTime()

double larcfm::IntentBands::getStartTime ( const std::string &  unit) const

Returns the time of the lookahead time. [s]

◆ groundCompute()

void larcfm::IntentBands::groundCompute ( )
private

Provide a copy of the ground speed bands [knots]. The range of ground speed bands is from 0 to max_gs.

◆ groundSpeed()

Interval larcfm::IntentBands::groundSpeed ( int  i,
const std::string &  unit 
)
virtual

Return i-th interval of the ground speed bands in the given unit.

Implements larcfm::GenericBands.

◆ groundSpeedLength()

int larcfm::IntentBands::groundSpeedLength ( )
virtual

Return the number of bands of ground speeds

Implements larcfm::GenericBands.

◆ groundSpeedRegion()

BandsRegion::Region larcfm::IntentBands::groundSpeedRegion ( int  i)
virtual

Return the region type of the i-th ground speed band. If a single time version of bands is used, then [NEAR|NONE] is returned. If a version of bands with two times is used, then [NEAR|MID|NONE] is returned.

Implements larcfm::GenericBands.

◆ hasError()

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

Does this object have an error?

Returns
true if there is an error.

Implements larcfm::ErrorReporter.

◆ hasMessage()

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

Does this object have an error or a warning?

Returns
true if there is an error or warning.

Implements larcfm::ErrorReporter.

◆ isLatLon()

bool larcfm::IntentBands::isLatLon ( ) const
virtual

Returns whether the aircraft positions are specified in latitude/longitude or Euclidean coordinates. If the ownship has not been set, then this value is undefined.

Implements larcfm::GenericBands.

◆ regionOfGroundSpeed()

BandsRegion::Region larcfm::IntentBands::regionOfGroundSpeed ( double  gs,
const std::string &  unit 
)
virtual

Return the region type of the given ground speed in knots, out of range speeds are returned as NEAR. If a single time version of bands is used, then [NEAR|NONE] is returned. If a version of bands with two times is used, then [NEAR|MID|NONE] is returned.

Implements larcfm::GenericBands.

◆ regionOfTrack()

BandsRegion::Region larcfm::IntentBands::regionOfTrack ( double  trk,
const std::string &  unit 
)
virtual

Return the region type of the given track angle [degrees, clockwise from true north]. An angle outside of a 0..360 degree range returns NEAR. If a single time version of bands is used, then [NEAR|NONE] is returned. If a version of bands with two times is used, then [NEAR|MID|NONE] is returned.

Implements larcfm::GenericBands.

◆ regionOfVerticalSpeed()

BandsRegion::Region larcfm::IntentBands::regionOfVerticalSpeed ( double  vs,
const std::string &  unit 
)
virtual

Return the region type of the given vertical speed [feet/min], out of range speeds are returned as red. If a single time version of bands is used, then [NEAR|NONE] is returned. If a version of bands with two times is used, then [NEAR|MID|NONE] is returned.

Implements larcfm::GenericBands.

◆ setLookaheadTime()

void larcfm::IntentBands::setLookaheadTime ( double  t,
const std::string &  unit 
)
virtual

Set the lookahead time [s]. Any existing bands information is cleared.

Implements larcfm::GenericBands.

◆ setMaxGroundSpeed()

void larcfm::IntentBands::setMaxGroundSpeed ( double  gs,
const std::string &  unit 
)
virtual

Sets the maximum ground speed that is output by Bands, the minimum is 0 [knots]. When this parameter is set any existing band information is cleared.

Implements larcfm::GenericBands.

◆ setMaxVerticalSpeed()

void larcfm::IntentBands::setMaxVerticalSpeed ( double  vs,
const std::string &  unit 
)
virtual

Sets the range of vertical speeds output by Bands, -max_vs to max_vs [fpm]. When this parameter is set any existing band information is cleared.

Implements larcfm::GenericBands.

◆ setOwnship()

void larcfm::IntentBands::setOwnship ( const Position s,
const Velocity v,
double  time,
const std::string &  tunit 
)
virtual

Specify the ownship's position and velocity. Once the ownship is set, any existing 'band' information is cleared. This also sets the coordinate frame for this object.

Parameters
sownship position
vownship velocity
timecurrent time

Implements larcfm::GenericIntentBands.

◆ setOwnshipLL()

void larcfm::IntentBands::setOwnshipLL ( double  lat,
double  lon,
const std::string &  hunit,
double  alt,
const std::string &  vunit,
double  trk,
const std::string &  trkunit,
double  gs,
const std::string &  gsunit,
double  vs,
const std::string &  vsunit,
double  time,
const std::string &  tunit 
)
virtual

Specify the ownship's position and velocity. Once the ownship is set, any existing 'band' information is cleared. This also sets the bands object to the lat/lon coordinate frame.

Parameters
latnorth latitude [deg] of ownship
loneast longitude [deg] of ownship
altaltitude [feet] of ownship
trktrack angle [degrees clockwise from true north] of ownship
gsground speed [knot] of ownship
vsvertical speed [feet/min] of ownship
timecurrent time

Implements larcfm::GenericIntentBands.

◆ setOwnshipXYZ()

void larcfm::IntentBands::setOwnshipXYZ ( double  sx,
double  sy,
const std::string &  hpunit,
double  sz,
const std::string &  vpunit,
double  vx,
double  vy,
const std::string &  hvunit,
double  vz,
const std::string &  vvunit,
double  time,
const std::string &  tunit 
)
virtual

Specify the ownship's position and velocity. Once the ownship is set, any existing 'band' information is cleared. This also sets the bands object to the Euclidean coordinate frame.

Parameters
sxx position [nmi] of ownship
syy position [nmi] of ownship
szz position [feet] of ownship
vxx speed component [knot] of ownship
vyy speed component [knot] of ownship
vzz speed component [feet/min] of ownship
timecurrent time

Implements larcfm::GenericIntentBands.

◆ setTimeRange()

void larcfm::IntentBands::setTimeRange ( double  b,
double  t,
const std::string &  tunit 
)

Set the lookahead time range [s]. Any existing bands information is cleared.

◆ toString()

std::string larcfm::IntentBands::toString ( ) const
virtual

Return a string representing this object.

Implements larcfm::GenericBands.

◆ track()

Interval larcfm::IntentBands::track ( int  i,
const std::string &  unit 
)
virtual

Return the i-th interval of the track bands in the given unit.

Implements larcfm::GenericBands.

◆ trackCompute()

void larcfm::IntentBands::trackCompute ( )
private

Provide a copy of the track angle bands. The angles are in 'compass' angles: 0 to 360 degrees, counter-clockwise from true north.

◆ trackLength()

int larcfm::IntentBands::trackLength ( )
virtual

Return the number of bands of track angles

Implements larcfm::GenericBands.

◆ trackRegion()

BandsRegion::Region larcfm::IntentBands::trackRegion ( int  i)
virtual

Return the region type of the i-th track band. If a single time version of bands is used, then [NEAR|NONE] is returned. If a version of bands with two times is used, then [NEAR|MID|NONE] is returned.

Implements larcfm::GenericBands.

◆ verticalCompute()

void larcfm::IntentBands::verticalCompute ( )
private

Provide a copy of the vertical speed bands [feet/min]. The range of vertical speeds is -max_vs to max_vs.

◆ verticalSpeed()

Interval larcfm::IntentBands::verticalSpeed ( int  i,
const std::string &  unit 
)
virtual

Return the i-th interval of the vertical speed band in the given unit.

Implements larcfm::GenericBands.

◆ verticalSpeedLength()

int larcfm::IntentBands::verticalSpeedLength ( )
virtual

Return the number of bands of vertical speeds

Implements larcfm::GenericBands.

◆ verticalSpeedRegion()

BandsRegion::Region larcfm::IntentBands::verticalSpeedRegion ( int  i)
virtual

Return the region type of the i-th vertical speed band. If a single time version of bands is used, then [NEAR|NONE] is returned. If a version of bands with two times is used, then [NEAR|MID|NONE] is returned.

Implements larcfm::GenericBands.


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