WSF
P6DofPilotManager.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 2017 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 P6DOFPILOTMANAGER_H
13#define P6DOFPILOTMANAGER_H
14
15#include "p6dof_export.h"
16
17#include <cinttypes>
18#include <list>
19#include <string>
20#include <unordered_map>
21
30class P6DofScenario;
32class P6DofVehicle;
33class UtInput;
34
35// The P6DofPilotManager manages the P6DofPilotObjects on a vehicle.
36// Note that it does *not* include an Update function.
37class P6DOF_EXPORT P6DofPilotManager
38{
39public:
40 explicit P6DofPilotManager(P6DofScenario* aScenario);
41 virtual ~P6DofPilotManager();
42
44
45 P6DofPilotManager* Clone() const;
46
47 bool ProcessInput(UtInput& aInput);
48
49 // This will initialize all pilot objects
50 bool Initialize(int64_t aSimTime_nanosec);
51
52 void SetLastSimTime(int64_t aLastSimTime_nanosec);
53
54 virtual void SetParentVehicle(P6DofVehicle* aParentVehicle);
55
56 // This returns the active pilot object
58
59 // If a manual pilot is the active pilot, it will be returned.
60 // Otherwise, this function will return null.
62
63 // If a synthetic pilot is the active pilot, it will be returned.
64 // Otherwise, this function will return null.
66
67 // If a hardware autopilot is the active pilot, it will be returned.
68 // Otherwise, this function will return null.
70
71 // If a guidance autopilot is the active pilot, it will be returned.
72 // Otherwise, this function will return null.
74
75 // This is called each time step by P6DofVehicle. The PilotObjects pass these
76 // values to their autopilot, where values can be integrated to determine
77 // deltaRoll, for example.
78 void InputAngleDeltasToPilotObjects(const double& aYaw_rad, const double& aPitch_rad, const double& aRoll_rad);
79
80 // This enables/disables controls for all pilot objects. When controls are
81 // disabled, all control inputs are set to zero.
82 virtual void EnableControls(bool aEnabled);
83
84 // This returns the controls enabled/disabled state of the active pilot object.
85 virtual bool ControlsEnabled() const;
86
87 // This makes the manual pilot the active pilot. Returns true if succeeds.
89
90 // This makes the synthetic pilot the active pilot. Returns true if succeeds.
92
93 // This makes the hardware autopilot the active pilot. Returns true if succeeds.
95
96 // This makes the guidance autopilot the active pilot. Returns true if succeeds.
98
99 // This function is called by P6DofVehicle when the vehicle is destroyed in
100 // flight. The aPitchInputModifier and aRollInputModifier arguments vary between
101 // +/-1 and control the pitch and roll control when destroyed.
102 void SetDestroyed(double aPitchInputModifier, double aRollInputModifier);
103
104 // This provides a reference to the special common controller, which is used to access
105 // the functions such as GetAlphaVsMachCL(), GetStickForZeroMomentVsMachAlpha(),
106 // and GetEffectiveCLVsMachAlpha() which are used in testing.
108
109protected:
110 P6DofPilotManager() = default;
112
124};
125
126#endif
Definition P6DofCommonController.hpp:35
Definition P6DofGuidanceAutopilotBankToTurn.hpp:22
Definition P6DofGuidanceAutopilotSkidToTurn.hpp:22
Definition P6DofHardwareAutopilotBankToTurn.hpp:22
Definition P6DofHardwareAutopilotSkidToTurn.hpp:22
Definition P6DofManualPilotAugmentedControls.hpp:22
Definition P6DofManualPilotSimpleControls.hpp:22
P6DofPilotManager * Clone() const
Definition P6DofPilotManager.cpp:163
P6DofManualPilotAugmentedControls * mManualPilotAugmentedControls
Definition P6DofPilotManager.hpp:115
P6DofPilotManager()=default
bool MakeManualPilotActive()
Definition P6DofPilotManager.cpp:1070
P6DofPilotManager & operator=(const P6DofPilotManager &other)=delete
virtual bool ControlsEnabled() const
Definition P6DofPilotManager.cpp:1060
P6DofScenario * mScenario
Definition P6DofPilotManager.hpp:113
const P6DofCommonController * GetSpecialCommonController() const
Definition P6DofPilotManager.hpp:107
P6DofPilotObject * GetActiveGuidanceAutopilot()
Definition P6DofPilotManager.cpp:967
P6DofPilotObject * GetActiveSyntheticPilot()
Definition P6DofPilotManager.cpp:937
P6DofPilotManager(P6DofScenario *aScenario)
Definition P6DofPilotManager.cpp:32
P6DofSyntheticPilot * mSyntheticPilot
Definition P6DofPilotManager.hpp:116
bool MakeHardwareAutopilotActive()
Definition P6DofPilotManager.cpp:1107
void SetLastSimTime(int64_t aLastSimTime_nanosec)
Definition P6DofPilotManager.cpp:839
bool mIsDestroyed
Definition P6DofPilotManager.hpp:122
void SetDestroyed(double aPitchInputModifier, double aRollInputModifier)
Definition P6DofPilotManager.cpp:1151
bool Initialize(int64_t aSimTime_nanosec)
Definition P6DofPilotManager.cpp:769
P6DofPilotObject * GetActivePilot()
Definition P6DofPilotManager.cpp:915
P6DofPilotObject * GetActiveManualPilot()
Definition P6DofPilotManager.cpp:920
virtual void EnableControls(bool aEnabled)
Definition P6DofPilotManager.cpp:1022
P6DofPilotObject * GetActiveHardwareAutopilot()
Definition P6DofPilotManager.cpp:950
void InputAngleDeltasToPilotObjects(const double &aYaw_rad, const double &aPitch_rad, const double &aRoll_rad)
Definition P6DofPilotManager.cpp:984
P6DofCommonController * mSpecialCommonController
Definition P6DofPilotManager.hpp:123
bool ProcessInput(UtInput &aInput)
Definition P6DofPilotManager.cpp:168
P6DofPilotObject * mActivePilot
Definition P6DofPilotManager.hpp:121
P6DofHardwareAutopilotBankToTurn * mHardwareAutopilotBankToTurn
Definition P6DofPilotManager.hpp:117
P6DofGuidanceAutopilotSkidToTurn * mGuidanceAutopilotSkidToTurn
Definition P6DofPilotManager.hpp:120
bool MakeSyntheticPilotActive()
Definition P6DofPilotManager.cpp:1091
P6DofGuidanceAutopilotBankToTurn * mGuidanceAutopilotBankToTurn
Definition P6DofPilotManager.hpp:119
virtual void SetParentVehicle(P6DofVehicle *aParentVehicle)
Definition P6DofPilotManager.cpp:877
P6DofManualPilotSimpleControls * mManualPilotSimpleControls
Definition P6DofPilotManager.hpp:114
P6DofHardwareAutopilotSkidToTurn * mHardwareAutopilotSkidToTurn
Definition P6DofPilotManager.hpp:118
bool MakeGuidanceAutopilotActive()
Definition P6DofPilotManager.cpp:1129
Definition P6DofPilotObject.hpp:37
Definition P6DofScenario.hpp:25
Definition P6DofSyntheticPilot.hpp:22
Definition P6DofVehicle.hpp:53
Copyrights Multiple, All Rights Reserved