WSF
WsfWaypoint Class Reference

#include <WsfWaypoint.hpp>

Inheritance diagram for WsfWaypoint:
Collaboration diagram for WsfWaypoint:

Public Types

enum  {
  cLATITUDE_AND_LONGITUDE = 0x0001 , cRELATIVE_OFFSET = 0x0002 , cLOCATION_MASK = 0x000F , cABSOLUTE_HEADING = 0x0010 ,
  cRELATIVE_HEADING = 0x0020 , cHEADING_MASK = 0x0030 , cDISTANCE = 0x0100 , cTIME = 0x0200 ,
  cTIME_TO_POINT = 0x0400 , cDURATION_MASK = 0x0F00
}
 Enumeration describing the type of WsfWaypoint indicated. More...

Public Member Functions

 WsfWaypoint ()=default
 WsfWaypoint (double aLat, double aLon, double aAlt, double aSpeed=WsfPath::cUSE_PREVIOUS)
 WsfWaypoint (const WsfGeoPoint &aPoint, double aSpeed=WsfPath::cUSE_PREVIOUS)
 WsfWaypoint (const WsfWaypoint &)=default
 WsfWaypoint (WsfWaypoint &&)=default
WsfWaypointoperator= (const WsfWaypoint &)=default
WsfWaypointoperator= (WsfWaypoint &&)=default
 ~WsfWaypoint () override=default
WsfWaypointClone () const
 Clone constructs a new WsfWaypoint equivalent to the (*this) object.
bool ProcessInput (UtInput &aInput)
bool ProcessAllInput (UtInput &aInput)
bool operator== (const WsfWaypoint &aRhs) const
bool operator!= (const WsfWaypoint &aRhs) const
void ExtrapolateAlongHeading (double aHeading)
void GreatCircleHeadingAndDistance (const WsfWaypoint &aWaypoint, double &aHeading, double &aDistance) const
void Print (ut::log::MessageStream &aStream) const
void SetCallback (WsfObject *aCallbackPtr)
WsfObjectGetCallback () const
double GetPauseTime () const
void SetPauseTime (double aPauseTime)
WsfStringId GetLabelId () const
void SetLabelId (WsfStringId aLabelId)
WsfStringId GetScriptId () const
void SetScriptId (WsfStringId aScriptId)
WsfStringId GetGotoId () const
void SetGotoId (WsfStringId aGotoId)
WsfStringId GetNewModeId () const
void SetNewModeId (WsfStringId aNewModeId)
int GetPointType () const
void SetPointType (int aPointType)
double GetLat () const
void SetLat (double aLat)
double GetLon () const
void SetLon (double aLon)
double GetAlt () const
void SetAlt (double aAlt)
void GetLocationLLA (double &aLat, double &aLon, double &aAlt) const
void SetLocationLLA (double aLat, double aLon, double aAlt)
double GetHeading () const
void SetHeading (double aHeading)
double GetLinearAccel () const
void SetLinearAccel (double aLinearAccel)
double GetRadialAccel () const
void SetRadialAccel (double aRadialAccel)
double GetClimbRate () const
void SetClimbRate (double aClimbRate)
double GetMaximumFlightPathAngle () const
void SetMaximumFlightPathAngle (double aMaximumFlightPathAngle)
void SetSpeed (double aSpeed)
double GetSpeed () const
double GetDistanceAlongRoute () const
void SetDistanceAlongRoute (double aDistanceAlongRoute)
double GetDistanceOrTime () const
void SetDistanceOrTime (double aDistanceOrTime)
WsfPath::AltRef GetAltRef () const
void SetAltRef (WsfPath::AltRef aAltRef)
WsfPath::EndPath GetEndOfPathOption () const
void SetEndOfPathOption (WsfPath::EndPath aEndOfPathOption)
WsfPath::TurnDirection GetTurnDirection () const
void SetTurnDirection (WsfPath::TurnDirection aTurnDirection)
WsfPath::Switch GetSwitch () const
void SetSwitch (WsfPath::Switch aSwitch)
unsigned int GetRouteId () const
void SetRouteId (unsigned int aRouteId)
WsfStringId GetNodeId () const
void SetNodeId (WsfStringId aNodeId)
unsigned int GetNodeIdNumber () const
void SetNodeIdNumber (unsigned int aNodeIdNumber)
unsigned int GetPositionInRoute () const
void SetPositionInRoute (unsigned int aPositionInRoute)
template<typename T>
void SerializeP (T &aBuff)
 For XIO (de)serialization.
