FlightGear next
FGGroundReactions.h
Go to the documentation of this file.
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
26HISTORY
27--------------------------------------------------------------------------------
2809/13/00 JSB Created
29
30%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
31SENTRY
32%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
33
34#ifndef FGGROUNDREACTIONS_H
35#define FGGROUNDREACTIONS_H
36
37/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
38INCLUDES
39%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
40
41#include <vector>
42
43#include "FGSurface.h"
44#include "FGModel.h"
45#include "FGLGear.h"
47
48/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
49FORWARD DECLARATIONS
50%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
51
52namespace JSBSim {
53
54/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
55CLASS DOCUMENTATION
56%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
57
74
75/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
76CLASS DECLARATION
77%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
78
79class FGGroundReactions : public FGModel, public FGSurface
80{
81public:
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
124
125private:
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
This class implements a 3 element column vector.
FGLGear * GetGearUnit(int gear) const
Gets a gear instance.
std::string GetGroundReactionValues(std::string delimeter) const
double GetForces(int idx) const
double GetDsCmd(void) const
Gets the steering command.
std::string GetGroundReactionStrings(std::string delimeter) const
bool Load(Element *el) override
const FGColumnVector3 & GetForces(void) const
double GetMoments(int idx) const
void RegisterLagrangeMultiplier(LagrangeMultiplier *lmult)
int GetNumGearUnits(void) const
Gets the number of gears.
bool InitModel(void) override
void SetDsCmd(double cmd)
Sets the steering command.
const FGColumnVector3 & GetMoments(void) const
std::vector< LagrangeMultiplier * > * GetMultipliersList(void)
bool Run(bool Holding) override
Runs the Ground Reactions model; called by the Executive Can pass in a value indicating if the execut...
Landing gear model.
Definition FGLGear.h:191
FGModel(FGFDMExec *)
Constructor.
Definition FGModel.cpp:57
FGSurface(FGFDMExec *fdmex, int number=-1)
Constructor.
Definition FGSurface.cpp:52