]> git.mxchange.org Git - flightgear.git/commitdiff
Removed some printf()'s.
authorcurt <curt>
Sun, 12 Jul 1998 03:11:03 +0000 (03:11 +0000)
committercurt <curt>
Sun, 12 Jul 1998 03:11:03 +0000 (03:11 +0000)
Fixed the autopilot integration so it should be able to update it's control
  positions every time the internal flight model loop is run, and not just
  once per rendered frame.
Added a routine to do the necessary stuff to force an arbitrary altitude
  change.
Gave the Navion engine just a tad more power.

LaRCsim/ls_init.c
LaRCsim/ls_interface.c
LaRCsim/ls_interface.h
LaRCsim/ls_step.c
LaRCsim/navion_engine.c

index b563e64688cf56bf617819f130a535107fbe6791..7550764468691156c2e2044a636783f191da1d9e 100644 (file)
 
 $Header$
 $Log$
+Revision 1.5  1998/07/12 03:11:03  curt
+Removed some printf()'s.
+Fixed the autopilot integration so it should be able to update it's control
+  positions every time the internal flight model loop is run, and not just
+  once per rendered frame.
+Added a routine to do the necessary stuff to force an arbitrary altitude
+  change.
+Gave the Navion engine just a tad more power.
+
 Revision 1.4  1998/01/19 18:40:26  curt
 Tons of little changes to clean up the code and to remove fatal errors
 when building with the c++ compiler.
@@ -190,11 +199,12 @@ void ls_init( void ) {
 
     Simtime = 0;
 
-    printf("LS in init() pos = %.2f\n", Latitude);
+    /* printf("LS in init() pos = %.2f\n", Latitude); */
 
     ls_init_init();
 
-    printf("LS after init_init() pos = %.2f\n", Latitude);
+    /* printf("LS after init_init() pos = %.2f\n", Latitude); */
+
     /* move the states to proper values */
 
     /* commented out by CLO
@@ -211,11 +221,11 @@ void ls_init( void ) {
   
     model_init();
 
-    printf("LS after model_init() pos = %.2f\n", Latitude);
+    /* printf("LS after model_init() pos = %.2f\n", Latitude); */
 
     ls_step(0.0, -1);
 
-    printf("LS after ls_step() pos = %.2f\n", Latitude);
+    /* printf("LS after ls_step() pos = %.2f\n", Latitude); */
 }
 
 
index cc4fb82d59a7eacb77232a2283d963f786b4d3b5..06c025de2d9e0c0d38d6386ed704e2eb8fa9e225 100644 (file)
@@ -532,11 +532,11 @@ int fgLaRCsimInit(double dt) {
        return 1;
     }
 
-    printf("LS pre Init pos = %.2f\n", Latitude);
+    /* printf("LS pre Init pos = %.2f\n", Latitude); */
 
     ls_init();
 
