|
WSF
|
WsfPathComputer computes a WsfPathList for a platform to reach a target state. More...
#include <WsfPathComputer.hpp>

Classes | |
| struct | SpeedAltitudeBreakpoint |
Public Member Functions | |
| WsfPathComputer (ut::Random *aRandomPtr=nullptr) | |
| WsfPathConstraints & | GetConstraints () |
| void | ComputePath (const WsfPathState &aState, const WsfPathTarget &aTarget, WsfPathList &aPathList) |
| void | CreateTarget (const WsfPathState &aCurrentState, WsfPathConstraints &aCurrentConstraints, const WsfPathConstraints &aMoverConstraints, const WsfWaypoint &aTargetPoint, const WsfWaypoint *aNextPointPtr, WsfPathTarget &aTarget) |
| void | ConstrainTarget (WsfPathTarget &aTarget, const WsfPathConstraints &aConstraints) |
| Bind target to a valid altitude/speed. | |
| void | RevisePathHitPointAtTime (WsfPathTarget &aTarget, WsfPathList &aPath) |
| void | SetMaximumTurn (double aMaxTurn) |
| double | GetMaximumTurn () const |
| void | SetPathVarianceRadius (double aPathVarianceRadius) |
| void | SetSpeedVariancePct (double aSpeedVariancePct) |
| void | SetDefaultSwitch (WsfPath::Switch aDefaultSwitch) |
| void | SetRandom (ut::Random *aRandomPtr) |
| double | GetTurnRadius (double aSpeed) |
| void | TurnToHeading (const WsfPathState &aState, const WsfPathTarget &aTarget, WsfPathList &aPathList, WsfPathTarget::TurnDirection aTurnDirection) |
| void | TurnRelative (const WsfPathState &aState, const WsfPathTarget &aTarget, WsfPathList &aPathList, double aTurnAngle, double aTurnRadius=-1.0) |
| bool | TurnToPointHeading (const WsfPathState &aState, const WsfPathTarget &aTarget, WsfPathList &aPath) |
| void | StraightToPoint (const WsfPathState &aState, const WsfPathTarget &aTarget, WsfPathList &aPath, bool aAllowHeadingChange) |
| void | Rotate (UtVec3d aRotationAxis, double aArcLength, double aTime, const WsfPathTarget &aTarget, const WsfPathState &aState, WsfPathList &aPath, double aRotationRadius, double aTargetRoll=0.0) |
| void | StraightOnHeading (const WsfPathState &aState, const WsfPathTarget &aTarget, WsfPathList &aPath) |
| bool | ComputeSpeedAltitudeTargets (const WsfPathState &aState, const WsfPathTarget &aTarget, SpeedAltitudeBreakpoint &aBreakpoint) |
| bool | UsingComputedClimbRate () |
| void | SetUsingComputedClimbRate (bool aBool) |
| void | ForceFlyFlightPath (bool aBool) |
Public Attributes | |
| ut::Random * | mRandomPtr |
| WsfPathConstraints | mConstraints |
| double | mSimTime |
| double | mIntegrationTime |
| double | mMaximumTurn |
| double | mPathVarianceRadius |
| double | mSpeedVariancePct |
| WsfPath::Switch | mDefaultSwitch |
| bool | mUsingComputedClimbRate |
| 'true' if the current target has a computed flight angle | |
| bool | mUsingComputedLinearAcceleration |
| 'true' if the current target has a computed linear acceleration | |
| bool | mUsingComputedSpeed |
| 'true' if the current target has a computed speed. | |
| bool | mFlyFlightPathToTarget |
| 'true' use calculated flight path constraints to fly along slope to next target point | |
WsfPathComputer computes a WsfPathList for a platform to reach a target state.
| WsfPathComputer::WsfPathComputer | ( | ut::Random * | aRandomPtr = nullptr | ) |
| void WsfPathComputer::ComputePath | ( | const WsfPathState & | aState, |
| const WsfPathTarget & | aTarget, | ||
| WsfPathList & | aPathList ) |
References WsfPathList::Append(), WsfPathTarget::cEXTRAPOLATE, WsfPathTarget::cHEADING, WsfPathTarget::cLOCATION, WsfPathTarget::cRELATIVE_TURN, WsfPathList::Empty(), WsfPathList::GetEndState(), WsfPathList::Segment::Initialize(), WsfPathTarget::mHeading, WsfPathTarget::mTargetType, WsfPathTarget::mTurnDirection, StraightOnHeading(), TurnRelative(), and TurnToHeading().
Referenced by WsfWaypointMover::GetFutureLocationWCS(), and RevisePathHitPointAtTime().
| bool WsfPathComputer::ComputeSpeedAltitudeTargets | ( | const WsfPathState & | aState, |
| const WsfPathTarget & | aTarget, | ||
| SpeedAltitudeBreakpoint & | aBreakpoint ) |
References WsfPathTarget::cALTITUDE, WsfPathTarget::cSPEED, WsfPathState::mAltitude, WsfPathTarget::mAltitude, WsfPathComputer::SpeedAltitudeBreakpoint::mClimbRate, mConstraints, WsfPathComputer::SpeedAltitudeBreakpoint::mFlightAngle, WsfPathComputer::SpeedAltitudeBreakpoint::mLinearAcceleration, WsfPathComputer::SpeedAltitudeBreakpoint::mSimTime, WsfPathTarget::mSpeed, WsfPathTarget::mTargetType, and WsfPathState::mVelocityNED.
Referenced by Rotate().
| void WsfPathComputer::ConstrainTarget | ( | WsfPathTarget & | aTarget, |
| const WsfPathConstraints & | aConstraints ) |
Bind target to a valid altitude/speed.
References WsfPathTarget::cALTITUDE, WsfPathTarget::cSPEED, WsfPathTarget::mAltitude, WsfPathConstraints::mIsOnGround, WsfPathConstraints::mMaxAltitude, WsfPathConstraints::mMaxSpeed, WsfPathConstraints::mMinAltitude, WsfPathConstraints::mMinSpeed, WsfPathTarget::mSpeed, and WsfPathTarget::mTargetType.
Referenced by CreateTarget().
| void WsfPathComputer::CreateTarget | ( | const WsfPathState & | aCurrentState, |
| WsfPathConstraints & | aCurrentConstraints, | ||
| const WsfPathConstraints & | aMoverConstraints, | ||
| const WsfWaypoint & | aTargetPoint, | ||
| const WsfWaypoint * | aNextPointPtr, | ||
| WsfPathTarget & | aTarget ) |
Given the current state, the next waypoint and the waypoint after, create the 'path target' for ComputePath.
| aCurrentState | [input] The current state. |
| aCurrentConstraints | [input] The current path constraints. |
| aMoverConstraints | [input] The constraints defined in the mover by the user. |
| aTargetPoint | [input] A reference to the target waypoint. |
| aNextPointPtr | [input] A pointer to the waypoint that follows the target waypoint. This is only used if the target waypoint specifies 'turn on approach', and may be 0. |
| aTarget | [output] The created path target. |
Routes are sometimes set up to loop on 1 point. Handle this case explicitly with a 360 turn.
References WsfPathTarget::cALTITUDE, WsfPathConstraints::cDEFAULT_MAX_FLIGHT_ANGLE, WsfPathConstraints::cDEFAULT_MAX_LINEAR_ACCEL, WsfWaypoint::cDISTANCE, WsfPath::cDOUBLE_NOT_SET, WsfPathTarget::cHEADING, WsfPathConstraints::cLARGE_DOUBLE, WsfWaypoint::cLATITUDE_AND_LONGITUDE, WsfPathTarget::cLOCATION, ConstrainTarget(), WsfWaypoint::cRELATIVE_HEADING, WsfPathTarget::cRELATIVE_TURN, WsfPathTarget::cSPEED, WsfPath::cSWITCH_MOVER_DEFAULT, WsfPath::cSWITCH_ON_APPROACH, WsfWaypoint::cTIME, WsfWaypoint::cTIME_TO_POINT, WsfPath::cTURN_DIR_RIGHT, WsfPathTarget::cTURN_ON_APPROACH, WsfPath::cUSE_PREVIOUS, WsfGeoPoint::Extrapolate(), GetConstraints(), WsfWaypoint::GetDistanceOrTime(), WsfWaypoint::GetHeading(), WsfGeoPoint::GetLat(), WsfWaypoint::GetLat(), WsfPathState::GetLocationLLA(), WsfGeoPoint::GetLon(), WsfWaypoint::GetLon(), WsfWaypoint::GetPointType(), WsfWaypoint::GetRadialAccel(), WsfPathState::GetSpeed(), WsfWaypoint::GetSwitch(), WsfWaypoint::GetTurnDirection(), WsfPathTarget::mAltitude, mConstraints, mDefaultSwitch, WsfPathTarget::mDistance, mFlyFlightPathToTarget, WsfPathTarget::mHeading, WsfPathTarget::mLatitude, WsfPathTarget::mLongitude, WsfPathConstraints::mMaxClimbRate, WsfPathConstraints::mMaxFlightPathAngle, WsfPathConstraints::mMaxLinearAccel, WsfPathConstraints::mMaxRadialAccel, WsfPathTarget::mNextPointLat, WsfPathTarget::mNextPointLon, WsfPathTarget::mNextPointRadialAccel, mPathVarianceRadius, mRandomPtr, WsfPathTarget::mSpeed, mSpeedVariancePct, WsfPathTarget::mTargetType, WsfPathTarget::mTime, WsfPathTarget::mTurnDirection, mUsingComputedClimbRate, mUsingComputedLinearAcceleration, and mUsingComputedSpeed.
Referenced by WsfWaypointMover::GetFutureLocationWCS().
|
inline |
References mFlyFlightPathToTarget.
|
inline |
References mConstraints.
Referenced by CreateTarget(), and RevisePathHitPointAtTime().
|
inline |
References mMaximumTurn.
| double WsfPathComputer::GetTurnRadius | ( | double | aSpeed | ) |
Get the turn radius calculated based on current path constraints.
| aSpeed | Speed to use in turn radius calculations. (m/s) |
References mConstraints.
Referenced by WsfWaypointMover::TurnRadius(), WsfWaypointMover::TurnRadius(), and TurnRelative().
| void WsfPathComputer::RevisePathHitPointAtTime | ( | WsfPathTarget & | aTarget, |
| WsfPathList & | aPath ) |
References WsfPathList::Append(), ComputePath(), WsfPathTarget::cSPEED, WsfPathList::Empty(), GetConstraints(), WsfPathList::GetDuration(), WsfPathList::Segment::GetDuration(), WsfPathList::Segment::GetInitialState(), WsfPathList::GetSegments(), WsfPathState::GetSpeed(), WsfPathList::GetState(), WsfPathConstraints::mMaxLinearAccel, WsfPathConstraints::mMaxSpeed, WsfPathConstraints::mMinSpeed, WsfPathTarget::mSpeed, WsfPathTarget::mTargetType, WsfPathTarget::mTime, mUsingComputedSpeed, and WsfPathList::PopBack().
Referenced by WsfWaypointMover::GetFutureLocationWCS().
| void WsfPathComputer::Rotate | ( | UtVec3d | aRotationAxis, |
| double | aArcLength, | ||
| double | aTime, | ||
| const WsfPathTarget & | aTarget, | ||
| const WsfPathState & | aState, | ||
| WsfPathList & | aPath, | ||
| double | aRotationRadius, | ||
| double | aTargetRoll = 0.0 ) |
References WsfPathList::Append(), ComputeSpeedAltitudeTargets(), WsfPathList::RotationArcSegment::ComputeState(), WsfPathTarget::cSPEED, WsfPathList::GetEndState(), WsfPathList::Segment::Initialize(), WsfPathList::RotationData::InitializeRotation(), WsfPathState::mAccelerationNED, WsfPathState::mAltitude, WsfPathComputer::SpeedAltitudeBreakpoint::mClimbRate, mConstraints, WsfPathComputer::SpeedAltitudeBreakpoint::mFlightAngle, WsfPathList::Segment::mIsApproximation, WsfPathState::mLatitude, WsfPathComputer::SpeedAltitudeBreakpoint::mLinearAcceleration, WsfPathState::mLongitude, WsfPathState::mOrientationNED, WsfPathComputer::SpeedAltitudeBreakpoint::mSimTime, WsfPathTarget::mSpeed, WsfPathTarget::mTargetType, WsfPathState::mVelocityNED, WsfPathList::DynamicsData::SetClimbRate(), WsfPathList::DynamicsData::SetFlightAngle(), WsfPathList::DynamicsData::SetLinearAcceleration(), WsfPathList::Segment::SetRollRate(), WsfPathList::RotationData::SetRotationRadius(), WsfPathList::RotationArcSegment::SetTargetRoll(), and WsfPathList::RotationSegment::SetTargetRoll().
Referenced by StraightOnHeading(), StraightToPoint(), TurnRelative(), and TurnToPointHeading().
|
inline |
References mDefaultSwitch.
|
inline |
Sets the maximum turn (radians). Turns greater than the maximum turn are ignored. Determines how hard we'll try to get to points behind us.
References mMaximumTurn.
|
inline |
References mPathVarianceRadius.
|
inline |
Sets the random device for computation of 'variance' to routes The random device must remain valid until the path computer is destroyed.
References mRandomPtr.
|
inline |
References mSpeedVariancePct.
|
inline |
References mUsingComputedClimbRate.
| void WsfPathComputer::StraightOnHeading | ( | const WsfPathState & | aState, |
| const WsfPathTarget & | aTarget, | ||
| WsfPathList & | aPath ) |
| void WsfPathComputer::StraightToPoint | ( | const WsfPathState & | aState, |
| const WsfPathTarget & | aTarget, | ||
| WsfPathList & | aPath, | ||
| bool | aAllowHeadingChange ) |
References WsfPathState::CopyToEntity(), WsfPathTarget::cSPEED, WsfPathTarget::cTURN_ON_APPROACH, WsfPathState::mAltitude, WsfPathState::mLatitude, WsfPathTarget::mLatitude, WsfPathState::mLongitude, WsfPathTarget::mLongitude, WsfPathTarget::mNextPointLat, WsfPathTarget::mNextPointLon, WsfPathTarget::mNextPointRadialAccel, WsfPathTarget::mSpeed, WsfPathTarget::mTargetType, WsfPathState::mVelocityNED, and Rotate().
Referenced by TurnToPointHeading().
| void WsfPathComputer::TurnRelative | ( | const WsfPathState & | aState, |
| const WsfPathTarget & | aTarget, | ||
| WsfPathList & | aPathList, | ||
| double | aTurnAngle, | ||
| double | aTurnRadius = -1.0 ) |
References WsfPathList::Append(), WsfPathList::GetDuration(), WsfPathList::GetEndState(), GetTurnRadius(), WsfPathList::Segment::Initialize(), WsfPathState::mAltitude, WsfPathTarget::mDistance, WsfPathTarget::mHeading, WsfPathState::mLatitude, WsfPathState::mLongitude, WsfPathState::mOrientationNED, WsfPathTarget::mTime, WsfPathState::mVelocityNED, Rotate(), and StraightOnHeading().
Referenced by ComputePath(), and TurnToHeading().
| void WsfPathComputer::TurnToHeading | ( | const WsfPathState & | aState, |
| const WsfPathTarget & | aTarget, | ||
| WsfPathList & | aPathList, | ||
| WsfPathTarget::TurnDirection | aTurnDirection ) |
References WsfPathTarget::mHeading, WsfPathState::mOrientationNED, and TurnRelative().
Referenced by ComputePath().
| bool WsfPathComputer::TurnToPointHeading | ( | const WsfPathState & | aState, |
| const WsfPathTarget & | aTarget, | ||
| WsfPathList & | aPath ) |
References Rotate(), StraightOnHeading(), and StraightToPoint().
|
inline |
References mUsingComputedClimbRate.
| WsfPathConstraints WsfPathComputer::mConstraints |
Referenced by ComputeSpeedAltitudeTargets(), CreateTarget(), GetConstraints(), GetTurnRadius(), Rotate(), and WsfPathComputer().
| WsfPath::Switch WsfPathComputer::mDefaultSwitch |
The default criteria used to determine when a waypoint switch should occur if the waypoint does not specify a switch criteria.
Referenced by CreateTarget(), SetDefaultSwitch(), and WsfPathComputer().
| bool WsfPathComputer::mFlyFlightPathToTarget |
'true' use calculated flight path constraints to fly along slope to next target point
Referenced by CreateTarget(), ForceFlyFlightPath(), and WsfPathComputer().
| double WsfPathComputer::mIntegrationTime |
Referenced by WsfPathComputer().
| double WsfPathComputer::mMaximumTurn |
Referenced by GetMaximumTurn(), SetMaximumTurn(), and WsfPathComputer().
| double WsfPathComputer::mPathVarianceRadius |
Referenced by CreateTarget(), SetPathVarianceRadius(), and WsfPathComputer().
| ut::Random* WsfPathComputer::mRandomPtr |
Referenced by CreateTarget(), SetRandom(), and WsfPathComputer().
| double WsfPathComputer::mSimTime |
Referenced by WsfPathComputer().
| double WsfPathComputer::mSpeedVariancePct |
Referenced by CreateTarget(), SetSpeedVariancePct(), and WsfPathComputer().
| bool WsfPathComputer::mUsingComputedClimbRate |
'true' if the current target has a computed flight angle
Referenced by CreateTarget(), SetUsingComputedClimbRate(), UsingComputedClimbRate(), and WsfPathComputer().
| bool WsfPathComputer::mUsingComputedLinearAcceleration |
'true' if the current target has a computed linear acceleration
Referenced by CreateTarget(), and WsfPathComputer().
| bool WsfPathComputer::mUsingComputedSpeed |
'true' if the current target has a computed speed.
Referenced by CreateTarget(), RevisePathHitPointAtTime(), and WsfPathComputer().