]> git.mxchange.org Git - flightgear.git/commitdiff
Integrated autopilot.
authorcurt <curt>
Tue, 21 Apr 1998 16:59:33 +0000 (16:59 +0000)
committercurt <curt>
Tue, 21 Apr 1998 16:59:33 +0000 (16:59 +0000)
Prepairing for C++ integration.

FDM/flight.c
FDM/flight.h
LaRCsim/Makefile.am
LaRCsim/Makefile.in
LaRCsim/ls_interface.c
LaRCsim/ls_interface.h

index 9468e9932f2d181277923a34df0c58844c9e783b..fcca61c2384711380af951dc5d7c39ecc6d5c02a 100644 (file)
@@ -59,9 +59,7 @@ int fgFlightModelUpdate(int model, fgFLIGHT *f, int multiloop) {
     int result;
 
     if ( model == FG_LARCSIM ) {
-       fgFlight_2_LaRCsim(f);  /* translate FG to LaRCsim structure */
-       fgLaRCsimUpdate(multiloop);
-       fgLaRCsim_2_Flight(f);  /* translate LaRCsim back to FG structure */
+       fgLaRCsimUpdate(f, multiloop);
     } else {
        fgPrintf(FG_FLIGHT,FG_WARN,"Unimplemented flight model == %d\n", model);
     }
@@ -73,9 +71,13 @@ int fgFlightModelUpdate(int model, fgFLIGHT *f, int multiloop) {
 
 
 /* $Log$
-/* Revision 1.11  1998/04/18 04:14:04  curt
-/* Moved fg_debug.c to it's own library.
+/* Revision 1.12  1998/04/21 16:59:33  curt
+/* Integrated autopilot.
+/* Prepairing for C++ integration.
 /*
+ * Revision 1.11  1998/04/18 04:14:04  curt
+ * Moved fg_debug.c to it's own library.
+ *
  * Revision 1.10  1998/02/07 15:29:37  curt
  * Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
  * <chotchkiss@namg.us.anritsu.com>
index f27d42f8bfcecf9c2dae618fc4a85c6e7b64aa02..3ae17f8d890bdb7130d026d6881463152c407659 100644 (file)
 #define _FLIGHT_H
 
 
+#ifdef __cplusplus                                                          
+extern "C" {                            
+#endif                                   
+
+
 #include <Flight/Slew/slew.h>
 /* #include <Flight/LaRCsim/ls_interface.h> */
 
@@ -397,14 +402,23 @@ int fgFlightModelInit(int model, fgFLIGHT *f, double dt);
 int fgFlightModelUpdate(int model, fgFLIGHT *f, int multiloop);
 
 
+#ifdef __cplusplus
+}
+#endif
+
+
 #endif /* _FLIGHT_H */
 
 
 /* $Log$
-/* Revision 1.14  1998/02/07 15:29:37  curt
-/* Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
-/* <chotchkiss@namg.us.anritsu.com>
+/* Revision 1.15  1998/04/21 16:59:33  curt
+/* Integrated autopilot.
+/* Prepairing for C++ integration.
 /*
+ * Revision 1.14  1998/02/07 15:29:37  curt
+ * Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
+ * <chotchkiss@namg.us.anritsu.com>
+ *
  * Revision 1.13  1998/01/24 00:04:59  curt
  * misc. tweaks.
  *
index 4b9981a7a6217fe28404ed66691d624fb0b6e6e1..0a8d74b06916ed9f4f30610e64f3d3557ea33b87 100644 (file)
@@ -20,4 +20,4 @@ libLaRCsim_la_SOURCES = \
        navion_init.c navion_init.h \
        ls_interface.c ls_interface.h
 
-INCLUDES += -I$(top_builddir) -I$(top_builddir)/Simulator
+INCLUDES += -I$(top_builddir) -I$(top_builddir)/Lib -I$(top_builddir)/Simulator
index a5912d976d38ef873a0b0f7bf0b0701b145afb6e..f9bb848cf080b26d30d9304e72cf5103d5427aaa 100644 (file)
@@ -335,7 +335,7 @@ installdirs mostlyclean-generic distclean-generic clean-generic \
 maintainer-clean-generic clean mostlyclean distclean maintainer-clean
 
 
-INCLUDES += -I$(top_builddir) -I$(top_builddir)/Simulator
+INCLUDES += -I$(top_builddir) -I$(top_builddir)/Lib -I$(top_builddir)/Simulator
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
index 59feea8e687c43d5e9485eb6e9d141cacf43902a..95eb04fdc624ff379898781d8d0543df3839e615 100644 (file)
@@ -242,6 +242,9 @@ $Original log: LaRCsim.c,v $
 #include "ls_init.h"
 #include <Flight/flight.h>
 #include <Aircraft/aircraft.h>
+#include <Autopilot/autopilot.h>
+#include <Debug/fg_debug.h>
+
 
 /* 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
index 958968657567a981f7a9b6304269a71d24bf5d09..487dbcc6b77be48178bc410b1fdead1e65a6dba2 100644 (file)
@@ -36,7 +36,7 @@
 int fgLaRCsimInit(double dt);
 
 /* update position based on inputs, positions, velocities, etc. */
-int fgLaRCsimUpdate(int multiloop);
+int fgLaRCsimUpdate(fgFLIGHT *f, int multiloop);
 
 /* Convert from the fgFLIGHT struct to the LaRCsim generic_ struct */
 int fgFlight_2_LaRCsim (fgFLIGHT *f);
@@ -51,10 +51,14 @@ void ls_loop( SCALAR dt, int initialize );
 
 
 /* $Log$
-/* Revision 1.7  1998/02/07 15:29:39  curt
-/* Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
-/* <chotchkiss@namg.us.anritsu.com>
+/* Revision 1.8  1998/04/21 16:59:39  curt
+/* Integrated autopilot.
+/* Prepairing for C++ integration.
 /*
+ * Revision 1.7  1998/02/07 15:29:39  curt
+ * Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
+ * <chotchkiss@namg.us.anritsu.com>
+ *
  * Revision 1.6  1998/02/03 23:20:17  curt
  * Lots of little tweaks to fix various consistency problems discovered by
  * Solaris' CC.  Fixed a bug in fg_debug.c with how the fgPrintf() wrapper