WSF
WsfSixDOF_CommonController.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 2020 Infoscitex, a DCS 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#ifndef WSFSIXDOFCOMMONCONTROLLER_HPP
13#define WSFSIXDOFCOMMONCONTROLLER_HPP
14
15#include "wsf_six_dof_export.h"
16
17#include <vector>
18
19#include "UtCloneablePtr.hpp"
20class UtInput;
21class UtInputBlock;
22#include "UtLLAPos.hpp"
23#include "UtTable.hpp"
24#include "UtVec3dX.hpp"
25#include "WsfSixDOF_PID.hpp"
26#include "WsfSixDOF_Utils.hpp"
28
29namespace wsf
30{
31namespace six_dof
32{
33class AutopilotAction;
34class Environment;
35class Mover;
36
37class WSF_SIX_DOF_EXPORT CommonController
38{
39public:
41 {
42 double stickBack = 0.0;
43 double stickRight = 0.0;
44 double rudderRight = 0.0;
45 double throttleMilitary = 0.0;
46 double throttleAfterburner = 0.0;
47 double thrustVectorYaw = 0.0;
48 double thrustVectorPitch = 0.0;
49 double thrustVectorRoll = 0.0;
50 double speedBrake = 0.0;
51 double noseWheelSteering = 0.0;
52 double nwsSteering = 0.0;
53 double wheelBrakeLeft = 0.0;
54 double wheelBrakeRight = 0.0;
55 };
56
63
65 {
66 double turnLeadDist_m = 0.0;
67 double aimHeading_rad = 0.0;
68 double rangeTrack_m = 0.0;
69 double rangeRate_mps = 0.0;
70 double deltaAlt_m = 0.0;
71 double vertSpeed_mps = 0.0;
72 double commandedBank_rad = 0.0;
73 bool executeTurn = false;
74 };
75
77 {
78 // PID Middle Loop Timing -- These indicate how many times the inner loop processes before the middle loop
79 // processes (typically 10, but could be 5-20)
80 ut::optional<int> middleLoopFactor;
81
82 // PID Outer Loop Timing -- These indicate how many times the middle loop processes before the outer loop
83 // processes (typically 5-10, but could be 2-20)
84 ut::optional<int> outerLoopFactor;
85
87 {
88 int tickCount = middleLoopFactor.value_or(1);
89 return tickCount * utils::cDT_RIGID_BODY_SEC;
90 }
91
93 {
94 int middleLoopTickCount = middleLoopFactor.value_or(1);
95 int outerLoopTickCount = outerLoopFactor.value_or(1);
96 int tickCount = middleLoopTickCount * outerLoopTickCount;
97 return tickCount * utils::cDT_RIGID_BODY_SEC;
98 }
99 };
100
101 CommonController() = default;
102 virtual ~CommonController() = default;
103
105
106 virtual void SetParentVehicle(Mover* aVehicle) = 0;
107
108 virtual void Update(sAutopilotControls& aControls, int64_t aDT_nanosec) = 0;
109
110 // This is called each time step by CommonController. These
111 // values can be integrated to determine deltaRoll, for example.
112 void AngleDeltas(double aYaw_rad, double aPitch_rad, double aRoll_rad);
113
114 // This is used to reset the integrated yaw angle for delta yaw commands
116
117 // This is used to reset the integrated pitch angle for delta yaw commands
119
120 // This is used to reset the integrated roll angle for delta yaw commands
122
123 // This is used to reset the integrated yaw and roll angles for delta yaw and roll commands
124 void ResetLateralDeltaAngles();
125
126 // This is used to reset the integrated yaw, pitch, and roll angles for delta yaw, pitch, and roll commands
127 void ResetAllDeltaAngles();
128
129 // This is used to reset accumulated PID data between evaluations
130 void ResetAccumulatedPidData();
131
132 // This is used to reset PID data related to sim-time only
133 void ResetAllPidTimings();
134
135 // Returns true when the current waypoint has been achieved
136 bool GetWaypointAchieved() const { return mAchievedWaypoint; }
137
138 // This provides a vector of all PID gain data
139 std::vector<PidGainData>* GetAutopilotPidGainData(Pid::Type aTableType);
140
141 // Gets PID data from the specified AutopilotPidGroupValueData
142 void GetAutopilotPidValues(AutopilotPidGroupValueData* aData);
143
144 // Get PID data based on PID type. Returns true if data is valid.
145 bool GetAutopilotPidGainData(Pid::Type aTableType, size_t& aNumElements, PidGainData aPidGainData[]);
146
147 void SetPidGainData(Pid::Type aPidType, int aNumElements, PidGainData aPidGainData[]);
148
149 bool AddNewPidGainElement(Pid::Type aTableType, PidGainData& aPidGainData);
150
151 void SetControlAugmentationModeActive(bool aControlAugmentationIsActive)
152 {
153 mControlAugmentationModeActive = aControlAugmentationIsActive;
154 }
156
157 void SetPitchStabilityAugmentationModeActive(bool aPitchStabilityAugmentationIsActive)
158 {
159 mPitchStabilityAugmentationModeActive = aPitchStabilityAugmentationIsActive;
160 }
161 void SetYawStabilityAugmentationModeActive(bool aYawStabilityAugmentationIsActive)
162 {
163 mYawStabilityAugmentationModeActive = aYawStabilityAugmentationIsActive;
164 }
165 void SetRollStabilityAugmentationModeActive(bool aRollStabilityAugmentationIsActive)
166 {
167 mRollStabilityAugmentationModeActive = aRollStabilityAugmentationIsActive;
168 }
172
173 // This provides the CLMax as a function of Mach. Returns true if data is valid.
174 bool GetCLMaxMach(double aMach, double& aCLMax) const;
175
176 // This provides the CLMin as a function of Mach. Returns true if data is valid.
177 bool GetCLMinMach(double aMach, double& aCLMin) const;
178
179 // This provides the AlphaMax as a function of Mach. Returns true if data is valid.
180 bool GetAlphaMaxMach(double aMach, double& aAlphaMax_deg) const;
181
182 // This provides the AlphaMin as a function of Mach. Returns true if data is valid.
183 bool GetAlphaMinMach(double aMach, double& aAlphaMin_deg) const;
184
185 // The autopilot uses a AutopilotAction pointer that points to memory that
186 // is created and managed/deleted externally.
188
189 // The autopilot uses a AutopilotAction pointer that points to memory that
190 // is created and managed/deleted externally.
191 void SetCurrentActivity(AutopilotAction* aAPActivity);
192
193 void GetAutoPilotTurnData(double& aAimHeading_rad,
194 double& aStartTurnHdg_rad,
195 double& aTurnRadius_m,
196 double& aTurnAngle_rad,
197 double& aTurnRefPtLat,
198 double& aTurnRefPtLon,
199 bool& aTurnCW,
200 bool& aTurning,
201 double& aTurnCenterLat,
202 double& aTurnCenterLon);
203
204 // This returns the type of control being used, such as variants of BankToTurn or YawToTurn
206
207 // This returns the current autopilot limits and settings
209
210 // This sets the autopilot limits and settings
211 void SetCurrentLimitsAndSettings(const AutopilotLimitsAndSettings& aData);
212
214
215 void SetCurrentMinPitchGLimit(double aMinPitchGLimit);
216 void SetCurrentMaxPitchGLimit(double aMaxPitchGLimit);
217 void SetCurrentMinAlphaLimit(double aMinAlphaLimit);
218 void SetCurrentMaxAlphaLimit(double aMaxAlphaLimit);
219 void SetCurrentMinPitchRateLimit(double aMinPitchRateLimit);
220 void SetCurrentMaxPitchRateLimit(double aMaxPitchRateLimit);
221 void SetCurrentMinVertSpeedLimit(double aMinVertSpeedLimit);
222 void SetCurrentMaxVertSpeedLimit(double aMaxVertSpeedLimit);
223 void SetCurrentMaxYawGLimit(double aMaxYawGLimit);
224 void SetCurrentMaxBetaLimit(double aMaxBetaLimit);
225 void SetCurrentMaxYawRateLimit(double aMaxYawRateLimit);
226 void SetCurrentMaxRollRateLimit(double aMaxRollRateLimit);
227 void SetCurrentMaxBankAngleLimit(double aMaxBankAngleLimit);
228 void SetCurrentMinForwardAccelLimit(double aMinForwardAccelLimit);
229 void SetCurrentMaxForwardAccelLimit(double aMaxForwardAccelLimit);
230 void SetCurrentMaxTaxiSpeedLimit(double aMaxTaxiSpeedLimit);
231 void SetCurrentMaxTaxiYawRateLimit(double aMaxTaxiYawRateLimit);
232
233 double GetDefaultTurnRollInMultiplier(); // Returns the default turn roll-in multiplier for autopilot turns when
234 // following waypoints
235 double GetDefaultRouteAllowableAngleError_rad(); // Returns the default allowable angle error when flying routes
236
237 // Sets the current allowable angle error when flying routes
238 void SetRouteAllowableAngleError_rad(double aValue_rad);
239
240 // Sets the current turn roll-in multiplier for autopilot turns when following waypoints
241 void SetCurrentTurnRollInMultiplier(double aValue);
242
243 // Afterburner use is enabled by default, but can be enabled/disabled
244 void SetAfterburnerEnabled(bool aEnabled);
245
246 // Afterburner will be used (if enabled) if command exceeds the threshold value
247 void SetAfterburnerThreshold(double aValue = 1.0);
248
249 // Speed brake use is enabled by default, but can be enabled/disabled
250 void SetSpeedBrakeEnabled(bool aEnabled);
251
252 // Speed brake will be used (if enabled) if command is less than the threshold value
253 void SetSpeedBrakeThreshold(double aValue = 0.0);
254
255 bool SetPidGainKP(Pid::Type aTableType, float aControllingValue, float aGainValue);
256 bool SetPidGainKI(Pid::Type aTableType, float aControllingValue, float aGainValue);
257 bool SetPidGainKD(Pid::Type aTableType, float aControllingValue, float aGainValue);
258 bool SetPidAlpha(Pid::Type aTableType, float aControllingValue, float aAlphaValue);
259 bool SetPidMaxAccum(Pid::Type aTableType, float aControllingValue, float aMaxAccumValue);
260
261 virtual PID* GetPID_ByType(Pid::Type aTableType) = 0;
262
263 // This provides the effective CL at the specified mach and alpha. Returns true if data is valid.
264 bool GetEffectiveCLVsMachAlpha(double aMach, double aAlpha_rad, double& aCL) const;
265
266 // This provides the alpha (in degrees) for the specified mach and CL.
267 // It is helpful for determining the alpha for a desired g-load at a specified Mach.
268 // Returns true if data is valid.
269 bool GetAlphaVsMachCL(double aMach, double aCL, double& aAlpha_deg) const;
270
271protected:
272 CommonController(const CommonController& aSrc) = default;
273
274 virtual Mover* GetParentVehicle() = 0;
275
276 void ProcessInput(UtInput& aInput);
277
278 virtual void ProcessInputCommand(UtInput& aInput, const std::string& aCommand) = 0;
279
280 bool ProcessCommonInputCommand(UtInput& aInput, const std::string& aCommand);
281
282 void ProcessPidGroupInputBlock(UtInputBlock& aInputBlock, UtInput& aInput);
283
284 void ProcessLimitsAndSettingsInputBlock(UtInputBlock& aInputBlock);
285
286 // This is the autopilot update function for bank-to-turn vehicles
287 void UpdateBankToTurn(sAutopilotControls& aControls, double aSimTime);
288 virtual void ProcessLaternalNavChannelsBankToTurn(double aSimTime) = 0;
289 virtual void ProcessVerticalNavChannelBankToTurn(double aSimTime) = 0;
290 virtual void ProcessSpeedChannelBankToTurn(double aSimTime) = 0;
291
292 // This is the autopilot update function for yaw-to-turn vehicles
293 void UpdateYawToTurn(sAutopilotControls& aControls, double aSimTime);
294 virtual void ProcessLaternalNavChannelsYawToTurn(double aSimTime) = 0;
295 virtual void ProcessVerticalNavChannelYawToTurn(double aSimTime) = 0;
296 virtual void ProcessSpeedChannelYawToTurn(double aSimTime) = 0;
297
298 // Lateral modes ------------------------------------------------------------------
299
300 virtual void ProcessLateralNavMode_Bank(double aSimTime);
301 virtual void ProcessLateralNavMode_DeltaRoll(double aSimTime);
302 virtual void ProcessLateralNavMode_RollRate(double aSimTime);
303 virtual void ProcessLateralNavMode_YawWaypoint(double aSimTime);
304 virtual void ProcessLateralNavMode_YawPoint(double aSimTime);
305 virtual void ProcessLateralNavMode_YawHeading(double aSimTime);
306 virtual void ProcessLateralNavMode_YawRate(double aSimTime);
307 virtual void ProcessLateralNavMode_NoControl();
310
311 virtual void ProcessLateralNavMode_RollWaypoint(double aSimTime);
312 virtual void ProcessLateralNavMode_RollPoint(double aSimTime);
313 virtual void ProcessLateralNavMode_RollHeading(double aSimTime);
314
315 virtual void CalcLateralNavMode_RollHeadingCore(double aHeading_deg, double aMaxBankAngle_rad, double aSimTime);
316 virtual void ProcessStandardLateralNavMode_Bank(double aBankAngle_deg, double aSimTime);
317
318 virtual void ProcessStandardLateralNavMode_RollHeading(double aHeading_deg, double aSimTime);
319 virtual void ProcessStandardLateralNavMode_WaypointRollHeading(double aHeading_deg, double aSimTime);
320 virtual void ProcessStandardLateralNavMode_RollRate(double aCommandedRollRate_dps, double aSimTime);
321
322 virtual void ProcessLateralNavMode_Beta(double aSimTime);
323 virtual void ProcessLateralNavMode_YawGLoad(double aSimTime);
324
325 virtual void ProcessStandardLateralNavMode_YawHeading(double aHeading_deg, double aSimTime);
326 virtual void ProcessStandardLateralNavMode_YawRate(double aCommandedYawRate_dps, double aSimTime);
327 virtual void ProcessStandardLateralNavMode_Beta(double aCommandedBeta_deg, double aSimTime);
328
329 // Vertical modes -----------------------------------------------------------------
330
331 virtual void ProcessVerticalNavMode_Waypoint(double aSimTime);
332 virtual void ProcessVerticalNavMode_Altitude(double aSimTime);
333 virtual void ProcessVerticalNavMode_VertSpeed(double aSimTime);
334 virtual void ProcessVerticalNavMode_PitchGLoad(double aSimTime);
335 virtual void ProcessVerticalNavMode_PitchAng(double aSimTime);
336 virtual void ProcessVerticalNavMode_PitchRate(double aSimTime);
337 virtual void ProcessVerticalNavMode_FltPathAng(double aSimTime);
338 virtual void ProcessVerticalNavMode_DeltaPitch(double aSimTime);
339 virtual void ProcessVerticalNavMode_Point(double aSimTime); // (Not yet implemented) TODO
340 virtual void ProcessVerticalNavMode_NoControl(double aSimTime);
341 virtual void ProcessVerticalNavMode_Alpha(double aSimTime);
342
343 virtual void ProcessStandardVerticalNavMode_Altitude(double aAltitude_ft, double aSimTime);
344 virtual void ProcessStandardVerticalNavMode_VertSpeed(double aCommandedVertSpeed_fpm, double aSimTime);
345 virtual void ProcessStandardVerticalNavMode_PitchRate(double aCommandedPitchRate_dps, double aSimTime);
346 virtual void ProcessStandardVerticalNavMode_Alpha(double aCommandedAlpha_deg, double aSimTime);
347
348 // Speed modes --------------------------------------------------------------------
349
350 virtual double ProcessSpeedMode_Waypoint(double aSimTime);
351 virtual double ProcessSpeedMode_ForwardAccel(double aSimTime);
352 virtual double ProcessSpeedMode_KIAS(double aSimTime);
353 virtual double ProcessSpeedMode_KTAS(double aSimTime);
354 virtual double ProcessSpeedMode_Mach(double aSimTime);
355 virtual double ProcessSpeedMode_FPS(double aSimTime);
356 virtual double ProcessSpeedMode_Throttle(double aSimTime);
357 virtual double ProcessSpeedMode_NoControl();
358 virtual double ProcessStandardSpeedMode_FPS(double aSpeed_fps, double aSimTime);
359 virtual double ProcessStandardForwardAccel(double aForwardAccel_g, double aSimTime);
360 virtual double ProcessStandardSpeedMode_Throttle(double aThrottle, double aSimTime);
361
362 // This is used (internally) to calculate g-limits for both yaw and pitch using
363 // alpha/beta limits as well as the baseline g-limits
365
366 // This calculates the current g-bias in terms of g-load and alpha, considering
367 // the current pitch and roll angles.
368 void CalcGBiasData(double& aGBias_g, double& aGBiasAlpha_deg);
369
370 // This returns the current target heading (deg) when using waypoints
371 double GetAimHeadingForWaypointNav_deg(double aSimTime);
372
373 // This returns the current target heading (deg) to the current point
375
376 // These functions are use for calculating taxi turn radius and turn rates (yaw rates)
377 double CalcTurnRateBasedOnTurnRadiusAndCurrentSpeed_dps(double aTurnRadius_ft);
378 double CalcTurnRadiusBasedOnTurnRateAndCurrentSpeed_ft(double aTurnRate_dps);
379
381
382 void EnforceSingleControlLimit(double& aValue, const double& aMinValue, const double& aMaxValue);
383
385
386 NestedFeedbackLoop mVerticalControlLoop; // Used for initialization of PIDs
387 NestedFeedbackLoop mLateralControlLoop; // Used for initialization of PIDs
388 NestedFeedbackLoop mSpeedControlLoop; // Used for initialization of PIDs
389
391
392 // This is the output controls from the autopilot
394
397
398 // The Autopilot uses a AutopilotAction pointer that points to memory that
399 // is created and managed/deleted externally. This is the command to the autopilot.
401
402 // This is the control method used by the vehicle/autopilot
404
405 bool mTurning = false;
406 bool mAchievedWaypoint = false;
407
408 double mStartTurnHdg_rad = 0.0;
409 double mTurnRadius_m = 0.0;
410 double mTurnAngle_rad = 0.0;
411 bool mTurnCW = true;
413
414 double mAimHeading_rad = 0.0;
415 double mTurnCenterLat = 0.0;
416 double mTurnCenterLon = 0.0;
417
422
431
452
453 double mLimitedBeta_deg = 0.0;
456
460
465
466 double mCurrentGBias_g = 1.0;
468
469 UtCloneablePtr<UtTable::Curve> mCLMaxMachTablePtr{nullptr};
470 UtCloneablePtr<UtTable::Curve> mCLMinMachTablePtr{nullptr};
471 UtCloneablePtr<UtTable::Curve> mAlphaMaxMachTablePtr{nullptr};
472 UtCloneablePtr<UtTable::Curve> mAlphaMinMachTablePtr{nullptr};
473
474 UtCloneablePtr<UtTable::Table> mEffectiveCLVsMachAlphaTablePtr{nullptr};
475 UtCloneablePtr<UtTable::Table> mAlphaVsMachCLTablePtr{nullptr};
476
477 const Environment* mEnvironment = nullptr;
478};
479} // namespace six_dof
480} // namespace wsf
481
482#endif // COMMONAIRCOMMONCONTROLLER_H
Definition WsfSixDOF_AutopilotAction.hpp:26
virtual void ProcessStandardVerticalNavMode_Altitude(double aAltitude_ft, double aSimTime)
Definition WsfSixDOF_CommonController.cpp:1335
virtual void ProcessVerticalNavChannelBankToTurn(double aSimTime)=0
double mLastCommandedForwardAccel_g
Definition WsfSixDOF_CommonController.hpp:430
virtual void ProcessLateralNavMode_NoControl()
Definition WsfSixDOF_CommonController.cpp:1242
PID mDeltaPitchPID
Definition WsfSixDOF_CommonController.hpp:437
virtual void ProcessStandardVerticalNavMode_Alpha(double aCommandedAlpha_deg, double aSimTime)
Definition WsfSixDOF_CommonController.cpp:1486
double mExternalFlapsControlValue
Definition WsfSixDOF_CommonController.hpp:418
double mLastCommandedVertRate_fpm
Definition WsfSixDOF_CommonController.hpp:423
void CalcGBiasData(double &aGBias_g, double &aGBiasAlpha_deg)
Definition WsfSixDOF_CommonController.cpp:1357
virtual void ProcessInputCommand(UtInput &aInput, const std::string &aCommand)=0
virtual void ProcessLateralNavMode_NoYawControl()
Definition WsfSixDOF_CommonController.cpp:1248
virtual void ProcessVerticalNavMode_DeltaPitch(double aSimTime)
Definition WsfSixDOF_CommonController.cpp:1589
virtual void ProcessLateralNavMode_YawWaypoint(double aSimTime)
Definition WsfSixDOF_CommonController.cpp:1172
virtual void ProcessLaternalNavChannelsBankToTurn(double aSimTime)=0
void SetRollStabilityAugmentationModeActive(bool aRollStabilityAugmentationIsActive)
Definition WsfSixDOF_CommonController.hpp:165
virtual double ProcessSpeedMode_FPS(double aSimTime)
Definition WsfSixDOF_CommonController.cpp:1856
virtual void ProcessVerticalNavMode_PitchAng(double aSimTime)
Definition WsfSixDOF_CommonController.cpp:1514
PID mPitchAnglePID
Definition WsfSixDOF_CommonController.hpp:434
virtual double ProcessSpeedMode_Waypoint(double aSimTime)
Definition WsfSixDOF_CommonController.cpp:1625
void RevertLimitsAndSettingsToDefaults()
Definition WsfSixDOF_CommonController.hpp:213
virtual void ProcessLateralNavMode_YawGLoad(double aSimTime)
Definition WsfSixDOF_CommonController.cpp:837
AutopilotLimitsAndSettings mCurrentLimitsAndSettings
Definition WsfSixDOF_CommonController.hpp:396
double mLimitedMaxAlpha_deg
Definition WsfSixDOF_CommonController.hpp:455
double mLastCommandedSpeed_fps
Definition WsfSixDOF_CommonController.hpp:429
virtual void ProcessStandardLateralNavMode_WaypointRollHeading(double aHeading_deg, double aSimTime)
Definition WsfSixDOF_CommonController.cpp:799
NestedFeedbackLoop mSpeedControlLoop
Definition WsfSixDOF_CommonController.hpp:388
CommonController(const CommonController &aSrc)=default
PID mTaxiForwardAccelPID
Definition WsfSixDOF_CommonController.hpp:449
double GetAimHeadingForPoint_deg()
Definition WsfSixDOF_CommonController.cpp:566
sAutopilotControls mControlOutputs
Definition WsfSixDOF_CommonController.hpp:393
virtual void ProcessStandardVerticalNavMode_VertSpeed(double aCommandedVertSpeed_fpm, double aSimTime)
Definition WsfSixDOF_CommonController.cpp:1396
AutopilotLimitsAndSettings mDefaultLimitsAndSettings
Definition WsfSixDOF_CommonController.hpp:395
PID mPitchRatePID
Definition WsfSixDOF_CommonController.hpp:435
UtCloneablePtr< UtTable::Curve > mAlphaMaxMachTablePtr
Definition WsfSixDOF_CommonController.hpp:471
virtual void ProcessVerticalNavMode_PitchRate(double aSimTime)
Definition WsfSixDOF_CommonController.cpp:1549
double mLastComandedBankAngle_deg
Definition WsfSixDOF_CommonController.hpp:427
double CalcTurnRateBasedOnTurnRadiusAndCurrentSpeed_dps(double aTurnRadius_ft)
Definition WsfSixDOF_CommonController.cpp:578
PID mAltitudePID
Definition WsfSixDOF_CommonController.hpp:438
eAutopilotTurnDir
Definition WsfSixDOF_CommonController.hpp:58
@ TD_LEFT
Definition WsfSixDOF_CommonController.hpp:60
@ TD_RIGHT
Definition WsfSixDOF_CommonController.hpp:61
@ TD_DEFAULT
Definition WsfSixDOF_CommonController.hpp:59
void UpdateYawToTurn(sAutopilotControls &aControls, double aSimTime)
Definition WsfSixDOF_CommonController.cpp:446
bool ControlAugmentationModeIsActive()
Definition WsfSixDOF_CommonController.hpp:155
virtual double ProcessSpeedMode_Throttle(double aSimTime)
Definition WsfSixDOF_CommonController.cpp:1863
bool RollStabilityAugmentationModeIsActive()
Definition WsfSixDOF_CommonController.hpp:171
virtual void ProcessVerticalNavMode_PitchGLoad(double aSimTime)
Definition WsfSixDOF_CommonController.cpp:1320
virtual void ProcessLateralNavMode_RollHeading(double aSimTime)
Definition WsfSixDOF_CommonController.cpp:783
Control::Method mControlMethod
Definition WsfSixDOF_CommonController.hpp:403
double mExternalSpoilersControlValue
Definition WsfSixDOF_CommonController.hpp:419
UtCloneablePtr< UtTable::Table > mEffectiveCLVsMachAlphaTablePtr
Definition WsfSixDOF_CommonController.hpp:474
bool mAchievedWaypoint
Definition WsfSixDOF_CommonController.hpp:406
const Environment * mEnvironment
Definition WsfSixDOF_CommonController.hpp:477
bool mRollStabilityAugmentationModeActive
Definition WsfSixDOF_CommonController.hpp:464
PID mDeltaRollPID
Definition WsfSixDOF_CommonController.hpp:444
bool mYawStabilityAugmentationModeActive
Definition WsfSixDOF_CommonController.hpp:462
virtual void ProcessLateralNavMode_RollRate(double aSimTime)
Definition WsfSixDOF_CommonController.cpp:1206
virtual ~CommonController()=default
bool mPitchStabilityAugmentationModeActive
Definition WsfSixDOF_CommonController.hpp:463
virtual void ProcessSpeedChannelBankToTurn(double aSimTime)=0
virtual void ProcessLateralNavMode_RollPoint(double aSimTime)
Definition WsfSixDOF_CommonController.cpp:774
double mLastCommandedAlpha_deg
Definition WsfSixDOF_CommonController.hpp:424
PID mVerticalSpeedPID
Definition WsfSixDOF_CommonController.hpp:433
virtual double ProcessSpeedMode_ForwardAccel(double aSimTime)
Definition WsfSixDOF_CommonController.cpp:1685
virtual void ProcessLateralNavMode_YawPoint(double aSimTime)
Definition WsfSixDOF_CommonController.cpp:1181
virtual void ProcessStandardVerticalNavMode_PitchRate(double aCommandedPitchRate_dps, double aSimTime)
Definition WsfSixDOF_CommonController.cpp:1433
double mCurrentGBiasAlpha_deg
Definition WsfSixDOF_CommonController.hpp:467
virtual void ProcessLateralNavMode_RollWaypoint(double aSimTime)
Definition WsfSixDOF_CommonController.cpp:765
virtual void ProcessLateralNavMode_NoRollControl()
Definition WsfSixDOF_CommonController.cpp:1253
Control::Method GetControlMethod()
Definition WsfSixDOF_CommonController.hpp:205
bool mControlAugmentationModeActive
Definition WsfSixDOF_CommonController.hpp:461
void ProcessInput(UtInput &aInput)
Definition WsfSixDOF_CommonController.cpp:25
double mLimitedMinAlpha_deg
Definition WsfSixDOF_CommonController.hpp:454
void ProcessPidGroupInputBlock(UtInputBlock &aInputBlock, UtInput &aInput)
Definition WsfSixDOF_CommonController.cpp:134
double mTurnCenterLat
Definition WsfSixDOF_CommonController.hpp:415
bool GetWaypointAchieved() const
Definition WsfSixDOF_CommonController.hpp:136
PID mBetaPID
Definition WsfSixDOF_CommonController.hpp:439
double mTurnAngle_rad
Definition WsfSixDOF_CommonController.hpp:410
bool PitchStabilityAugmentationModeIsActive()
Definition WsfSixDOF_CommonController.hpp:169
UtLLAPos mTurnRefPoint
Definition WsfSixDOF_CommonController.hpp:412
virtual void ProcessVerticalNavMode_Point(double aSimTime)
Definition WsfSixDOF_CommonController.cpp:1510
double mCurrentGBias_g
Definition WsfSixDOF_CommonController.hpp:466
virtual void ProcessVerticalNavChannelYawToTurn(double aSimTime)=0
double mExternalAfterburnerControlValue
Definition WsfSixDOF_CommonController.hpp:421
PID mFlightPathAnglePID
Definition WsfSixDOF_CommonController.hpp:436
virtual PID * GetPID_ByType(Pid::Type aTableType)=0
UtCloneablePtr< UtTable::Curve > mCLMinMachTablePtr
Definition WsfSixDOF_CommonController.hpp:470
int64_t mLastUpdateTime_nanosec
Definition WsfSixDOF_CommonController.hpp:384
virtual double ProcessSpeedMode_KIAS(double aSimTime)
Definition WsfSixDOF_CommonController.cpp:1815
void ResetDeltaPitchAngle()
Definition WsfSixDOF_CommonController.hpp:118
virtual void ProcessStandardLateralNavMode_Beta(double aCommandedBeta_deg, double aSimTime)
Definition WsfSixDOF_CommonController.cpp:1147
virtual void ProcessLateralNavMode_Bank(double aSimTime)
Definition WsfSixDOF_CommonController.cpp:1213
PID mYawHeadingPID
Definition WsfSixDOF_CommonController.hpp:441
double mLastCommandedBeta_deg
Definition WsfSixDOF_CommonController.hpp:426
virtual void ProcessLateralNavMode_YawRate(double aSimTime)
Definition WsfSixDOF_CommonController.cpp:1199
virtual void ProcessStandardLateralNavMode_Bank(double aBankAngle_deg, double aSimTime)
Definition WsfSixDOF_CommonController.cpp:1030
bool mTurnCW
Definition WsfSixDOF_CommonController.hpp:411
double mAimHeading_rad
Definition WsfSixDOF_CommonController.hpp:414
PID mTaxiYawRatePID
Definition WsfSixDOF_CommonController.hpp:451
double mTurnCenterLon
Definition WsfSixDOF_CommonController.hpp:416
UtCloneablePtr< UtTable::Table > mAlphaVsMachCLTablePtr
Definition WsfSixDOF_CommonController.hpp:475
double mIntegratedDeltaRoll_deg
Definition WsfSixDOF_CommonController.hpp:459
virtual double ProcessSpeedMode_NoControl()
Definition WsfSixDOF_CommonController.cpp:1870
NestedFeedbackLoop mLateralControlLoop
Definition WsfSixDOF_CommonController.hpp:387
AutopilotAction * mCurrentActivityPtr
Definition WsfSixDOF_CommonController.hpp:400
void SetPitchStabilityAugmentationModeActive(bool aPitchStabilityAugmentationIsActive)
Definition WsfSixDOF_CommonController.hpp:157
virtual void ProcessStandardLateralNavMode_YawHeading(double aHeading_deg, double aSimTime)
Definition WsfSixDOF_CommonController.cpp:1067
PID mBankAnglePID
Definition WsfSixDOF_CommonController.hpp:445
virtual void Update(sAutopilotControls &aControls, int64_t aDT_nanosec)=0
double mIntegratedDeltaPitch_deg
Definition WsfSixDOF_CommonController.hpp:458
virtual void ProcessStandardLateralNavMode_RollRate(double aCommandedRollRate_dps, double aSimTime)
Definition WsfSixDOF_CommonController.cpp:807
void ResetDeltaYawAngle()
Definition WsfSixDOF_CommonController.hpp:115
double mTurnRadius_m
Definition WsfSixDOF_CommonController.hpp:409
PID mYawRatePID
Definition WsfSixDOF_CommonController.hpp:440
const AutopilotLimitsAndSettings & GetCurrentLimitsAndSettings() const
Definition WsfSixDOF_CommonController.hpp:208
UtCloneablePtr< UtTable::Curve > mCLMaxMachTablePtr
Definition WsfSixDOF_CommonController.hpp:469
double mLastCommandedRollRate_dps
Definition WsfSixDOF_CommonController.hpp:428
virtual double ProcessStandardForwardAccel(double aForwardAccel_g, double aSimTime)
Definition WsfSixDOF_CommonController.cpp:1746
void SetControlAugmentationModeActive(bool aControlAugmentationIsActive)
Definition WsfSixDOF_CommonController.hpp:151
bool YawStabilityAugmentationModeIsActive()
Definition WsfSixDOF_CommonController.hpp:170
void AngleDeltas(double aYaw_rad, double aPitch_rad, double aRoll_rad)
Definition WsfSixDOF_CommonController.cpp:1965
bool GetEffectiveCLVsMachAlpha(double aMach, double aAlpha_rad, double &aCL) const
Definition WsfSixDOF_CommonController.cpp:2268
double GetAimHeadingForWaypointNav_deg(double aSimTime)
Definition WsfSixDOF_CommonController.cpp:465
void CalcAlphaBetaGLimits()
Definition WsfSixDOF_CommonController.cpp:1880
virtual void ProcessLaternalNavChannelsYawToTurn(double aSimTime)=0
NestedFeedbackLoop mVerticalControlLoop
Definition WsfSixDOF_CommonController.hpp:386
void EnforceSingleControlLimit(double &aValue, const double &aMinValue, const double &aMaxValue)
Definition WsfSixDOF_CommonController.cpp:647
virtual double ProcessSpeedMode_KTAS(double aSimTime)
Definition WsfSixDOF_CommonController.cpp:1829
PID mRollHeadingPID
Definition WsfSixDOF_CommonController.hpp:446
virtual double ProcessStandardSpeedMode_Throttle(double aThrottle, double aSimTime)
Definition WsfSixDOF_CommonController.cpp:1804
void SetYawStabilityAugmentationModeActive(bool aYawStabilityAugmentationIsActive)
Definition WsfSixDOF_CommonController.hpp:161
PID mTaxiSpeedPID
Definition WsfSixDOF_CommonController.hpp:450
PID mForwardAccelPID
Definition WsfSixDOF_CommonController.hpp:447
PID mRollRatePID
Definition WsfSixDOF_CommonController.hpp:443
virtual void ProcessVerticalNavMode_Alpha(double aSimTime)
Definition WsfSixDOF_CommonController.cpp:1614
WaypointNavData mNavData
Definition WsfSixDOF_CommonController.hpp:390
double mStartTurnHdg_rad
Definition WsfSixDOF_CommonController.hpp:408
virtual void ProcessStandardLateralNavMode_YawRate(double aCommandedYawRate_dps, double aSimTime)
Definition WsfSixDOF_CommonController.cpp:1091
bool GetAlphaVsMachCL(double aMach, double aCL, double &aAlpha_deg) const
Definition WsfSixDOF_CommonController.cpp:2282
PID mAlphaPID
Definition WsfSixDOF_CommonController.hpp:432
void ProcessLimitsAndSettingsInputBlock(UtInputBlock &aInputBlock)
Definition WsfSixDOF_CommonController.cpp:280
virtual void ProcessVerticalNavMode_NoControl(double aSimTime)
Definition WsfSixDOF_CommonController.cpp:1620
virtual double ProcessStandardSpeedMode_FPS(double aSpeed_fps, double aSimTime)
Definition WsfSixDOF_CommonController.cpp:1697
bool ProcessCommonInputCommand(UtInput &aInput, const std::string &aCommand)
Definition WsfSixDOF_CommonController.cpp:31
virtual void ProcessSpeedChannelYawToTurn(double aSimTime)=0
double mLastCommandedYawRate_dps
Definition WsfSixDOF_CommonController.hpp:425
void UpdateBankToTurn(sAutopilotControls &aControls, double aSimTime)
Definition WsfSixDOF_CommonController.cpp:426
virtual void ProcessLateralNavMode_Beta(double aSimTime)
Definition WsfSixDOF_CommonController.cpp:831
void ResetDeltaRollAngle()
Definition WsfSixDOF_CommonController.hpp:121
double CalcTurnRadiusBasedOnTurnRateAndCurrentSpeed_ft(double aTurnRate_dps)
Definition WsfSixDOF_CommonController.cpp:593
double mLimitedBeta_deg
Definition WsfSixDOF_CommonController.hpp:453
virtual void SetParentVehicle(Mover *aVehicle)=0
virtual void CalcLateralNavMode_RollHeadingCore(double aHeading_deg, double aMaxBankAngle_rad, double aSimTime)
Definition WsfSixDOF_CommonController.cpp:852
virtual void ProcessStandardLateralNavMode_RollHeading(double aHeading_deg, double aSimTime)
Definition WsfSixDOF_CommonController.cpp:792
CommonController & operator=(const CommonController &other)=delete
PID mTaxiHeadingPID
Definition WsfSixDOF_CommonController.hpp:442
double mIntegratedDeltaYaw_deg
Definition WsfSixDOF_CommonController.hpp:457
AutopilotAction * GetCurrentActivity() const
Definition WsfSixDOF_CommonController.hpp:187
bool mTurning
Definition WsfSixDOF_CommonController.hpp:405
virtual void ProcessLateralNavMode_YawHeading(double aSimTime)
Definition WsfSixDOF_CommonController.cpp:1190
virtual void ProcessVerticalNavMode_FltPathAng(double aSimTime)
Definition WsfSixDOF_CommonController.cpp:1554
virtual void ProcessVerticalNavMode_Altitude(double aSimTime)
Definition WsfSixDOF_CommonController.cpp:1308
virtual void ProcessVerticalNavMode_Waypoint(double aSimTime)
Definition WsfSixDOF_CommonController.cpp:1258
UtCloneablePtr< UtTable::Curve > mAlphaMinMachTablePtr
Definition WsfSixDOF_CommonController.hpp:472
virtual double ProcessSpeedMode_Mach(double aSimTime)
Definition WsfSixDOF_CommonController.cpp:1842
virtual Mover * GetParentVehicle()=0
virtual void ProcessLateralNavMode_DeltaRoll(double aSimTime)
Definition WsfSixDOF_CommonController.cpp:1220
virtual void ProcessVerticalNavMode_VertSpeed(double aSimTime)
Definition WsfSixDOF_CommonController.cpp:1314
void EnforceControlLimits()
Definition WsfSixDOF_CommonController.cpp:633
PID mSpeedPID
Definition WsfSixDOF_CommonController.hpp:448
double mExternalSpeedBrakesControlValue
Definition WsfSixDOF_CommonController.hpp:420
Definition WsfSixDOF_Environment.hpp:30
This is a base class for detailed air movers. This umbrella can cover RB6 or PM6 models.
Definition WsfSixDOF_Mover.hpp:58
Definition WsfSixDOF_PID.hpp:42
Method
Definition WsfSixDOF_VehicleData.hpp:247
@ Undefined
Definition WsfSixDOF_VehicleData.hpp:248
Type
Definition WsfSixDOF_VehicleData.hpp:112
static constexpr double cDT_RIGID_BODY_SEC
Definition WsfSixDOF_Utils.hpp:57
Definition WsfSA_Processor.hpp:35
Function definitions for those who need run-time access to the version.
Definition WsfComm.cpp:32
Definition WsfSixDOF_VehicleData.hpp:165
Definition WsfSixDOF_VehicleData.hpp:140
Definition WsfSixDOF_CommonController.hpp:77
double GetMiddleLoopInterval_sec()
Definition WsfSixDOF_CommonController.hpp:86
ut::optional< int > middleLoopFactor
Definition WsfSixDOF_CommonController.hpp:80
double GetOuterLoopInterval_sec()
Definition WsfSixDOF_CommonController.hpp:92
ut::optional< int > outerLoopFactor
Definition WsfSixDOF_CommonController.hpp:84
Definition WsfSixDOF_CommonController.hpp:65
double aimHeading_rad
Definition WsfSixDOF_CommonController.hpp:67
double turnLeadDist_m
Definition WsfSixDOF_CommonController.hpp:66
double commandedBank_rad
Definition WsfSixDOF_CommonController.hpp:72
double deltaAlt_m
Definition WsfSixDOF_CommonController.hpp:70
double rangeTrack_m
Definition WsfSixDOF_CommonController.hpp:68
double vertSpeed_mps
Definition WsfSixDOF_CommonController.hpp:71
double rangeRate_mps
Definition WsfSixDOF_CommonController.hpp:69
bool executeTurn
Definition WsfSixDOF_CommonController.hpp:73
Definition WsfSixDOF_CommonController.hpp:41
double speedBrake
Definition WsfSixDOF_CommonController.hpp:50
double wheelBrakeLeft
Definition WsfSixDOF_CommonController.hpp:53
double throttleAfterburner
Definition WsfSixDOF_CommonController.hpp:46
double thrustVectorYaw
Definition WsfSixDOF_CommonController.hpp:47
double thrustVectorRoll
Definition WsfSixDOF_CommonController.hpp:49
double rudderRight
Definition WsfSixDOF_CommonController.hpp:44
double stickRight
Definition WsfSixDOF_CommonController.hpp:43
double nwsSteering
Definition WsfSixDOF_CommonController.hpp:52
double thrustVectorPitch
Definition WsfSixDOF_CommonController.hpp:48
double throttleMilitary
Definition WsfSixDOF_CommonController.hpp:45
double stickBack
Definition WsfSixDOF_CommonController.hpp:42
double noseWheelSteering
Definition WsfSixDOF_CommonController.hpp:51
double wheelBrakeRight
Definition WsfSixDOF_CommonController.hpp:54
Definition WsfSixDOF_VehicleData.hpp:80
Copyrights Multiple, All Rights Reserved