 |
JSBSim Flight Dynamics Model
1.1.11 (13 Feb 2022)
An Open Source Flight Dynamics and Control Software Library in C++
|
45 #include "models/FGModel.h"
46 #include "models/FGLGear.h"
47 #include "models/FGGroundReactions.h"
56 typedef enum { ofRad=0, ofDeg, ofNorm, ofMag , NForms} OutputForm;
197 bool InitModel(
void)
override;
206 bool Run(
bool Holding)
override;
241 double GetThrottleCmd(
int engine)
const;
243 const std::vector<double>& GetThrottleCmd()
const {
return ThrottleCmd;}
250 const std::vector<double>& GetMixtureCmd()
const {
return MixtureCmd;}
285 const {
return DaLPos[form]; }
290 const {
return DaRPos[form]; }
295 const {
return DePos[form]; }
300 const {
return DrPos[form]; }
305 const {
return DsbPos[form]; }
310 const {
return DspPos[form]; }
315 const {
return DfPos[form]; }
320 double GetThrottlePos(
int engine)
const;
322 const std::vector<double>& GetThrottlePos()
const {
return ThrottlePos;}
329 const std::vector<double>& GetMixturePos()
const {
return MixturePos;}
348 const std::vector<double>& GetPropAdvance()
const {
return PropAdvance; }
355 const std::vector<bool>& GetPropFeather()
const {
return PropFeather; }
448 void SetDePos(
int form ,
double pos );
452 void SetDrPos(
int form ,
double pos );
456 void SetDfPos(
int form ,
double pos );
503 void SetLBrake(
double cmd) {BrakePos[FGLGear::bgLeft] = cmd;}
507 void SetRBrake(
double cmd) {BrakePos[FGLGear::bgRight] = cmd;}
511 void SetCBrake(
double cmd) {BrakePos[FGLGear::bgCenter] = cmd;}
518 const std::vector<double>& GetBrakePos()
const {
return BrakePos;}
522 double GetLBrake(
void)
const {
return BrakePos[FGLGear::bgLeft];}
526 double GetRBrake(
void)
const {
return BrakePos[FGLGear::bgRight];}
530 double GetCBrake(
void)
const {
return BrakePos[FGLGear::bgCenter];}
533 enum SystemType { stFCS, stSystem, stAutoPilot };
539 bool Load(Element* el)
override;
541 SGPath FindFullPathName(
const SGPath& path)
const override;
543 void AddThrottle(
void);
544 double GetDt(
void)
const;
546 FGPropertyManager* GetPropertyManager(
void) {
return PropertyManager; }
548 bool GetTrimStatus(
void)
const {
return FDMExec->GetTrimStatus(); }
549 double GetChannelDeltaT(
void)
const {
return GetDt() * ChannelRate; }
552 double DaCmd, DeCmd, DrCmd, DfCmd, DsbCmd, DspCmd;
553 double DePos[NForms], DaLPos[NForms], DaRPos[NForms], DrPos[NForms];
554 double DfPos[NForms], DsbPos[NForms], DspPos[NForms];
555 double PTrimCmd, YTrimCmd, RTrimCmd;
556 std::vector <double> ThrottleCmd;
557 std::vector <double> ThrottlePos;
558 std::vector <double> MixtureCmd;
559 std::vector <double> MixturePos;
560 std::vector <double> PropAdvanceCmd;
561 std::vector <double> PropAdvance;
562 std::vector <bool> PropFeatherCmd;
563 std::vector <bool> PropFeather;
565 std::vector <double> BrakePos;
566 double GearCmd,GearPos;
567 double TailhookPos, WingFoldPos;
572 typedef std::vector <FGFCSChannel*> Channels;
573 Channels SystemChannels;
575 void bindThrottle(
unsigned int);
576 void Debug(
int from)
override;
void SetDaRPos(int form, double pos)
Sets the right aileron position.
void SetDspPos(int form, double pos)
Sets the spoiler position.
Encapsulates the JSBSim simulation executive.
double GetCBrake(void) const
Gets the center brake.
double GetGearPos(void) const
Gets the gear position (0 up, 1 down), defaults to down.
void SetPropAdvance(int engine, double cmd)
Sets the actual prop pitch setting for the specified engine.
double GetDsbCmd(void) const
Gets the speedbrake command.
void SetFeatherCmd(int engine, bool cmd)
Sets the propeller feather command for the specified engine.
void SetThrottlePos(int engine, double cmd)
Sets the actual throttle setting for the specified engine.
void SetDfPos(int form, double pos)
Sets the flaps position.
Base class for all scheduled JSBSim models.
double GetPitchTrimCmd(void) const
Gets the pitch trim command.
double GetDeCmd(void) const
Gets the elevator command.
~FGFCS() override
Destructor.
double GetDsCmd(void) const
Gets the steering command.
void SetDeCmd(double cmd)
Sets the elevator command.
double GetDsCmd(void) const
Gets the steering command.
void SetRBrake(double cmd)
Sets the right brake group.
double GetYawTrimCmd(void) const
Gets the rudder trim command.
bool GetFeatherCmd(int engine) const
Gets the prop feather command.
double GetDfPos(int form=ofRad) const
Gets the flaps position.
void SetMixturePos(int engine, double cmd)
Sets the actual mixture setting for the specified engine.
double GetDfCmd(void) const
Gets the flaps command.
void SetThrottleCmd(int engine, double cmd)
Sets the throttle command for the specified engine.
FGGroundReactions * GetGroundReactions(void)
Returns the FGGroundReactions pointer.
double GetTailhookPos(void) const
Gets the tailhook position (0 up, 1 down)
void SetDrPos(int form, double pos)
Sets the rudder position.
double GetDaCmd(void) const
Gets the aileron command.
void SetPropFeather(int engine, bool cmd)
Sets the actual prop feather setting for the specified engine.
double GetPropAdvanceCmd(int engine) const
Gets the prop pitch command.
std::string GetComponentStrings(const std::string &delimiter) const
Retrieves all component names for inclusion in output stream.
void SetDspCmd(double cmd)
Sets the spoilers command.
void SetDfCmd(double cmd)
Sets the flaps command.
double GetWingFoldPos(void) const
Gets the wing fold position (0 unfolded, 1 folded)
bool Run(bool Holding) override
Runs the Flight Controls model; called by the Executive Can pass in a value indicating if the executi...
void SetDsCmd(double cmd)
Sets the steering command.
void SetDaCmd(double cmd)
Sets the aileron command.
double GetDePos(int form=ofRad) const
Gets the elevator position.
double GetLBrake(void) const
Gets the left brake.
void SetGearCmd(double gearcmd)
Set the gear extend/retract command, defaults to down.
void SetDaLPos(int form, double pos)
Sets the left aileron position.
void SetDsbCmd(double cmd)
Sets the speedbrake command.
double GetDspPos(int form=ofRad) const
Gets the spoiler position.
void SetWingFoldPos(double foldpos)
Set the wing fold position.
double GetMixtureCmd(int engine) const
Gets the mixture command.
double GetDspCmd(void) const
Gets the spoiler command.
void SetPitchTrimCmd(double cmd)
Sets the pitch trim command.
std::string GetComponentValues(const std::string &delimiter) const
Retrieves all component outputs for inclusion in output stream.
double GetDsbPos(int form=ofRad) const
Gets the speedbrake position.
void SetYawTrimCmd(double cmd)
Sets the rudder trim command.
double GetDrCmd(void) const
Gets the rudder command.
bool GetPropFeather(int engine) const
Gets the prop feather position.
double GetRBrake(void) const
Gets the right brake.
Encapsulates the Flight Control System (FCS) functionality.
FGFCS(FGFDMExec *)
Constructor.
double GetRollTrimCmd(void) const
Gets the aileron trim command.
BrakeGroup
Brake grouping enumerators.
void SetLBrake(double cmd)
Sets the left brake group.
double GetDaRPos(int form=ofRad) const
Gets the right aileron position.
double GetMixturePos(int engine) const
Gets the mixture position.
void SetMixtureCmd(int engine, double cmd)
Sets the mixture command for the specified engine.
void SetPropAdvanceCmd(int engine, double cmd)
Sets the propeller pitch command for the specified engine.
void SetDsbPos(int form, double pos)
Sets the speedbrake position.
void SetDsCmd(double cmd)
Sets the steering command.
void SetTailhookPos(double hookpos)
Set the tailhook position.
bool Load(Element *el) override
Loads the Flight Control System.
void SetDrCmd(double cmd)
Sets the rudder command.
void SetCBrake(double cmd)
Sets the center brake group.
double GetPropAdvance(int engine) const
Gets the prop pitch position.
double GetGearCmd(void) const
Get the gear extend/retract command.
double GetBrake(FGLGear::BrakeGroup bg)
Gets the brake for a specified group.
double GetDaLPos(int form=ofRad) const
Gets the left aileron position.
void SetRollTrimCmd(double cmd)
Sets the aileron trim command.
double GetDrPos(int form=ofRad) const
Gets the rudder position.
void SetDePos(int form, double pos)
Sets the elevator position.
void SetGearPos(double gearpos)
Set the gear extend/retract position, defaults to down.