WSF
P6DofLandingGear.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#ifndef P6DOFLANDINGGEAR_H
13#define P6DOFLANDINGGEAR_H
14
15#include "p6dof_export.h"
16
17#include <cinttypes>
18#include <string>
19#include <vector>
20
21#include "P6DofObject.hpp"
22#include "UtVec3dX.hpp"
23
24class UtInput;
26class P6DofVehicle;
27
28// The P6DofLandingGear class provides a means to provide forces and moments produced
29// by landing gear and/or other contact points on the vehicle which are handled by
30// instances of the P6DofGroundReactionPoint class.
31
32class P6DOF_EXPORT P6DofLandingGear : public P6DofObject
33{
34public:
35 explicit P6DofLandingGear(P6DofScenario* aScenario);
36 ~P6DofLandingGear() override;
37
39
40 P6DofLandingGear* Clone() const;
41
42 void SetParentVehicle(P6DofVehicle* aParentVehicle) override;
43
44 // ProcessInput reads initialization data
45 bool ProcessInput(UtInput& aInput);
46 bool Initialize(int64_t aSimTime_nanosec);
47 bool Initialize2();
48
49 // This function should be called to "update" the landing gear, including updating
50 // internal parameters. The aDesiredForceBasedFrictionDirectionInSurfaceVecNED
51 // is used for force-based friction conditions.
52 void Update(int64_t aSimTime_nanosec, UtVec3dX& aRequiredOpposingForceInSurfaceVecNED_lbs);
53
54 void SetLastUpdateSimTime(int64_t aLastUpdateSimTime_nanosec)
55 {
56 mLastUpdateSimTime_nanosec = aLastUpdateSimTime_nanosec;
57 }
58
59 // This returns the total force and moment produced by all reaction points
60 // It should be called after Update() is called.
61 void GetForceAndMoments(UtVec3dX& aForce_lbs, UtVec3dX& aMoment_ftlbs) const;
62
63 // This returns true if at least one reaction point exceeded its maximum compression.
64 // Exceeding maximum compression usually means the vehicle has crashed.
66
67 // This returns true if at least one reaction point is in contact with the ground/surface
69
70 // This returns true if at least one landing gear point is in contact with the ground/surface
71 bool WeightOnWheels() const { return mWeightOnWheelsFlag; }
73
74 // This returns true if all landing gear are not moving
75 bool AllGearAtRest() const;
76
77 // This returns true if friction is large enough to hold the aircraft from moving
79
80 // This allows an external force (such as a ground tug) to apply a force
81 // to the nose gear. The angle is measured as zero being forward and
82 // positive angles being to the right
83 void ApplyExternalForce(double aForceMagnitude_lbs, double aAngle_deg);
84
85 // This allows an external force (such as a ground tug) to apply a force
86 // to the nose gear. The specified vector is in body coordinates.
87 void ApplyExternalForce(const UtVec3dX& aExternalForceBody_lbs);
88
89 // This removes any and all external forces on the nose gear
90 void RemoveExternalForce();
91
92 // This controls enabling of NWS (which allows a greater steering angle than normal mode
93 void EnableNWS(bool aEnable);
94
95 // This returns true is NWS is enabled
96 bool NWS_IsEnabled() const { return mNWS_IsEnabled; }
97
98 // This returns the distance (in feet) that the nose gear is from the reference point
99 // in body coordinates. If more than one nose gear exists, it returns the value
100 // for the first one encountered.
101 double NoseGearDistForwardOfReference_ft();
102
103 // This returns the distance (in feet) that the right main gear is from the reference point
104 // in body coordinates. If more than one right main gear exists, it returns the value
105 // for the first one encountered.
106 double RightMainGearRearwardOfReference_ft();
107
108 // This returns the distance (in feet) that the right main gear is from the reference point
109 // in body coordinates. If more than one right main gear exists, it returns the value
110 // for the first one encountered.
111 double RightMainGearSidewaysOfReference_ft();
112
113 // This calculates the steering angle to achieve the specified turn radius.
114 // Returns false if it cannot achieve the desired turn radius
115 void SteeringAngleForDesiredRadiusFt_deg(double aTurnRadius_ft, double& aSteeringAngle_deg, double aMaxSteeringAngle_deg);
116
117 // This returns a pointer to the nose gear
118 P6DofGroundReactionPoint* GetNoseGear();
119
120 // This returns a pointer to the right main gear
121 P6DofGroundReactionPoint* GetRightMainGear();
122
123 // This returns a pointer to the left main gear
124 P6DofGroundReactionPoint* GetLeftMainGear();
125
126 // This returns the nominal height (in meters) of the vehicle above ground
127 // level when resting on the landing gear. It is useful for determining the
128 // "altitude" of the vehicle when on the ground. Note that this is a nominal
129 // value -- the actual value will be based on gross weight, which will
130 // compress the gear more or less than nominal, changing the height.
132
133protected:
135
136 bool NameIsUnique(const std::string& aName) const;
137
138 // This is used (when at least one point is in contact with ground) to
139 // determine if the vehicle is at rest.
140 bool VehicleIsAtRest() const;
141
143 std::vector<P6DofGroundReactionPoint*> mListOfGroundReactionPoints;
162};
163
164#endif
aObjectPtr Update(simTime)
Definition P6DofGroundReactionPoint.hpp:33
Definition P6DofLandingGear.hpp:33
void SetLastUpdateSimTime(int64_t aLastUpdateSimTime_nanosec)
Definition P6DofLandingGear.hpp:54
bool Initialize(int64_t aSimTime_nanosec)
Definition P6DofLandingGear.cpp:162
bool ProcessInput(UtInput &aInput)
Definition P6DofLandingGear.cpp:107
UtVec3dX mLastVehicleVelocityOnGround_mps
Definition P6DofLandingGear.hpp:148
bool mSomethingExceededMaxCompression
Definition P6DofLandingGear.hpp:149
UtVec3dX mTotalForce_lbs
Definition P6DofLandingGear.hpp:146
double mNominalHgtAboveGndOnGear_m
Definition P6DofLandingGear.hpp:158
std::vector< P6DofGroundReactionPoint * > mListOfGroundReactionPoints
Definition P6DofLandingGear.hpp:143
bool mSomethingIsInContactWithGround
Definition P6DofLandingGear.hpp:150
double GetNominalHeightAboveGroundOnGear()
Definition P6DofLandingGear.hpp:131
bool mWeightOnWheelsFlag
Definition P6DofLandingGear.hpp:151
P6DofLandingGear(P6DofScenario *aScenario)
Definition P6DofLandingGear.cpp:22
bool FrictionHoldingStill() const
Definition P6DofLandingGear.hpp:78
P6DofGroundReactionPoint * mLeftMainGear
Definition P6DofLandingGear.hpp:161
std::string mNWSEnableControlName
Definition P6DofLandingGear.hpp:156
bool SomethingExceededMaxCompression() const
Definition P6DofLandingGear.hpp:65
P6DofGroundReactionPoint * mNoseGear
Definition P6DofLandingGear.hpp:159
bool mWeightOnNoseWheelFlag
Definition P6DofLandingGear.hpp:152
UtVec3dX mCurrentExternalForceBody_lbs
Definition P6DofLandingGear.hpp:145
bool WeightOnWheels() const
Definition P6DofLandingGear.hpp:71
bool NWS_IsEnabled() const
Definition P6DofLandingGear.hpp:96
size_t mNWSEnableControlHandle
Definition P6DofLandingGear.hpp:157
bool SomethingIsInContactWithGround() const
Definition P6DofLandingGear.hpp:68
UtVec3dX mTotalMoment_ftlbs
Definition P6DofLandingGear.hpp:147
bool WeightOnNoseWheel() const
Definition P6DofLandingGear.hpp:72
bool mNWS_IsEnabled
Definition P6DofLandingGear.hpp:155
bool Initialize2()
Definition P6DofLandingGear.cpp:192
P6DofLandingGear & operator=(const P6DofLandingGear &other)=delete
bool mLastTimeAtRestOnSurface
Definition P6DofLandingGear.hpp:153
P6DofGroundReactionPoint * mRightMainGear
Definition P6DofLandingGear.hpp:160
bool mApplyExternalForce
Definition P6DofLandingGear.hpp:144
bool mFrictionHoldingStill
Definition P6DofLandingGear.hpp:154
int64_t mLastUpdateSimTime_nanosec
Definition P6DofLandingGear.hpp:142
P6DofObject(P6DofScenario *aScenario)
Definition P6DofObject.cpp:17
P6DofObject * Clone() const
Definition P6DofObject.cpp:24
virtual void SetParentVehicle(P6DofVehicle *aParentVehicle)
Definition P6DofObject.hpp:39
Definition P6DofScenario.hpp:25
Definition P6DofVehicle.hpp:53
Copyrights Multiple, All Rights Reserved