Public Member Functions inherited from WsfAuxDataEnabled
 WsfAuxDataEnabled ()=default
 WsfAuxDataEnabled (const WsfAuxDataEnabled &aSrc)=default
WsfAuxDataEnabledoperator= (const WsfAuxDataEnabled &aRhs)
 WsfAuxDataEnabled (WsfAuxDataEnabled &&)=default
WsfAuxDataEnabledoperator= (WsfAuxDataEnabled &&)=default
virtual ~WsfAuxDataEnabled () noexcept
void SetAuxData (const WsfAttributeContainer &aAuxData)
void DeleteAuxData ()
 Delete the aux data container from the object.
void MergeAuxData (const WsfAuxDataEnabled &aSrc)
 Merge the object's aux data with aux data from an existing object.
void UpdateAuxData (const WsfAuxDataEnabled &aSrc)
 Update the object's aux data with aux data from an existing object.
bool HasAuxData () const
 Returns true if this object has aux data.
bool ProcessInput (UtInput &aInput)
template<typename T>
void Serialize (T &aBuff)
 (De)serialization for XIO
WsfAttributeContainerGetAuxData ()
const WsfAttributeContainerGetAuxData () const noexcept
const WsfAttributeContainerGetAuxDataConst () const noexcept

Static Public Member Functions

static std::unique_ptr< UtScriptClass > CreateScriptClass (const std::string &aClassName, UtScriptTypes *aScriptTypesPtr)

Additional Inherited Members

Static Public Attributes inherited from WsfAuxDataEnabled
static UtCallbackListN< void(const WsfAuxDataEnabled *)> AuxDataAccessed
static UtCallbackListN< void(const WsfAuxDataEnabled *)> AuxDataDestroyed

Detailed Description

A point on a path within a WsfRoute. The use of waypoints (WsfWaypoint) within the context of routes (WsfRoute) is powerful and varied. A minimalist waypoint consists of a latitude, longitude, altitude, and possibly a speed that the associated platform should have when intersecting it. In addition to the basic capability, waypoints may be of other types corresponding to specific needs. The type of waypoint is stored in the attribute WsfWaypoint::mPointType. In addition to having a (lat, lon, alt) designation, it can also be of 'offset' type, in which case the coordinates represent a linear offset from a given reference, and at run-time the corresponding route is given context in the world coordinate system by applying the WsfRoute::Transform method to it. A waypoint heading can be designated as either north- or body-relative; heading types absolute ('turn_to_heading') or relative ('turn_right' or 'turn_left') must be combined with either a specified 'time' or 'distance' to the next waypoint. Waypoint altitudes can be specified as above mean sea level ('msl') or above ground level ('agl'). If desired, a climb rate ('climb_rate') may be specified to select the rate of altitude change when traveling between waypoints. Target speeds and altitudes are maintained when crossing waypoints, unless overridden with new values. Linear and radial acceleration values may be specified to constrain speed changes, and impose g-limits on turns. Each waypoint may specify what behavior to use if that waypoint is at the end of a path ('extrapolate', 'stop', or 'remove'). Waypoint transitions can be triggered either 'switch_on_passing' (the default), or 'switch_on_approach', which uses an internally computed turn-radius to begin the turn early. If a waypoint is the first in a route, a 'pause_time' may specify a duration that must elapse before movement begins. A named scripted 'action' or 'execute' may be taken upon crossing a waypoint, or an implementation-defined WsfMover 'mode' may change when a waypoint is crossed. Consult the WSF User Documentation for more details.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

Enumeration describing the type of WsfWaypoint indicated.

Enumerator
cLATITUDE_AND_LONGITUDE 

A (latitude, longitude) waypoint (altitude is optional).

cRELATIVE_OFFSET 

A WsfWaypoint specified as an (X,Y,Z) relative offset.

cLOCATION_MASK 

Utility value to mask off location commands.

