]> git.mxchange.org Git - flightgear.git/commitdiff
Added a brake + autopilot mods.
authorcurt <curt>
Tue, 29 Sep 1998 02:02:59 +0000 (02:02 +0000)
committercurt <curt>
Tue, 29 Sep 1998 02:02:59 +0000 (02:02 +0000)
LaRCsim/ls_interface.c
LaRCsim/navion_gear.c

index 4017b7c935fe5efff4397a9fa39be1f92e9628b4..f0165eca509ef994091f057bf7c3477178b53e90 100644 (file)
@@ -240,9 +240,9 @@ $Original log: LaRCsim.c,v $
 #include "ls_aux.h"
 #include "ls_model.h"
 #include "ls_init.h"
+
 #include <Flight/flight.h>
 #include <Aircraft/aircraft.h>
-#include <Autopilot/autopilot.h>
 #include <Debug/fg_debug.h>
 
 
@@ -556,44 +556,36 @@ int fgLaRCsimUpdate(fgFLIGHT *f, int multiloop) {
        ls_cockpit();
     }
 
-    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();
-
-       /* lets try to avoid really screwing up the LaRCsim model */
-       if ( FG_Altitude < -9000 ) {
-           save_alt = FG_Altitude;
-           FG_Altitude = 0;
-       }
+    /* lets try to avoid really screwing up the LaRCsim model */
+    if ( FG_Altitude < -9000 ) {
+       save_alt = FG_Altitude;
+       FG_Altitude = 0;
+    }
 
-       // translate FG to LaRCsim structure
-       fgFlight_2_LaRCsim(f);
-       // printf("FG_Altitude = %.2f\n", FG_Altitude * 0.3048);
-       // printf("Altitude = %.2f\n", Altitude * 0.3048);
-       // printf("Radius to Vehicle = %.2f\n", Radius_to_vehicle * 0.3048);
+    // translate FG to LaRCsim structure
+    fgFlight_2_LaRCsim(f);
+    // printf("FG_Altitude = %.2f\n", FG_Altitude * 0.3048);
+    // printf("Altitude = %.2f\n", Altitude * 0.3048);
+    // printf("Radius to Vehicle = %.2f\n", Radius_to_vehicle * 0.3048);
 
-       // end of insertion 
-       
+    for ( i = 0; i < multiloop; i++ ) {
        ls_loop( model_dt, 0);
+    }
 
-       // printf("%d FG_Altitude = %.2f\n", i, FG_Altitude * 0.3048);
-       // printf("%d Altitude = %.2f\n", i, Altitude * 0.3048);
-
-       // 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);
-
-       /* but lets restore our original bogus altitude when we are done */
-       if ( save_alt < -9000 ) {
-           FG_Altitude = save_alt;
-       }
+    // printf("%d FG_Altitude = %.2f\n", i, FG_Altitude * 0.3048);
+    // printf("%d Altitude = %.2f\n", i, Altitude * 0.3048);
+    
+    // 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);
+
+    /* but lets restore our original bogus altitude when we are done */
+    if ( save_alt < -9000 ) {
+       FG_Altitude = save_alt;
     }
 
-    return(1);
+    return 1;
 }
 
 
@@ -960,7 +952,10 @@ int ls_ForceAltitude(double alt_feet) {
 /* Flight Gear Modification Log
  *
  * $Log$
- * Revision 1.21  1998/08/22 14:49:56  curt
+ * Revision 1.22  1998/09/29 02:02:59  curt
+ * Added a brake + autopilot mods.
+ *
+ * Revision 1.21  1998/08/22  14:49:56  curt
  * Attempting to iron out seg faults and crashes.
  * Did some shuffling to fix a initialization order problem between view
  * position, scenery elevation.
index 580c4f76d8394e98a1793f9a5d6da0956926d03f..0fd31803d5db838eb2f022a69f2e1769556ace5a 100644 (file)
@@ -36,6 +36,9 @@
 
 $Header$
 $Log$
+Revision 1.5  1998/09/29 02:03:00  curt
+Added a brake + autopilot mods.
+
 Revision 1.4  1998/08/06 12:46:40  curt
 Header change.
 
@@ -80,6 +83,7 @@ Initial Flight Gear revision.
 #include "ls_generic.h"
 #include "ls_cockpit.h"
 
+#include <Controls/controls.h>
 
 void sub3( DATA v1[],  DATA v2[], DATA result[] )
 {
@@ -207,7 +211,7 @@ char rcsid[] = "$Id$";
    * Put aircraft specific executable code here
    */
    
-    percent_brake[1] = 0.; /* replace with cockpit brake handle connection code */
+    percent_brake[1] = fgBrakeGet(); /* replace with cockpit brake handle connection code */
     percent_brake[2] = percent_brake[1];
     
     caster_angle_rad[0] = 0.03*Rudder_pedal;