JSBSim Flight Dynamics Model  1.1.11 (13 Feb 2022)
An Open Source Flight Dynamics and Control Software Library in C++
FGGroundReactions.h
1 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2 
3  Header: FGGroundReactions.h
4  Author: Jon S. Berndt
5  Date started: 09/13/00
6 
7  ------------- Copyright (C) 1999 Jon S. Berndt (jon@jsbsim.org) -------------
8 
9  This program is free software; you can redistribute it and/or modify it under
10  the terms of the GNU Lesser General Public License as published by the Free
11  Software Foundation; either version 2 of the License, or (at your option) any
12  later version.
13 
14  This program is distributed in the hope that it will be useful, but WITHOUT
15  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16  FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
17  details.
18 
19  You should have received a copy of the GNU Lesser General Public License along
20  with this program; if not, write to the Free Software Foundation, Inc., 59
21  Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 
23  Further information about the GNU Lesser General Public License can also be
24  found on the world wide web at http://www.gnu.org.
25 
26 HISTORY
27 --------------------------------------------------------------------------------
28 09/13/00 JSB Created
29 
30 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
31 SENTRY
32 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
33 
34 #ifndef FGGROUNDREACTIONS_H
35 #define FGGROUNDREACTIONS_H
36 
37 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
38 INCLUDES
39 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
40 
41 #include <vector>
42 
43 #include "FGSurface.h"
44 #include "FGModel.h"
45 #include "FGLGear.h"
46 #include "math/FGColumnVector3.h"
47 
48 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
49 FORWARD DECLARATIONS
50 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
51 
52 namespace JSBSim {
53 
54 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
55 CLASS DOCUMENTATION
56 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
57 
75 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
76 CLASS DECLARATION
77 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
78 
79 class FGGroundReactions : public FGModel, public FGSurface
80 {
81 public:
83  ~FGGroundReactions(void) override;
84 
85  bool InitModel(void) override;
93  bool Run(bool Holding) override;
94  bool Load(Element* el) override;
95  const FGColumnVector3& GetForces(void) const {return vForces;}
96  double GetForces(int idx) const {return vForces(idx);}
97  const FGColumnVector3& GetMoments(void) const {return vMoments;}
98  double GetMoments(int idx) const {return vMoments(idx);}
99  std::string GetGroundReactionStrings(std::string delimeter) const;
100  std::string GetGroundReactionValues(std::string delimeter) const;
101  bool GetWOW(void) const;
102 
105  int GetNumGearUnits(void) const { return (int)lGear.size(); }
106 
110  FGLGear* GetGearUnit(int gear) const { return lGear[gear]; }
111 
114  double GetDsCmd(void) const { return DsCmd; }
115 
118  void SetDsCmd(double cmd);
119 
120  void RegisterLagrangeMultiplier(LagrangeMultiplier* lmult) { multipliers.push_back(lmult); }
121  std::vector <LagrangeMultiplier*>* GetMultipliersList(void) { return &multipliers; }
122 
123  FGLGear::Inputs in;
124 
125 private:
126  std::vector <FGLGear*> lGear;
127  FGColumnVector3 vForces;
128  FGColumnVector3 vMoments;
129  std::vector <LagrangeMultiplier*> multipliers;
130  double DsCmd;
131 
132  void bind(void);
133  void Debug(int from) override;
134 };
135 }
136 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
137 #endif
JSBSim::FGSurface
Base class for all surface properties.
Definition: FGSurface.h:61
JSBSim::FGFDMExec
Encapsulates the JSBSim simulation executive.
Definition: FGFDMExec.h:185
JSBSim::FGGroundReactions::Run
bool Run(bool Holding) override
Runs the Ground Reactions model; called by the Executive Can pass in a value indicating if the execut...
Definition: FGGroundReactions.cpp:94
JSBSim::FGColumnVector3
This class implements a 3 element column vector.
Definition: FGColumnVector3.h:63
JSBSim::FGModel
Base class for all scheduled JSBSim models.
Definition: FGModel.h:68
JSBSim::FGGroundReactions::GetDsCmd
double GetDsCmd(void) const
Gets the steering command.
Definition: FGGroundReactions.h:114
JSBSim::FGLGear
Landing gear model.
Definition: FGLGear.h:190
JSBSim::FGGroundReactions::SetDsCmd
void SetDsCmd(double cmd)
Sets the steering command.
Definition: FGGroundReactions.cpp:137
JSBSim::FGGroundReactions
Manages ground reactions modeling.
Definition: FGGroundReactions.h:79
JSBSim::FGGroundReactions::GetGearUnit
FGLGear * GetGearUnit(int gear) const
Gets a gear instance.
Definition: FGGroundReactions.h:110
JSBSim::LagrangeMultiplier
Definition: LagrangeMultiplier.h:51
JSBSim::FGGroundReactions::GetNumGearUnits
int GetNumGearUnits(void) const
Gets the number of gears.
Definition: FGGroundReactions.h:105
JSBSim::Element
Definition: FGXMLElement.h:143