cABSOLUTE_HEADING 

A specified heading is absolute (north-relative).

cRELATIVE_HEADING 

A specified heading is relative (usually body-relative).

cHEADING_MASK 

Utility value to mask off heading commands.

cDISTANCE 

Specifies a target elapsed distance value.

cTIME 

Specifies a target elapsed time value.

cTIME_TO_POINT 

Specifies time duration to reach point.

cDURATION_MASK 

Utility value to mask off time and distance commands.

Constructor & Destructor Documentation

◆ WsfWaypoint() [1/5]

◆ WsfWaypoint() [2/5]

WsfWaypoint::WsfWaypoint ( double aLat,
double aLon,
double aAlt,
double aSpeed = WsfPath::cUSE_PREVIOUS )

Constructor that uses lat, lon, alt, and speed inputs to create a valid waypoint object.

Parameters
aLatThe latitude of the waypoint.
aLonThe longitude of the waypoint.
aAltThe altitude of the waypoint.
aSpeedThe speed associated with the waypoint.

◆ WsfWaypoint() [3/5]

WsfWaypoint::WsfWaypoint ( const WsfGeoPoint & aPoint,
double aSpeed = WsfPath::cUSE_PREVIOUS )

Constructor that uses a geopoint (WsfGeoPoint) and speed inputs create a valid waypoint object.

Parameters
aPointThe geopoint (WsfGeoPoint) object that provides the (lat, lon, alt) of the waypoint.
aSpeedThe speed associated with the waypoint.

References GetAlt(), GetLat(), and GetLon().

◆ WsfWaypoint() [4/5]

WsfWaypoint::WsfWaypoint ( const WsfWaypoint & )
default

References WsfWaypoint().

◆ WsfWaypoint() [5/5]

WsfWaypoint::WsfWaypoint ( WsfWaypoint && )
default

References WsfWaypoint().

◆ ~WsfWaypoint()

WsfWaypoint::~WsfWaypoint ( )
overridedefault

Member Function Documentation

◆ Clone()

WsfWaypoint * WsfWaypoint::Clone ( ) const

Clone constructs a new WsfWaypoint equivalent to the (*this) object.

References WsfWaypoint().

Referenced by XWsfOSM_Traffic::GetNextWaypoint(), if(), and ~WsfWaypoint().

◆ CreateScriptClass()

std::unique_ptr< UtScriptClass > WsfWaypoint::CreateScriptClass ( const std::string & aClassName,
UtScriptTypes * aScriptTypesPtr )
static

Create the 'class' object for the script system. This is invoked once by WsfScriptManager to create the 'class' object that defines the interface to instances of this class from the script system.

Referenced by WsfScriptManager::RegisterTypes().

◆ ExtrapolateAlongHeading()

void WsfWaypoint::ExtrapolateAlongHeading ( double aHeading)

Set a heading for this waypoint, and extrapolate the velocity in that direction.

Parameters
aHeadingCompass heading in radians.
Note
The waypoint must already have a specified latitude/longitude, altitude, and velocity.
Returns
'void', and will do nothing if required values are not set.

References WsfPath::cEP_EXTRAPOLATE, and cLATITUDE_AND_LONGITUDE.

◆ GetAlt()

◆ GetAltRef()

◆ GetCallback()

WsfObject * WsfWaypoint::GetCallback ( ) const

Returns a pointer to the waypoint's current callback

Returns
a pointer to the callback object.

Referenced by wsf::six_dof::Mover::ExecuteTriggers(), and WsfP6DOF_Mover::ExecuteTriggers().

◆ GetClimbRate()

double WsfWaypoint::GetClimbRate ( ) const
inline

◆ GetDistanceAlongRoute()

◆ GetDistanceOrTime()

◆ GetEndOfPathOption()

WsfPath::EndPath WsfWaypoint::GetEndOfPathOption ( ) const
inline

◆ GetGotoId()

◆ GetHeading()

◆ GetLabelId()

◆ GetLat()

◆ GetLinearAccel()

◆ GetLocationLLA()

void WsfWaypoint::GetLocationLLA ( double & aLat,
double & aLon,
double & aAlt ) const

Get the latitude, longitude, and altitude of the specified waypoint.

