]> git.mxchange.org Git - flightgear.git/commitdiff
Incorporated autopilot heading hold contributed by: Jeff Goeke-Smith
authorcurt <curt>
Tue, 14 Apr 1998 02:21:01 +0000 (02:21 +0000)
committercurt <curt>
Tue, 14 Apr 1998 02:21:01 +0000 (02:21 +0000)
<jgoeke@voyager.net>

Main/GLUTkey.c
Main/GLUTmain.c
Main/Makefile.am
Main/Makefile.in
Main/fg_init.c

index 38c4268aa534a24a48cb759b5a25024d7b7589ad..a513c01e1d37568fed814291ce86b647d0ba9086 100644 (file)
@@ -42,6 +42,7 @@
 #include <Include/fg_constants.h>
 
 #include <Aircraft/aircraft.h>
+#include <Autopilot/autopilot.h> // Added autopilot.h to list, Jeff Goeke-Smith
 #include <Weather/weather.h>
 
 
@@ -105,8 +106,17 @@ void GLUTkey(unsigned char k, int x, int y) {
        case 90: /* Z key */
            w->visibility /= 1.10;
            xglFogf(GL_FOG_END, w->visibility);
-           fgPrintf( FG_INPUT, FG_DEBUG, "Fog density = %.4f\n", w->visibility);
-           return;
+           fgPrintf( FG_INPUT, FG_DEBUG, 
+                     "Fog density = %.4f\n", w->visibility );
+           return;
+       // autopilot additions
+       case 65: /* A key */
+               fgAPSetMode(1);
+               return;
+       case 83: /* S key */
+               fgAPSetMode(0);
+               return;
+               
        }
     } else {
        fgPrintf( FG_INPUT, FG_DEBUG, "\n");
@@ -247,9 +257,13 @@ void GLUTspecialkey(int k, int x, int y) {
 
 
 /* $Log$
-/* Revision 1.31  1998/04/08 23:34:05  curt
-/* Patch from Durk to fix trim reversal with numlock key active.
+/* Revision 1.32  1998/04/14 02:21:01  curt
+/* Incorporated autopilot heading hold contributed by:  Jeff Goeke-Smith
+/* <jgoeke@voyager.net>
 /*
+ * Revision 1.31  1998/04/08 23:34:05  curt
+ * Patch from Durk to fix trim reversal with numlock key active.
+ *
  * Revision 1.30  1998/04/03 22:09:02  curt
  * Converting to Gnu autoconf system.
  *
index 0dd996cdefaacadf8dc76f14f9218a8a80389904..5d5b7395cff2581c076b38aa9e16945f98170b11 100644 (file)
@@ -57,6 +57,7 @@
 #include <Astro/sky.h>
 #include <Astro/stars.h>
 #include <Astro/sun.h>
+#include <Autopilot/autopilot.h>
 #include <Cockpit/cockpit.h>
 #include <Joystick/joystick.h>
 #include <Math/fg_geodesy.h>
@@ -248,7 +249,7 @@ static void fgUpdateViewParams( void ) {
        /* Tell GL we are about to modify the projection parameters */
        xglMatrixMode(GL_PROJECTION);
        xglLoadIdentity();
-       gluPerspective(45.0, 2.0/win_ratio, 1.0, 100000.0);
+       gluPerspective(65.0, 2.0/win_ratio, 1.0, 100000.0);
       }
     else
       {
@@ -256,7 +257,7 @@ static void fgUpdateViewParams( void ) {
        /* Tell GL we are about to modify the projection parameters */    
        xglMatrixMode(GL_PROJECTION);
        xglLoadIdentity();
-       gluPerspective(45.0, 1.0/win_ratio, 10.0, 100000.0);
+       gluPerspective(65.0, 1.0/win_ratio, 10.0, 100000.0);
       }
 
     xglMatrixMode(GL_MODELVIEW);
@@ -625,6 +626,18 @@ static void fgMainLoop( void ) {
     fgPrintf( FG_ALL, FG_BULK, 
              "Model iterations needed = %d, new remainder = %d\n", 
              multi_loop, remainder);
+       
+       //Insertion by Jeff Goeke-Smith for Autopilot.
+       // Where should this really go?  
+       // Maybe this should run in tandem with the Flight model.
+       
+       /* run Autopilot system */
+       fgPrintf( FG_ALL, FG_BULK,"Attempting autopilot run\n");
+                     
+       fgAPRun();
+       
+       // end of insertion 
+       
 
     /* Run flight model */
     if ( ! use_signals ) {
@@ -811,9 +824,13 @@ extern "C" {
 #endif
 
 /* $Log$
-/* Revision 1.69  1998/04/08 23:35:34  curt
-/* Tweaks to Gnu automake/autoconf system.
+/* Revision 1.70  1998/04/14 02:21:02  curt
+/* Incorporated autopilot heading hold contributed by:  Jeff Goeke-Smith
+/* <jgoeke@voyager.net>
 /*
+ * Revision 1.69  1998/04/08 23:35:34  curt
+ * Tweaks to Gnu automake/autoconf system.
+ *
  * Revision 1.68  1998/04/03 22:09:03  curt
  * Converting to Gnu autoconf system.
  *
index c6ac62072d9931d8fcca6fb263ee02cb259c0b10..46bd1aa744c14b2310ba621c72a82f862475260b 100644 (file)
@@ -16,16 +16,21 @@ fg_SOURCES = \
 fg_LDADD = \
        $(top_builddir)/Simulator/Aircraft/libAircraft.la \
        $(top_builddir)/Simulator/Astro/libAstro.la \
+       $(top_builddir)/Simulator/Autopilot/libAutopilot.la \
        $(top_builddir)/Simulator/Cockpit/libCockpit.la \
        $(top_builddir)/Simulator/Controls/libControls.la \
        $(top_builddir)/Simulator/Flight/libFlight.la \
        $(top_builddir)/Simulator/Flight/LaRCsim/libLaRCsim.la \
        $(top_builddir)/Simulator/Flight/Slew/libSlew.la \
        $(top_builddir)/Simulator/Scenery/libScenery.la \
-       $(top_builddir)/Simulator/Scenery/Bucket/libBucket.la \
        $(top_builddir)/Simulator/Time/libTime.la \
        $(top_builddir)/Simulator/Weather/libWeather.la \
         $(top_builddir)/Simulator/Joystick/libJoystick.la \
-       $(top_builddir)/Simulator/Math/libMath.la
+       $(top_builddir)/Simulator/Math/libMath.la \
+       $(top_builddir)/Lib/Bucket/libBucket.la
 
-INCLUDES += -I.. -DGLUT
+INCLUDES += \
+       -DGLUT \
+       -I$(top_builddir) \
+       -I$(top_builddir)/Lib \
+       -I$(top_builddir)/Simulator
index 289ac5db7929668fc5700e1ec3624411b251b595..a22f5960c113d45e96979d8941e43bb9b3ef9bba 100644 (file)
@@ -89,24 +89,25 @@ fg_SOURCES = \
 fg_LDADD = \
        $(top_builddir)/Simulator/Aircraft/libAircraft.la \
        $(top_builddir)/Simulator/Astro/libAstro.la \
+       $(top_builddir)/Simulator/Autopilot/libAutopilot.la \
        $(top_builddir)/Simulator/Cockpit/libCockpit.la \
        $(top_builddir)/Simulator/Controls/libControls.la \
        $(top_builddir)/Simulator/Flight/libFlight.la \
        $(top_builddir)/Simulator/Flight/LaRCsim/libLaRCsim.la \
        $(top_builddir)/Simulator/Flight/Slew/libSlew.la \
        $(top_builddir)/Simulator/Scenery/libScenery.la \
-       $(top_builddir)/Simulator/Scenery/Bucket/libBucket.la \
        $(top_builddir)/Simulator/Time/libTime.la \
        $(top_builddir)/Simulator/Weather/libWeather.la \
         $(top_builddir)/Simulator/Joystick/libJoystick.la \
-       $(top_builddir)/Simulator/Math/libMath.la
+       $(top_builddir)/Simulator/Math/libMath.la \
+       $(top_builddir)/Lib/Bucket/libBucket.la
 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
-CONFIG_HEADER = ../../Simulator/Include/config.h
+CONFIG_HEADER = ../../Include/config.h
 CONFIG_CLEAN_FILES =  runfg runfg.bat
 PROGRAMS =  $(bin_PROGRAMS)
 
 
-DEFS = @DEFS@ -I. -I$(srcdir) -I../../Simulator/Include
+DEFS = @DEFS@ -I. -I$(srcdir) -I../../Include
 CPPFLAGS = @CPPFLAGS@
 LDFLAGS = @LDFLAGS@
 LIBS = @LIBS@
@@ -118,17 +119,18 @@ fg_OBJECTS =  GLUTkey.o GLUTmain.o fg_debug.o fg_getopt.o fg_init.o \
 views.o
 fg_DEPENDENCIES =  $(top_builddir)/Simulator/Aircraft/libAircraft.la \
 $(top_builddir)/Simulator/Astro/libAstro.la \
+$(top_builddir)/Simulator/Autopilot/libAutopilot.la \
 $(top_builddir)/Simulator/Cockpit/libCockpit.la \
 $(top_builddir)/Simulator/Controls/libControls.la \
 $(top_builddir)/Simulator/Flight/libFlight.la \
 $(top_builddir)/Simulator/Flight/LaRCsim/libLaRCsim.la \
 $(top_builddir)/Simulator/Flight/Slew/libSlew.la \
 $(top_builddir)/Simulator/Scenery/libScenery.la \
-$(top_builddir)/Simulator/Scenery/Bucket/libBucket.la \
 $(top_builddir)/Simulator/Time/libTime.la \
 $(top_builddir)/Simulator/Weather/libWeather.la \
 $(top_builddir)/Simulator/Joystick/libJoystick.la \
-$(top_builddir)/Simulator/Math/libMath.la
+$(top_builddir)/Simulator/Math/libMath.la \
+$(top_builddir)/Lib/Bucket/libBucket.la
 fg_LDFLAGS = 
 SCRIPTS =  $(bin_SCRIPTS)
 
@@ -377,7 +379,11 @@ distclean-generic clean-generic maintainer-clean-generic clean \
 mostlyclean distclean maintainer-clean
 
 
-INCLUDES += -I.. -DGLUT
+INCLUDES += \
+       -DGLUT \
+       -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 479a3b09f4261c077ee0debd3f26a66dc06a5eb1..95201d543e0d01d96676c5475c968f2c3007186a 100644 (file)
@@ -42,6 +42,7 @@
 #include <Astro/sky.h>
 #include <Astro/stars.h>
 #include <Astro/sun.h>
+#include <Autopilot/autopilot.h>
 #include <Cockpit/cockpit.h>
 #include <Joystick/joystick.h>
 #include <Math/fg_random.h>
@@ -227,10 +228,10 @@ int fgInitSubsystems( void ) {
     // FG_Altitude = FG_Runway_altitude + 3.758099;
 
     // Test Position
-    // FG_Longitude = ( -139.5 ) * DEG_TO_RAD;
-    // FG_Latitude  = (  -9.5 ) * DEG_TO_RAD;
-    // FG_Runway_altitude = 13000.0 * METER_TO_FEET;
-    // FG_Altitude = FG_Runway_altitude + 3.758099;
+    FG_Longitude = ( -113.5 ) * DEG_TO_RAD;
+    FG_Latitude  = (   33.5 ) * DEG_TO_RAD;
+    FG_Runway_altitude = 8000.0;
+    FG_Altitude = FG_Runway_altitude + 3.758099;
 
     // A random test position
     // FG_Longitude = ( 88128.00 / 3600.0 ) * DEG_TO_RAD;
@@ -390,6 +391,10 @@ int fgInitSubsystems( void ) {
        fgPrintf( FG_GENERAL, FG_EXIT, "Error in Joystick initialization!\n" );
     }
 
+       /// Autopilot init added here, by Jeff Goeke-Smith
+       fgAPInit(&current_aircraft);
+       // end added section;
+    
     // One more try here to get the sky synced up
     fgSkyColorsInit();
     ret_val = 0;
@@ -400,9 +405,13 @@ int fgInitSubsystems( void ) {
 
 
 /* $Log$
-/* Revision 1.54  1998/04/08 23:35:36  curt
-/* Tweaks to Gnu automake/autoconf system.
+/* Revision 1.55  1998/04/14 02:21:03  curt
+/* Incorporated autopilot heading hold contributed by:  Jeff Goeke-Smith
+/* <jgoeke@voyager.net>
 /*
+ * Revision 1.54  1998/04/08 23:35:36  curt
+ * Tweaks to Gnu automake/autoconf system.
+ *
  * Revision 1.53  1998/04/03 22:09:06  curt
  * Converting to Gnu autoconf system.
  *