WSF
WsfPointMassSixDOF_PilotManager.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 WSFPOINTMASSSIXDOFPILOTMANAGER_HPP
13#define WSFPOINTMASSSIXDOFPILOTMANAGER_HPP
14
21
22namespace wsf
23{
24namespace six_dof
25{
26class PointMassMover;
27
28// The PointMassPilotManager manages the PointMassSixDOF_PilotObjects on a vehicle.
29// Note that it does *not* include an Update function.
30class WSF_SIX_DOF_EXPORT PointMassPilotManager : public PilotManager
31{
32public:
35
37
39
40 bool ProcessInput(UtInput& aInput);
41
42 // This will initialize all pilot objects
43 bool Initialize(int64_t aSimTime_nanosec) override;
44
45 void SetLastSimTime(int64_t aLastSimTime_nanosec) override;
46
47 virtual void SetParentVehicle(PointMassMover* aParentVehicle);
48
49 // This returns the active pilot object
50 PilotObject* GetActivePilot() override;
51
53
54 // If a manual pilot is the active pilot, it will be returned.
55 // Otherwise, this function will return null.
56 PilotObject* GetActiveSimpleManualPilot() override;
57
58 // If a manual pilot is the active pilot, it will be returned.
59 // Otherwise, this function will return null.
60 PilotObject* GetActiveAugmentedManualPilot() override;
61
62 // If a synthetic pilot is the active pilot, it will be returned.
63 // Otherwise, this function will return null.
64 PilotObject* GetActiveSyntheticPilot() override;
65
66 // This is called each time step by PointMassSixDOF_Vehicle. The PilotObjects pass these
67 // values to their autopilot, where values can be integrated to determine
68 // deltaRoll, for example.
69 void InputAngleDeltasToPilotObjects(const double& aYaw_rad, const double& aPitch_rad, const double& aRoll_rad) override;
70
71 // This enables/disables controls for all pilot objects. When controls are
72 // disabled, all control inputs are set to zero.
73 void EnableControls(bool aEnabled) override;
74
75 // This returns the controls enabled/disabled state of the active pilot object.
76 bool AreControlsEnabled() const override;
77
78 // This makes the manual pilot the active pilot. Returns true if succeeds.
79 bool MakeSimpleManualPilotActive() override;
80
81 // This makes the manual pilot the active pilot. Returns true if succeeds.
82 bool MakeAugmentedManualPilotActive() override;
83
84 // This makes the synthetic pilot the active pilot. Returns true if succeeds.
85 bool MakeSyntheticPilotActive() override;
86
87 // This function is called by Mover when the vehicle is destroyed in
88 // flight. The aPitchInputModifier and aRollInputModifier arguments vary between
89 // +/-1 and control the pitch and roll control when destroyed.
90 void SetDestroyed(double aPitchInputModifier, double aRollInputModifier) override;
91
92 // This provides a reference to the special common controller, which is used to access
93 // the functions such as GetAlphaVsMachCL(), GetStickForZeroMomentVsMachAlpha(),
94 // and GetEffectiveCLVsMachAlpha() which are used in testing.
96
101
102protected:
104
105 UtCloneablePtr<PointMassManualPilotSimpleControls> mManualPilotSimpleControls{nullptr};
106 UtCloneablePtr<PointMassManualPilotAugmentedControls> mManualPilotAugmentedControls{nullptr};
107 UtCloneablePtr<PointMassSyntheticPilot> mSyntheticPilot{nullptr};
108
110
111 UtCloneablePtr<PointMassCommonController> mSpecialCommonController{nullptr};
112
113 bool mIsDestroyed = false;
114};
115} // namespace six_dof
116} // namespace wsf
117
118#endif
Definition WsfSixDOF_CommonController.hpp:38
Definition WsfSixDOF_PilotObject.hpp:39
Definition WsfPointMassSixDOF_CommonController.hpp:26
Definition WsfPointMassSixDOF_Mover.hpp:33
Definition WsfPointMassSixDOF_PilotManager.hpp:31
const CommonController * GetSpecialCommonController() const override
Definition WsfPointMassSixDOF_PilotManager.hpp:95
const PointMassCommonController * GetSpecialPointMassCommonController() const
Definition WsfPointMassSixDOF_PilotManager.hpp:97
UtCloneablePtr< PointMassSyntheticPilot > mSyntheticPilot
Definition WsfPointMassSixDOF_PilotManager.hpp:107
virtual void SetParentVehicle(PointMassMover *aParentVehicle)
Definition WsfPointMassSixDOF_PilotManager.cpp:346
bool Initialize(int64_t aSimTime_nanosec) override
Definition WsfPointMassSixDOF_PilotManager.cpp:299
bool mIsDestroyed
Definition WsfPointMassSixDOF_PilotManager.hpp:113
PilotObject * GetActivePilot() override
Definition WsfPointMassSixDOF_PilotManager.cpp:364
UtCloneablePtr< PointMassManualPilotSimpleControls > mManualPilotSimpleControls
Definition WsfPointMassSixDOF_PilotManager.hpp:105
PointMassPilotObject * mActivePilot
Definition WsfPointMassSixDOF_PilotManager.hpp:109
PointMassPilotObject * GetActivePointMassPilot()
Definition WsfPointMassSixDOF_PilotManager.hpp:52
PointMassPilotManager * Clone() const
Definition WsfPointMassSixDOF_PilotManager.cpp:43
PointMassPilotManager & operator=(const PointMassPilotManager &other)=delete
UtCloneablePtr< PointMassManualPilotAugmentedControls > mManualPilotAugmentedControls
Definition WsfPointMassSixDOF_PilotManager.hpp:106
UtCloneablePtr< PointMassCommonController > mSpecialCommonController
Definition WsfPointMassSixDOF_PilotManager.hpp:111
void SetLastSimTime(int64_t aLastSimTime_nanosec) override
Definition WsfPointMassSixDOF_PilotManager.cpp:328
bool ProcessInput(UtInput &aInput)
Definition WsfPointMassSixDOF_PilotManager.cpp:48
Definition WsfPointMassSixDOF_PilotObject.hpp:25
Definition WsfSA_Processor.hpp:35
Function definitions for those who need run-time access to the version.
Definition WsfComm.cpp:32
Copyrights Multiple, All Rights Reserved