-    printf("LS post Init pos = %.2f\n", Latitude);
+    /* printf("LS post Init pos = %.2f\n", Latitude); */
 
     if (speedup > 0) {
        /* Initialize (get) cockpit (controls) settings */
@@ -555,9 +555,6 @@ int fgLaRCsimUpdate(fgFLIGHT *f, int multiloop) {
        ls_cockpit();
     }
 
-    // translate FG to LaRCsim structure
-    fgFlight_2_LaRCsim(f);
-
     for ( i = 0; i < multiloop; i++ ) {
        //Insertion by Jeff Goeke-Smith for Autopilot.
        
@@ -565,11 +562,19 @@ int fgLaRCsimUpdate(fgFLIGHT *f, int multiloop) {
        // fgPrintf( FG_ALL, FG_BULK, "Attempting autopilot run\n");
                      
        fgAPRun();
-       
+       // 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 
        
        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
@@ -931,9 +936,27 @@ int fgLaRCsim_2_Flight (fgFLIGHT *f) {
     return ( 0 );
 }
 
+
+/* Set the altitude (force) */
+int ls_ForceAltitude(double alt_feet) {
+    Altitude = alt_feet;
+    ls_geod_to_geoc( Latitude, Altitude, &Sea_level_radius, &Lat_geocentric);
+    Radius_to_vehicle = Altitude + Sea_level_radius;
+}
+
+
 /* Flight Gear Modification Log
  *
  * $Log$
+ * Revision 1.20  1998/07/12 03:11:03  curt
+ * Removed some printf()'s.
+ * Fixed the autopilot integration so it should be able to update it's control
+ *   positions every time the internal flight model loop is run, and not just
+ *   once per rendered frame.
+ * Added a routine to do the necessary stuff to force an arbitrary altitude
+ *   change.
+ * Gave the Navion engine just a tad more power.
+ *
  * Revision 1.19  1998/05/11 18:17:28  curt
  * Output message tweaking.
  *
index 487dbcc6b77be48178bc410b1fdead1e65a6dba2..b1756ffeeb68f65af3e6194110a5bfc2b31141b2 100644 (file)
@@ -46,15 +46,27 @@ int fgLaRCsim_2_Flight (fgFLIGHT *f);
 
 void ls_loop( SCALAR dt, int initialize );
 
+/* Set the altitude (force) */
+int ls_ForceAltitude(double alt_feet);
+
 
 #endif /* _LS_INTERFACE_H */
 
 
 /* $Log$
-/* Revision 1.8  1998/04/21 16:59:39  curt
-/* Integrated autopilot.
-/* Prepairing for C++ integration.
+/* Revision 1.9  1998/07/12 03:11:04  curt
+/* Removed some printf()'s.
+/* Fixed the autopilot integration so it should be able to update it's control
+/*   positions every time the internal flight model loop is run, and not just
+/*   once per rendered frame.
+/* Added a routine to do the necessary stuff to force an arbitrary altitude
+/*   change.
+/* Gave the Navion engine just a tad more power.
 /*
+ * 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>
index a58de794a6585a9d7c035daacfd7be98a7462e19..66f0ca23011183f389247106f0099bbf17a7ee86 100644 (file)
 
 $Header$
 $Log$
+Revision 1.3  1998/07/12 03:11:04  curt
+Removed some printf()'s.
+Fixed the autopilot integration so it should be able to update it's control
+  positions every time the internal flight model loop is run, and not just
+  once per rendered frame.
+Added a routine to do the necessary stuff to force an arbitrary altitude
+  change.
+Gave the Navion engine just a tad more power.
+
 Revision 1.2  1998/01/19 18:40:28  curt
 Tons of little changes to clean up the code and to remove fatal errors
 when building with the c++ compiler.
@@ -144,7 +153,7 @@ void ls_step( SCALAR dt, int Initialize ) {
        e_dot_0_past = e_dot_1_past = e_dot_2_past = e_dot_3_past = 0;
        
 /* Initialize geocentric position from geodetic latitude and altitude */
-       
+
        ls_geod_to_geoc( Latitude, Altitude, &Sea_level_radius, &Lat_geocentric);
        Earth_position_angle = 0;
        Lon_geocentric = Longitude;
index f84361f8b1fdab942a5cbbd2f4ccecc96fe0c2ae..d1ae9018ee8d8337c16ed4ca1f013a92739bdd84 100644 (file)
@@ -73,8 +73,8 @@ void engine( SCALAR dt, int init ) {
 
     /* F_X_engine = Throttle[3]*813.4/0.2; */  /* original code */
     /* F_Z_engine = Throttle[3]*11.36/0.2; */  /* original code */
-    F_X_engine = Throttle[3]*813.4/0.85;
-    F_Z_engine = Throttle[3]*11.36/0.85;
+    F_X_engine = Throttle[3]*813.4/0.83;
+    F_Z_engine = Throttle[3]*11.36/0.83;
 
     Throttle_pct = Throttle[3];
 }