WSF
WsfFollower.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 WSFFOLLOWER_HPP
16#define WSFFOLLOWER_HPP
17
18#include "wsf_export.h"
19
20#include "WsfMover.hpp"
21
34
36{
37public:
38 WsfFollower() = delete;
39 WsfFollower(WsfScenario& aScenario);
40 ~WsfFollower() override = default;
41
43
44 WsfMover* Clone() const override;
45 bool Initialize(double aSimTime) override;
46 bool ProcessInput(UtInput& aInput) override;
47 void Update(double aSimTime) override;
49
51
52 bool IsInitialized() const { return mHasBeenInitialized; }
53
56
57 void SetLocationLLA(double aLatitude, double aLongitude, double aAltitude);
58 void SetSpeed(double aSpeed) { mInitSpeed = aSpeed; }
59 void SetHeading(double aHeading) override { mInitHeading = aHeading; }
61
63 bool GetTargetIsValid() { return mTargetIsValid; };
64
65protected:
66 // Declare default copy constructor (for Clone())
67 WsfFollower(const WsfFollower& aSrc);
69
70 // Sets the information on the follower
71 void FollowThis(double aTimeStamp, double aLocationWCS[3], double aVelocityWCS[3]);
72 void DontFollowThis() { mTargetIsValid = false; }
73
74 // Called during update
75 void AdvanceTime(double aSimTime);
76
78 void UpdateFollowPosAndVel(double aSimTime);
79
80 // Imposes turn limits on the follower
81 void ImposeTurnLimits(double aHeadingChangeMag,
82 double aHeadingChangeDir,
83 double aHorizGroundSpeed,
84 double& aDeltaT,
85 double& aHeading,
86 double& aRollAngle);
87
88 // Used in the turn limit calculation
89 inline double MinimumPositiveValue(double aValue1, double aValue2, double aValue3, double aValue4) const;
90
92 void OutputDiagnostic(double aSimTime, WsfPlatform* aPlatformPtr);
93 void OutputVec3d(std::string& aLabel, double aVec[]);
94
95private:
97 bool mHasBeenInitialized;
98
100 double mInitLatitudeDeg;
101 double mInitLongitudeDeg;
102 double mInitAltitude;
103 double mInitSpeed;
104 double mInitHeading;
105
107 bool mTargetIsValid;
108
110 double mTargetTimeStamp;
111 double mTargetLocWCS[3];
112 double mTargetVelWCS[3];
113
115 double mLastTargetTimeStamp;
116 double mLastTargetLocWCS[3];
117
119 double mTargetExtrapTimeStamp;
120 double mTargetExtrapLocWCS[3];
121 double mTargetExtrapUnitLOSNED[3];
122 double mTargetExtrapAlt;
123
124 double mTargetForward;
125 double mTargetFwdRate;
126 double mTargetSpeed;
127
129 double mMaxAxialAccel; // m/s^2
130 double mMaxClimbRate; // m/s
131 double mMaxSpeed; // m/s
132 double mMinSpeed; // m/s
133
135 double mMaxRadialAccel; // m/s^2
136 double mMaxTurnRate; // radians/s
137 double mMaxBankAngle; // radians
138 double mMaxVertBodyAccel; // m/s^2
139 double mMaxRollRate; // radians/s
140
141 double mVelPursuitGain;
142};
143
144#endif
WsfSpatialDomain
A collection of enumerations and type definitions that are used across a number of components.
Definition WsfTypes.hpp:32
@ WSF_SPATIAL_DOMAIN_AIR
Cars, trucks, buildings, etc.
Definition WsfTypes.hpp:35
#define WSF_EXPORT
Definition WsfXIO_Export.hpp:35
Definition WsfFollower.hpp:36
void OutputVec3d(std::string &aLabel, double aVec[])
~WsfFollower() override=default
bool IsInitialized() const
Definition WsfFollower.hpp:52
void DontFollowThis()
Definition WsfFollower.hpp:72
WsfFollower & operator=(const WsfFollower &)=delete
void SetHeading(double aHeading) override
Definition WsfFollower.hpp:59
WsfSpatialDomain GetSpatialDomain() const override
Definition WsfFollower.hpp:50
void FollowThis(double aTimeStamp, double aLocationWCS[3], double aVelocityWCS[3])
Definition WsfFollower.cpp:301
void OutputDiagnostic(double aSimTime, WsfPlatform *aPlatformPtr)
Used to output data when debugging.
void SetSpeed(double aSpeed)
Definition WsfFollower.hpp:58
WsfFollower()=delete
bool GetTargetIsValid()
Returns true if the target information is valid.
Definition WsfFollower.hpp:63
bool ProcessInput(UtInput &aInput) override
Definition WsfMover.cpp:138
bool Initialize(double aSimTime) override
Definition WsfMover.cpp:108
WsfMover * Clone() const override=0
WsfMover()=delete
void Update(double aSimTime) override
Definition WsfMover.cpp:310
Platforms represent a entity within the simulation.
Definition WsfPlatform.hpp:115
Contains the data required to create a simulation, and acts as the entry point for input file process...
Definition WsfScenario.hpp:111
Copyrights Multiple, All Rights Reserved