[原][JSBSIM]xml解读
1.执行脚本:
脚本一般在脚本scripts文件夹中
脚本使用飞机脚本和初始化脚本<use aircraft="f16" initialize="reset00"/>
2.初始化脚本:
初始化脚本例如aircraft\f16\reset00.xml初始化脚本
使用的初始化参数在源文件的src\initialization\FGInitialCondition文件中
例如:
/** Initializes the simulation run. Takes a set of initial conditions (IC) and provide a kinematically consistent set of body axis velocity components, euler angles, and altitude. This class does not attempt to trim the model i.e. the sim will most likely start in a very dynamic state (unless, of course, you have chosen your IC's wisely, or started on the ground) even after setting it up with this class. <h3>Usage Notes</h3> With a valid object of FGFDMExec and an aircraft model loaded: @code FGInitialCondition fgic=new FGInitialCondition(FDMExec); fgic->SetVcalibratedKtsIC() fgic->SetAltitudeAGLFtIC(); // directly into Run FDMExec->GetState()->Initialize(fgic) delete fgic; FDMExec->Run() //or to loop the sim w/o integrating FDMExec->RunIC(fgic) @endcode <h3>Speed</h3> Since vc, ve, vt, and mach all represent speed, the remaining three are recalculated each time one of them is set (using the current altitude). The most recent speed set is remembered so that if and when altitude is reset, the last set speed is used to recalculate the remaining three. Setting any of the body components forces a recalculation of vt and vt then becomes the most recent speed set. <h3>Alpha,Gamma, and Theta</h3> This class assumes that it will be used to set up the sim for a steady, zero pitch rate condition. Since any two of those angles specifies the third gamma (flight path angle) is favored when setting alpha and theta and alpha is favored when setting gamma. i.e. - set alpha : recalculate theta using gamma as currently set - set theta : recalculate alpha using gamma as currently set - set gamma : recalculate theta using alpha as currently set The idea being that gamma is most interesting to pilots (since it is indicative of climb rate). Setting climb rate is, for the purpose of this discussion, considered equivalent to setting gamma. These are the items that can be set in an initialization file: - ubody (velocity, ft/sec) - vbody (velocity, ft/sec) - wbody (velocity, ft/sec) - vnorth (velocity, ft/sec) - veast (velocity, ft/sec) - vdown (velocity, ft/sec) - latitude (position, degrees) - longitude (position, degrees) - phi (orientation, degrees) - theta (orientation, degrees) - psi (orientation, degrees) - alpha (angle, degrees) - beta (angle, degrees) - gamma (angle, degrees) - roc (vertical velocity, ft/sec) - altitude (altitude AGL, ft) - winddir (wind from-angle, degrees) - vwind (magnitude wind speed, ft/sec) - hwind (headwind speed, knots) - xwind (crosswind speed, knots) - vc (calibrated airspeed, ft/sec) - mach (mach) - vground (ground speed, ft/sec) - running (0 or 1) <h3>Properties</h3> @property ic/vc-kts (read/write) Calibrated airspeed initial condition in knots @property ic/ve-kts (read/write) Knots equivalent airspeed initial condition @property ic/vg-kts (read/write) Ground speed initial condition in knots @property ic/vt-kts (read/write) True airspeed initial condition in knots @property ic/mach (read/write) Mach initial condition @property ic/roc-fpm (read/write) Rate of climb initial condition in feet/minute @property ic/gamma-deg (read/write) Flightpath angle initial condition in degrees @property ic/alpha-deg (read/write) Angle of attack initial condition in degrees @property ic/beta-deg (read/write) Angle of sideslip initial condition in degrees @property ic/theta-deg (read/write) Pitch angle initial condition in degrees @property ic/phi-deg (read/write) Roll angle initial condition in degrees @property ic/psi-true-deg (read/write) Heading angle initial condition in degrees @property ic/lat-gc-deg (read/write) Latitude initial condition in degrees @property ic/long-gc-deg (read/write) Longitude initial condition in degrees @property ic/h-sl-ft (read/write) Height above sea level initial condition in feet @property ic/h-agl-ft (read/write) Height above ground level initial condition in feet @property ic/sea-level-radius-ft (read/write) Radius of planet at sea level in feet @property ic/terrain-elevation-ft (read/write) Terrain elevation above sea level in feet @property ic/vg-fps (read/write) Ground speed initial condition in feet/second @property ic/vt-fps (read/write) True airspeed initial condition in feet/second @property ic/vw-bx-fps (read/write) Wind velocity initial condition in Body X frame in feet/second @property ic/vw-by-fps (read/write) Wind velocity initial condition in Body Y frame in feet/second @property ic/vw-bz-fps (read/write) Wind velocity initial condition in Body Z frame in feet/second @property ic/vw-north-fps (read/write) Wind northward velocity initial condition in feet/second @property ic/vw-east-fps (read/write) Wind eastward velocity initial condition in feet/second @property ic/vw-down-fps (read/write) Wind downward velocity initial condition in feet/second @property ic/vw-mag-fps (read/write) Wind velocity magnitude initial condition in feet/sec. @property ic/vw-dir-deg (read/write) Wind direction initial condition, in degrees from north @property ic/roc-fps (read/write) Rate of climb initial condition, in feet/second @property ic/u-fps (read/write) Body frame x-axis velocity initial condition in feet/second @property ic/v-fps (read/write) Body frame y-axis velocity initial condition in feet/second @property ic/w-fps (read/write) Body frame z-axis velocity initial condition in feet/second @property ic/vn-fps (read/write) Local frame x-axis (north) velocity initial condition in feet/second @property ic/ve-fps (read/write) Local frame y-axis (east) velocity initial condition in feet/second @property ic/vd-fps (read/write) Local frame z-axis (down) velocity initial condition in feet/second @property ic/gamma-rad (read/write) Flight path angle initial condition in radians @property ic/alpha-rad (read/write) Angle of attack initial condition in radians @property ic/theta-rad (read/write) Pitch angle initial condition in radians @property ic/beta-rad (read/write) Angle of sideslip initial condition in radians @property ic/phi-rad (read/write) Roll angle initial condition in radians @property ic/psi-true-rad (read/write) Heading angle initial condition in radians @property ic/lat-gc-rad (read/write) Geocentric latitude initial condition in radians @property ic/long-gc-rad (read/write) Longitude initial condition in radians @property ic/p-rad_sec (read/write) Roll rate initial condition in radians/second @property ic/q-rad_sec (read/write) Pitch rate initial condition in radians/second @property ic/r-rad_sec (read/write) Yaw rate initial condition in radians/second @author Tony Peden @version "$Id: FGInitialCondition.h,v 1.17 2009/05/26 05:35:42 jberndt Exp $" */
所有关于初始化的描述就在这个文件里
2.飞机脚本:
飞机脚本里的参数在源码的src\models目录下:
例如:很多飞机的很多参数都在src\models\FGFCS.cpp下面
3.输入输出:
输入输出参数也在飞机脚本里,不过对应源码在src\input_output目录下

浙公网安备 33010602011771号