// 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
{
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;
@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*/
@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)*/
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;
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 ");
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: