1
0
Fork 0

Latest JSBSim changes to support yaw and roll trim.

This commit is contained in:
david 2001-12-17 01:42:39 +00:00
parent 0b792ab689
commit 0395a446f7
4 changed files with 27 additions and 2 deletions

View file

@ -317,9 +317,11 @@ bool FGJSBsim::copy_to_JSBsim() {
// copy control positions into the JSBsim structure
FCS->SetDaCmd( globals->get_controls()->get_aileron());
FCS->SetRollTrimCmd(globals->get_controls()->get_aileron_trim());
FCS->SetDeCmd( globals->get_controls()->get_elevator());
FCS->SetPitchTrimCmd(globals->get_controls()->get_elevator_trim());
FCS->SetDrCmd( -globals->get_controls()->get_rudder());
FCS->SetYawTrimCmd(globals->get_controls()->get_rudder_trim());
FCS->SetDfCmd( globals->get_controls()->get_flaps() );
FCS->SetDsbCmd( 0.0 ); //speedbrakes
FCS->SetDspCmd( 0.0 ); //spoilers

View file

@ -67,7 +67,8 @@ FGFCS::FGFCS(FGFDMExec* fdmex) : FGModel(fdmex)
{
Name = "FGFCS";
DaCmd = DeCmd = DrCmd = DfCmd = DsbCmd = DspCmd = PTrimCmd = 0.0;
DaCmd = DeCmd = DrCmd = DfCmd = DsbCmd = DspCmd = 0.0;
PTrimCmd = YTrimCmd = RTrimCmd = 0.0;
DaPos = DePos = DrPos = DfPos = DsbPos = DspPos = 0.0;
GearCmd = GearPos = 1; // default to gear down
LeftBrake = RightBrake = CenterBrake = 0.0;

View file

@ -212,6 +212,14 @@ public:
@return pitch trim command in radians */
inline double GetPitchTrimCmd(void) { return PTrimCmd; }
/** Gets the rudder trim command.
@return rudder trim command in radians */
inline double GetYawTrimCmd(void) { return YTrimCmd; }
/** Gets the aileron trim command.
@return aileron trim command in radians */
inline double GetRollTrimCmd(void) { return RTrimCmd; }
/** Get the gear extend/retract command. 0 commands gear up, 1 down.
defaults to down.
@return the current value of the gear extend/retract command*/
@ -315,6 +323,14 @@ public:
@param cmd pitch trim command in radians*/
inline void SetPitchTrimCmd(double cmd) { PTrimCmd = cmd; }
/** Sets the rudder trim command
@param cmd rudder trim command in radians*/
inline void SetYawTrimCmd(double cmd) { YTrimCmd = cmd; }
/** Sets the aileron trim command
@param cmd aileron trim command in radians*/
inline void SetRollTrimCmd(double cmd) { RTrimCmd = cmd; }
/** Sets the throttle command for the specified engine
@param engine engine ID number
@param cmd throttle command in percent (0 - 100)*/
@ -415,7 +431,7 @@ public:
private:
double DaCmd, DeCmd, DrCmd, DfCmd, DsbCmd, DspCmd;
double DaPos, DePos, DrPos, DfPos, DsbPos, DspPos;
double PTrimCmd;
double PTrimCmd, YTrimCmd, RTrimCmd;
vector <double> ThrottleCmd;
vector <double> ThrottlePos;
vector <double> MixtureCmd;

View file

@ -140,6 +140,8 @@ FGState::FGState(FGFDMExec* fdex)
RegisterVariable(FG_ACTIVE_ENGINE, " active_engine " );
RegisterVariable(FG_HOVERB, " height/span " );
RegisterVariable(FG_PITCH_TRIM_CMD, " pitch_trim_cmd " );
RegisterVariable(FG_YAW_TRIM_CMD, " yaw_trim_cmd " );
RegisterVariable(FG_ROLL_TRIM_CMD, " roll_trim_cmd " );
RegisterVariable(FG_LEFT_BRAKE_CMD, " left_brake_cmd " );
RegisterVariable(FG_RIGHT_BRAKE_CMD," right_brake_cmd ");
RegisterVariable(FG_CENTER_BRAKE_CMD," center_brake_cmd ");
@ -292,6 +294,10 @@ double FGState::GetParameter(eParam val_idx) {
return Position->GetHOverBMAC();
case FG_PITCH_TRIM_CMD:
return FCS->GetPitchTrimCmd();
case FG_YAW_TRIM_CMD:
return FCS->GetYawTrimCmd();
case FG_ROLL_TRIM_CMD:
return FCS->GetRollTrimCmd();
case FG_GEAR_CMD:
return FCS->GetGearCmd();
case FG_GEAR_POS: