JSBSim仿真设置步骤:输入指令函数解析
需要先获得FGFCS对象指针
std::shared_ptr<FGFCS> fcs = FDMExec->GetFCS();//获得FGFCS对象指针
函数位置:/usr/include/JSBSim/models/FGFCS.h
根据程序需要,自行调用相关函数,灵活组合
void SetDaCmd( double cmd ) { DaCmd = cmd; }
/** Sets the elevator command
@param cmd elevator command in percent*/
void SetDeCmd(double cmd ) { DeCmd = cmd; }
/** Sets the rudder command
@param cmd rudder command in percent*/
void SetDrCmd(double cmd) { DrCmd = cmd; }
/** Sets the steering command
@param cmd steering command in percent*/
void SetDsCmd(double cmd) { fdmex->GetGroundReactions()->SetDsCmd( cmd ); }
/** Sets the flaps command
@param cmd flaps command in percent*/
void SetDfCmd(double cmd) { DfCmd = cmd; }
/** Sets the speedbrake command
@param cmd speedbrake command in percent*/
void SetDsbCmd(double cmd) { DsbCmd = cmd; }
/** Sets the spoilers command
@param cmd spoilers command in percent*/
void SetDspCmd(double cmd) { DspCmd = cmd; }
/** Sets the pitch trim command
@param cmd pitch trim command in percent*/
void SetPitchTrimCmd(double cmd) { PTrimCmd = cmd; }
/** Sets the rudder trim command
@param cmd rudder trim command in percent*/
void SetYawTrimCmd(double cmd) { YTrimCmd = cmd; }
/** Sets the aileron trim command
@param cmd aileron trim command in percent*/
void SetRollTrimCmd(double cmd) { RTrimCmd = cmd; }
/** Sets the throttle command for the specified engine
@param engine engine ID number
@param cmd normalized throttle command (0.0 - 1.0)*/
void SetThrottleCmd(int engine, double cmd);
/** Sets the mixture command for the specified engine
@param engine engine ID number
@param cmd normalized mixture command (0.0 - 1.0)*/
void SetMixtureCmd(int engine, double cmd);
/** 设置副翼命令*/
void SetDaCmd( double cmd ) { DaCmd = cmd; }
/** 设置上升指令*/
void SetDeCmd(double cmd ) { DeCmd = cmd; }
/** 设置方向舵命令*/
void SetDrCmd(double cmd) { DrCmd = cmd; }
/** 设置转向指令*/
void SetDsCmd(double cmd) { fdmex->GetGroundReactions()->SetDsCmd( cmd ); }
/** 设置襟翼命令*/
void SetDfCmd(double cmd) { DfCmd = cmd; }
/** 设置speedbrake命令*/
void SetDsbCmd(double cmd) { DsbCmd = cmd; }
/** 设置扰流板命令*/
void SetDspCmd(double cmd) { DspCmd = cmd; }
/** 设置俯仰微调命令*/
void SetPitchTrimCmd(double cmd) { PTrimCmd = cmd; }
/** 设置方向舵微调命令*/
void SetYawTrimCmd(double cmd) { YTrimCmd = cmd; }
/** 设置副翼微调命令*/
void SetRollTrimCmd(double cmd) { RTrimCmd = cmd; }
/** 设置指定发动机的油门指令
@param cmd normalized throttle command (0.0 - 1.0)*/
void SetThrottleCmd(int engine, double cmd);
/** 设置指定发动机的混合指令
@param engine engine ID number
@param cmd normalized mixture command (0.0 - 1.0)*/
void SetMixtureCmd(int engine, double cmd);
/** 设置档位伸出/缩回命令,默认为向下
@param gear command 0 for up, 1 for down */
void SetGearCmd(double gearcmd) { GearCmd = gearcmd; }
/** 设置指定发动机的螺旋桨螺距命令
@param engine engine ID number
@param cmd pitch command in percent (0.0 - 1.0)*/
void SetPropAdvanceCmd(int engine, double cmd);
/** 设置指定发动机的螺旋桨羽流命令
@param engine engine ID number
@param cmd feather (bool)*/
void SetFeatherCmd(int engine, bool cmd);