Parameters
aLat[output] The latitude of the given waypoint.
aLon[output] The longitude of the given waypoint.
aAlt[output] The altitude of the given waypoint.

Referenced by XWsfOSM_Traffic::ChangeScriptedLane(), WsfPathFinder::ComputeExtrapolate(), WsfRoadMover::CreateRoute(), if(), WsfNavigationMesh::RefineFromCurrentIndex(), WsfNavigationMesh::RefineFromCurrentPosition(), WsfRouteMover::SetRoutePoint(), WsfBrawlerMover::Update(), and UT_DEFINE_SCRIPT_METHOD().

◆ GetLon()

◆ GetMaximumFlightPathAngle()

double WsfWaypoint::GetMaximumFlightPathAngle ( ) const
inline

◆ GetNewModeId()

WsfStringId WsfWaypoint::GetNewModeId ( ) const
inline

◆ GetNodeId()

◆ GetNodeIdNumber()

unsigned int WsfWaypoint::GetNodeIdNumber ( ) const
inline

◆ GetPauseTime()

double WsfWaypoint::GetPauseTime ( ) const
inline

◆ GetPointType()

◆ GetPositionInRoute()

unsigned int WsfWaypoint::GetPositionInRoute ( ) const
inline

◆ GetRadialAccel()

◆ GetRouteId()

unsigned int WsfWaypoint::GetRouteId ( ) const
inline

◆ GetScriptId()

WsfStringId WsfWaypoint::GetScriptId ( ) const
inline

◆ GetSpeed()

◆ GetSwitch()

◆ GetTurnDirection()

◆ GreatCircleHeadingAndDistance()

void WsfWaypoint::GreatCircleHeadingAndDistance ( const WsfWaypoint & aWaypoint,
double & aHeading,
double & aDistance ) const

Get the great circle heading and distance from this waypoint to the specified waypoint.

Parameters
aWaypointThe reference waypoint to which the distance is computed.
aHeading[output] The heading to the given waypoint.
aDistance[output] The distance to the given waypoint.

References WsfWaypoint().

Referenced by WsfRoute::ProcessNavigationInput().

◆ operator!=()

bool WsfWaypoint::operator!= ( const WsfWaypoint & aRhs) const
inline

Determine whether two waypoints do not have the same position (lat, lon, alt).

Returns
'false' if the two waypoints have exactly the same position; 'true' otherwise.

References operator==(), and WsfWaypoint().

◆ operator=() [1/2]

WsfWaypoint & WsfWaypoint::operator= ( const WsfWaypoint & )
default

References WsfWaypoint().

◆ operator=() [2/2]

WsfWaypoint & WsfWaypoint::operator= ( WsfWaypoint && )
default

References WsfWaypoint().

◆ operator==()

bool WsfWaypoint::operator== ( const WsfWaypoint & aRhs) const
inline

Determine whether two waypoints have exactly the same position (lat, lon, alt).

Returns
'true' if the two waypoints have exactly the same position; 'false' otherwise.

References WsfWaypoint().

◆ Print()

◆ ProcessAllInput()

bool WsfWaypoint::ProcessAllInput ( UtInput & aInput)

◆ ProcessInput()

bool WsfWaypoint::ProcessInput ( UtInput & aInput)

Read in the configuration information for a single waypoint. For more details, see WsfRoute, and also the WSF User Guide.

Parameters
aInputA generic input.
Note
A waypoint is defined as the following:
waypoint ::= |latitude| |longitude|
[altitude |length|]
[speed |speed|]
[climb_rate |speed|]
[linear_acceleration |acceleration|]
[radial_acceleration |acceleration|]
[pause_time |time|]
[node_id |unsigned int|]
where |latitude|, |longitude|, |length|, |speed|,
|acceleration|, and |time| are defined in UtInput.
The fields are read in until a field not listed is reached.
Returns
'true', if any identified field is read; 'false' otherwise.

References WsfPath::cALT_REF_AGL, WsfPath::cALT_REF_MSL, cDISTANCE, WsfPath::cDOUBLE_NOT_SET, cDURATION_MASK, WsfPath::cEP_EXTRAPOLATE, WsfPath::cEP_REMOVE, WsfPath::cEP_STOP, cLATITUDE_AND_LONGITUDE, cLOCATION_MASK, WsfPath::cSWITCH_ON_APPROACH, WsfPath::cSWITCH_ON_DISTANCE, WsfPath::cSWITCH_ON_PASSING, WsfPath::cSWITCH_ON_TIME, cTIME, cTIME_TO_POINT, WsfPath::cTURN_DIR_LEFT, WsfPath::cTURN_DIR_RIGHT, WsfPath::cTURN_DIR_SHORTEST, and WsfAuxDataEnabled::ProcessInput().

Referenced by ProcessAllInput().

◆ SerializeP()

template<typename T>
void WsfWaypoint::SerializeP ( T & aBuff)

For XIO (de)serialization.

References WsfAuxDataEnabled::Serialize().

◆ SetAlt()

◆ SetAltRef()

void WsfWaypoint::SetAltRef ( WsfPath::AltRef aAltRef)
inline

◆ SetCallback()

void WsfWaypoint::SetCallback ( WsfObject * aCallbackPtr)

Sets the waypoint's current callback

Parameters
aCallbackPtrA pointer to the callback object.

Referenced by UT_DEFINE_SCRIPT_METHOD(), and UT_DEFINE_SCRIPT_METHOD().

◆ SetClimbRate()

void WsfWaypoint::SetClimbRate ( double aClimbRate)
inline

◆ SetDistanceAlongRoute()

void WsfWaypoint::SetDistanceAlongRoute ( double aDistanceAlongRoute)
inline

◆ SetDistanceOrTime()

void WsfWaypoint::SetDistanceOrTime ( double aDistanceOrTime)
inline

◆ SetEndOfPathOption()

void WsfWaypoint::SetEndOfPathOption ( WsfPath::EndPath aEndOfPathOption)
inline

Referenced by UT_DEFINE_SCRIPT_METHOD().

◆ SetGotoId()

void WsfWaypoint::SetGotoId ( WsfStringId aGotoId)
inline

◆ SetHeading()

◆ SetLabelId()

void WsfWaypoint::SetLabelId ( WsfStringId aLabelId)
inline

◆ SetLat()

◆ SetLinearAccel()

void WsfWaypoint::SetLinearAccel ( double aLinearAccel)
inline

◆ SetLocationLLA()

void WsfWaypoint::SetLocationLLA ( double aLat,
double aLon,
double aAlt )

◆ SetLon()

◆ SetMaximumFlightPathAngle()

void WsfWaypoint::SetMaximumFlightPathAngle ( double aMaximumFlightPathAngle)
inline

◆ SetNewModeId()

void WsfWaypoint::SetNewModeId ( WsfStringId aNewModeId)
inline

◆ SetNodeId()

void WsfWaypoint::SetNodeId ( WsfStringId aNodeId)
inline

◆ SetNodeIdNumber()

void WsfWaypoint::SetNodeIdNumber ( unsigned int aNodeIdNumber)
inline

◆ SetPauseTime()

void WsfWaypoint::SetPauseTime ( double aPauseTime)
inline

◆ SetPointType()

void WsfWaypoint::SetPointType ( int aPointType)
inline

◆ SetPositionInRoute()

void WsfWaypoint::SetPositionInRoute ( unsigned int aPositionInRoute)
inline

Referenced by WsfRoute::Insert().

◆ SetRadialAccel()

void WsfWaypoint::SetRadialAccel ( double aRadialAccel)
inline

Referenced by WsfRouteFinder::Route().

◆ SetRouteId()

void WsfWaypoint::SetRouteId ( unsigned int aRouteId)
inline

Referenced by WsfRoute::Insert().

◆ SetScriptId()

void WsfWaypoint::SetScriptId ( WsfStringId aScriptId)
inline

◆ SetSpeed()

void WsfWaypoint::SetSpeed ( double aSpeed)
inline

◆ SetSwitch()

void WsfWaypoint::SetSwitch ( WsfPath::Switch aSwitch)
inline

◆ SetTurnDirection()

void WsfWaypoint::SetTurnDirection ( WsfPath::TurnDirection aTurnDirection)
inline

The documentation for this class was generated from the following files:
Copyrights Multiple, All Rights Reserved