X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=LaRCsim%2Fls_interface.c;h=95eb04fdc624ff379898781d8d0543df3839e615;hb=e2ddc6f2b8958eeaecba3e4dcc55204ea0e58305;hp=59feea8e687c43d5e9485eb6e9d141cacf43902a;hpb=7d39aa3777a0028ff7e27805156448e9ab0398cf;p=flightgear.git diff --git a/LaRCsim/ls_interface.c b/LaRCsim/ls_interface.c index 59feea8e6..95eb04fdc 100644 --- a/LaRCsim/ls_interface.c +++ b/LaRCsim/ls_interface.c @@ -242,6 +242,9 @@ $Original log: LaRCsim.c,v $ #include "ls_init.h" #include #include +#include +#include + /* global variable declarations */ @@ -545,15 +548,32 @@ int fgLaRCsimInit(double dt) { /* Run an iteration of the EOM (equations of motion) */ -int fgLaRCsimUpdate(int multiloop) { +int fgLaRCsimUpdate(fgFLIGHT *f, int multiloop) { int i; if (speedup > 0) { ls_cockpit(); } + // translate FG to LaRCsim structure + fgFlight_2_LaRCsim(f); + for ( i = 0; i < multiloop; i++ ) { + //Insertion by Jeff Goeke-Smith for Autopilot. + + // run Autopilot system + fgPrintf( FG_ALL, FG_BULK,"Attempting autopilot run\n"); + + fgAPRun(); + + // end of insertion + ls_loop( model_dt, 0); + + // translate LaRCsim back to FG structure so that the + // autopilot (and the rest of the sim can use the updated + // values + fgLaRCsim_2_Flight(f); } return(1); @@ -914,6 +934,10 @@ int fgLaRCsim_2_Flight (fgFLIGHT *f) { /* Flight Gear Modification Log * * $Log$ + * Revision 1.18 1998/04/21 16:59:38 curt + * Integrated autopilot. + * Prepairing for C++ integration. + * * Revision 1.17 1998/02/23 19:07:58 curt * Incorporated Durk's Astro/ tweaks. Includes unifying the sun position * calculation code between sun display, and other FG sections that use this