WSF
WsfIterativeRouteMover.hpp
Go to the documentation of this file.
1// ****************************************************************************
2// CUI
3//
4// The Advanced Framework for Simulation, Integration, and Modeling (AFSIM)
5//
6// Copyright 2003-2015 The Boeing Company. All rights reserved.
7//
8// The use, dissemination or disclosure of data in this file is subject to
9// limitation or restriction. See accompanying README and LICENSE for details.
10// ****************************************************************************
11// ****************************************************************************
12// Updated by Infoscitex, a DCS Company.
13// ****************************************************************************
14
15#ifndef WSFITERATIVEROUTEMOVER_HPP
16#define WSFITERATIVEROUTEMOVER_HPP
17
18#include "wsf_export.h"
19
20#include "WsfRouteMover.hpp"
21class WsfPathGuidance;
22
25{
26public:
31 ~WsfIterativeRouteMover() override;
32
33 bool Initialize(double aSimTime) override;
34 bool ProcessInput(UtInput& aInput) override;
35
36 void Pause(double aSimTime, double aUnpauseTime) override;
37
38 void SetGuidanceFrom(const WsfWaypoint& aPreviousWaypoint) override;
39 void SetGuidanceTo(const WsfWaypoint& aPreviousWaypoint) override;
40
41 void AdvanceToNextWaypoint(double aSimTime, const WsfWaypoint& aTarget, const WsfWaypoint* aNextPointPtr) override;
42
43 void UpdatePosition(double aSimTime) override;
44
45 double GetTurnLeadDistance(double aCurrentSpeed, double aCurrentHeading);
46
47 bool GetConverging() const { return mConverging[2]; }
48
49 bool GoToAltitude(double aSimTime, double aAltitude, double aClimbDiveRate, bool aKeepRoute) override;
50 bool GoToLocation(double aSimTime, double aLatitude, double aLongitude, double aAltitude) override;
51 bool GoToSpeed(double aSimTime, double aSpeed, double aLinearAccel, bool aKeepRoute) override;
52 bool TurnToHeading(double aSimTime, double aHeading, double aRadialAccel, WsfPath::TurnDirection aTurnDirection) override;
53 bool TurnToRelativeHeading(double aSimTime,
54 double aHeadingChange,
55 double aRadialAccel,
56 WsfPath::TurnDirection aTurnDirection) override;
57
58 WsfPathGuidance* GetGuidance() const { return mGuidancePtr; }
59
60protected:
61 virtual void LocalUpdate(double aSimTime, bool& aMoved, bool& aAdvanceToNextWaypoint) = 0;
62 virtual void PostMoveUpdate(double aSimTime);
63 void AdvanceTime(double aSimTime, bool& aAdvanceToNextWaypoint);
64 void SetGuidance(WsfPathGuidance* aGuidancePtr) { mGuidancePtr = aGuidancePtr; }
65 void SetConverging(bool aValue);
66 void ClearConverging();
67 void ResetWPSwitching();
68 double SegmentDistRemaining() const;
69 double SegmentTimeRemaining() const;
70 double CumSegmentDist() const { return mCumSegmentDist; }
71 double CumSegmentTime() const { return mCumSegmentTime; }
73 double GetMinTurnRadius() const { return mMinTurnRadius; }
74
76 bool GetIsOnGround() const { return mIsOnGround; }
77 void SetIsOnGround(bool aValue) { mIsOnGround = aValue; }
78
80 bool GetIsInAir() const { return !mIsOnGround; }
81
82 void IncrSegmentDist(double aIncrement) { mCumSegmentDist += aIncrement; }
83
84 void IncrSegmentTime(double aIncrement) { mCumSegmentTime += aIncrement; }
85 void SetMinTurnRadius(double aValue) { mMinTurnRadius = aValue; }
86
87 virtual bool IsWaypointSwitchTime(double aSimTime);
88
89 void SetGroundAttitude(double aLatitude, double aLongitude);
90 void CalcAltitudesAndAttitude(double /*aSimTime*/);
91 double GetHeightOfTerrain() const { return mHeightOfTerrain; }
92
93private:
94 void InitializeTurnOnApproach(const WsfWaypoint& aTarget, const WsfWaypoint* aNextTarget);
95
96 bool mIsOnGround;
97 bool mIsOnRoad;
98 bool mPitchEnable;
99
100 bool mConverging[3]; // Keep three past values as a history buffer
101
102 int mRecursionLevel;
103
104 double mHeightOfTerrain;
105 double mCumSegmentDist; // Cumulative distance in waypoint segment.
106 double mCumSegmentTime; // Cumulative time in waypoint segment.
107 double mMinTurnRadius; // Min Turn Radius (provided by implementation)
108 double mSwitchRadius; // North-East distance to switch point
109
111 double mLastForwardOffset;
112
114 double mNextSegHeading;
116 double mNextSegRadialAccel;
117
118 WsfPathGuidance* mGuidancePtr;
119};
120
121#endif
#define WSF_EXPORT
Definition WsfXIO_Export.hpp:35
void IncrSegmentDist(double aIncrement)
Definition WsfIterativeRouteMover.hpp:82
bool GetIsInAir() const
Return an indication of whether this platform is currently in air.
Definition WsfIterativeRouteMover.hpp:80
double CumSegmentTime() const
Definition WsfIterativeRouteMover.hpp:71
virtual void LocalUpdate(double aSimTime, bool &aMoved, bool &aAdvanceToNextWaypoint)=0
double GetTurnLeadDistance(double aCurrentSpeed, double aCurrentHeading)
Definition WsfIterativeRouteMover.cpp:566
void SetGuidance(WsfPathGuidance *aGuidancePtr)
Definition WsfIterativeRouteMover.hpp:64
double GetMinTurnRadius() const
Return the current value of minimum turn radius.
Definition WsfIterativeRouteMover.hpp:73
virtual void PostMoveUpdate(double aSimTime)
Definition WsfIterativeRouteMover.cpp:199
double CumSegmentDist() const
Definition WsfIterativeRouteMover.hpp:70
bool GetIsOnGround() const
Return an indication of whether this platform is currently sitting on terrain.
Definition WsfIterativeRouteMover.hpp:76
WsfIterativeRouteMover()=delete
WsfIterativeRouteMover & operator=(const WsfIterativeRouteMover &)=delete
double GetHeightOfTerrain() const
Definition WsfIterativeRouteMover.hpp:91
WsfPathGuidance * GetGuidance() const
Definition WsfIterativeRouteMover.hpp:58
void SetMinTurnRadius(double aValue)
Definition WsfIterativeRouteMover.hpp:85
void IncrSegmentTime(double aIncrement)
Definition WsfIterativeRouteMover.hpp:84
void AdvanceTime(double aSimTime, bool &aAdvanceToNextWaypoint)
Definition WsfIterativeRouteMover.cpp:172
void SetIsOnGround(bool aValue)
Definition WsfIterativeRouteMover.hpp:77
bool GetConverging() const
Definition WsfIterativeRouteMover.hpp:47
virtual bool TurnToHeading(double aSimTime, double aHeading, double aRadialAccel, WsfPath::TurnDirection aTurnDirection)
Definition WsfMover.cpp:454
virtual bool GoToAltitude(double aSimTime, double aAltitude, double aClimbDiveRate, bool aKeepRoute)
Definition WsfMover.cpp:383
virtual bool TurnToRelativeHeading(double aSimTime, double aHeadingChange, double aRadialAccel, WsfPath::TurnDirection aTurnDirection)
Definition WsfMover.cpp:467
Definition WsfPathGuidance.hpp:39
bool ProcessInput(UtInput &aInput) override
Definition WsfRouteMover.cpp:308
bool GoToSpeed(double aSimTime, double aSpeed, double aLinearAccel, bool aKeepRoute) override
Definition WsfRouteMover.cpp:557
WsfRouteMover()=delete
virtual void UpdatePosition(double aSimTime)=0
virtual void SetGuidanceFrom(const WsfWaypoint &aPreviousWaypoint)=0
bool GoToLocation(double aSimTime, double aLatitude, double aLongitude, double aAltitude) override
Definition WsfRouteMover.cpp:844
virtual void AdvanceToNextWaypoint(double aSimTime, const WsfWaypoint &aTarget, const WsfWaypoint *aNextPointPtr)=0
virtual void SetGuidanceTo(const WsfWaypoint &aNextWaypoint)=0
virtual void Pause(double aSimTime, double aUnpauseTime)=0
Sets the mover to a paused state.
bool Initialize(double aSimTime) override
Definition WsfRouteMover.cpp:136
Contains the data required to create a simulation, and acts as the entry point for input file process...
Definition WsfScenario.hpp:111
Definition WsfWaypoint.hpp:57
TurnDirection
Turn direction for TurnToHeading and TurnToRelativeHeading.
Definition WsfPath.hpp:88
Copyrights Multiple, All Rights Reserved