Jsbsim Tutorial -

#include <FGFDMExec.h> using namespace JSBSim; int main() { FGFDMExec fdm; fdm.SetAircraftPath("aircraft/c172"); fdm.LoadScript("scripts/c1721.xml");

<?xml version="1.0"?> <runscript> <use aircraft="c172" initialization="reset"/> <run start="0" end="60" dt="0.01"> <property value="20.0"> simulation/sim-time-sec </property> <!-- Start at 20 sec --> <property value="140.0"> velocities/vc-kts </property> <!-- 140 knots --> <property value="0.1"> fcs/elevator-cmd-norm </property> <!-- Pull back slightly --> <!-- Define a landing at 40 seconds --> <event name="Flaps Down" time="40"> <set value="1.0"> fcs/flaps-cmd-norm </set> </event> </run> </runscript> jsbsim tutorial

In c172.xml , find the <flight_control> section: #include &lt;FGFDMExec

JSBSim --script=scripts/c1721.xml You will see a cascade of text output: unit conversions, aerodynamic coefficients, and finally, time-step data every 0.01 seconds. You just ran a simulation. The aircraft took off, climbed, and flew a pattern. You didn't see it, but you simulated it. To control it manually via keyboard/joystick in real-time: You didn't see it, but you simulated it

while (fdm.Run()) { double lat = fdm.GetProperty("position/lat-deg"); double lon = fdm.GetProperty("position/lon-deg"); double roll = fdm.GetProperty("attitude/roll-rad"); // Send these to your OpenGL/Unreal engine } return 0; } JSBSim exposes a property tree via Socket or HTTP . Enable the socket server in your script: