1 /**************************************************************************
2 * ls_interface.c -- the FG interface to the LaRCsim routines
3 * This is a heavily modified version of LaRCsim.c
4 * As a result there is much old baggage left in this file.
6 * Originally Written 921230 by Bruce Jackson
7 * Modified by Curtis Olson, started May 1997.
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License as
11 * published by the Free Software Foundation; either version 2 of the
12 * License, or (at your option) any later version.
14 * This program is distributed in the hope that it will be useful, but
15 * WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 * (Log is kept at end of this file)
25 **************************************************************************/
27 /* Original headers follow: */
29 /***************************************************************************
33 ----------------------------------------------------------------------------
35 FUNCTION: Top level routine for LaRCSIM. Includes
36 global variable declarations.
38 ----------------------------------------------------------------------------
40 MODULE STATUS: Developmental
42 ----------------------------------------------------------------------------
44 GENEALOGY: Written 921230 by Bruce Jackson
46 ----------------------------------------------------------------------------
54 ----------------------------------------------------------------------------
60 930111 Added "progname" variable to keep name of invoking command.
62 931012 Removed altitude < 0. test to support gear development. EBJ
63 931214 Added various pressures (Impact, Dynamic, Static, etc.) EBJ
64 931215 Adopted new generic variable structure. EBJ
65 931218 Added command line options decoding. EBJ
66 940110 Changed file type of matrix file to ".m" EBJ
67 940513 Renamed this routine "LaRCsim.c" from "ls_main.c" EBJ
68 940513 Added time_stamp routine, t_stamp. EBJ
69 950225 Added options flag, 'i', to set I/O output rate. EBJ
70 950306 Added calls to ls_get_settings() and ls_put_settings() EBJ
71 950314 Options flag 'i' now reads IC file; 'o' is output rate EBJ
72 950406 Many changes: added definition of default value macros;
73 removed local variables term_update_hz, model_dt, endtime,
74 substituted sim_control_ globals for these; removed
75 initialization of sim_control_.tape_channels; moved optarg
76 to generic extern; added mod_end_time & mod_buf_size flags
77 and temporary buffer_time and data_rate locals to
78 ls_checkopts(); added additional command line switches '-s'
79 and '-b'; made psuedo-mandatory file names for data output
80 switches; considerable rewrite of logic for setting data
81 buffer length and interleave parameters; updated '-h' help
82 output message; added protection logic to calculations of
83 these parameters; added check of return value on first call
84 to ls_cockpit() so <esc> abort works from initial pause
85 state; added call to ls_unsync() immediately following
86 first ls_sync() call, if paused (to avoid alarm clock
87 timeout); moved call to ls_record() into non-paused
88 multiloop path (was filling buffer with identical data
89 during pause); put check of paused flag before calling sync
90 routine ls_pause(); and added call to exit() on termination.
94 $Original log: LaRCsim.c,v $
95 * Revision 1.4.1.7 1995/04/07 01:04:37 bjax
96 * Many changes made to support storage of sim options from run to run,
97 * as well as restructuring storage buffer sizing and some loop logic
98 * changes. See the modification log for details.
100 * Revision 1.4.1.6 1995/03/29 16:12:09 bjax
101 * Added argument to -o switch; changed run loop to pass dt=0
102 * if in paused mode. EBj
104 * Revision 1.4.1.5 1995/03/15 12:30:20 bjax
105 * Set paused flag to non-zero by default; moved 'i' I/O rate flag
106 * switch to 'o'; made 'i' an initial conditions file switch; added
107 * null string to ls_get_settings() call so that default settings
108 * file will be read. EBJ
110 * Revision 1.4.1.4 1995/03/08 12:31:34 bjax
111 * Added userid retrieval and proper termination of time & date strings.
113 * Revision 1.4.1.3 1995/03/08 12:00:21 bjax
114 * Moved setting of default options to ls_setdefopts from
115 * ls_checkopts; rearranged order of ls_get_settings() call
116 * to between ls_setdefopts and ls_checkopts, so command
117 * line options will override settings file options.
120 * Revision 1.4.1.2 1995/03/06 18:48:49 bjax
121 * Added calles to ls_get_settings() and ls_put_settings(); added
122 * passing of dt and init flags in ls_model(). EBJ
124 * Revision 1.4.1.1 1995/03/03 02:23:08 bjax
125 * Beta version for LaRCsim, version 1.4
127 * Revision 1.3.2.7 1995/02/27 20:00:21 bjax
130 * Revision 1.3.2.6 1995/02/25 16:52:31 bjax
131 * Added 'i' option to set I/O iteration rate. EBJ
133 * Revision 1.3.2.5 1995/02/06 19:33:15 bjax
136 * Revision 1.3.2.4 1995/02/06 19:30:30 bjax
137 * Oops, should really compile these before checking in. Fixed capitailzation of
138 * Initialize in ls_loop parameter.
140 * Revision 1.3.2.3 1995/02/06 19:25:44 bjax
141 * Moved main simulation loop into subroutine ls_loop. EBJ
143 * Revision 1.3.2.2 1994/05/20 21:46:45 bjax
144 * A little better logic on checking for option arguments.
146 * Revision 1.3.2.1 1994/05/20 19:29:51 bjax
147 * Added options arguments to command line.
149 * Revision 1.3.1.16 1994/05/17 15:08:45 bjax
150 * Corrected so that full name to directyr and file is saved
151 * in new global variable "fullname"; this allows symbol table
152 * to be extracted when in another default directory.
154 * Revision 1.3.1.15 1994/05/17 14:50:24 bjax
157 * Revision 1.3.1.14 1994/05/17 14:50:23 bjax
160 * Revision 1.3.1.13 1994/05/17 14:50:21 bjax
163 * Revision 1.3.1.12 1994/05/17 14:50:20 bjax
166 * Revision 1.3.1.11 1994/05/17 13:56:24 bjax
169 * Revision 1.3.1.10 1994/05/17 13:23:03 bjax
172 * Revision 1.3.1.9 1994/05/17 13:20:03 bjax
175 * Revision 1.3.1.8 1994/05/17 13:19:23 bjax
178 * Revision 1.3.1.7 1994/05/17 13:18:29 bjax
181 * Revision 1.3.1.6 1994/05/17 13:16:30 bjax
184 * Revision 1.3.1.5 1994/05/17 13:03:44 bjax
187 * Revision 1.3.1.4 1994/05/17 13:03:38 bjax
190 * Revision 1.3.1.3 1994/05/17 12:49:08 bjax
193 * Revision 1.3.1.2 1994/05/17 12:48:45 bjax
194 * *** empty log message ***
196 * Revision 1.3.1.1 1994/05/13 20:39:17 bjax
199 * Revision 1.2 1994/05/13 19:51:50 bjax
203 ----------------------------------------------------------------------------
207 ----------------------------------------------------------------------------
211 ----------------------------------------------------------------------------
215 ----------------------------------------------------------------------------
219 ----------------------------------------------------------------------------
223 --------------------------------------------------------------------------*/
225 #include <sys/types.h>
226 /* #include <sys/stat.h> */
232 #include "ls_types.h"
233 #include "ls_constants.h"
234 #include "ls_generic.h"
235 #include "ls_sim_control.h"
236 #include "ls_cockpit.h"
237 #include "ls_interface.h"
239 #include "ls_accel.h"
241 #include "ls_model.h"
243 #include <Flight/flight.h>
244 #include <Aircraft/aircraft.h>
245 #include <Autopilot/autopilot.h>
246 #include <Debug/fg_debug.h>
249 /* global variable declarations */
253 SIM_CONTROL sim_control_;
258 #define DEFAULT_TERM_UPDATE_HZ 20
259 #define DEFAULT_MODEL_HZ 120
260 #define DEFAULT_END_TIME 3600.
261 #define DEFAULT_SAVE_SPACING 8
262 #define DEFAULT_WRITE_SPACING 1
263 #define MAX_FILE_NAME_LENGTH 80
265 /* global variables */
270 /* file variables - default simulation settings */
272 static double model_dt;
273 static double speedup;
274 static char asc1name[MAX_FILE_NAME_LENGTH] = "run.asc1";
275 static char tabname[MAX_FILE_NAME_LENGTH] = "run.dat";
276 static char fltname[MAX_FILE_NAME_LENGTH] = "run.flt";
277 static char matname[MAX_FILE_NAME_LENGTH] = "run.m";
281 void ls_stamp( void ) {
282 char rcsid[] = "$Id$";
283 char revid[] = "$Revision$";
284 char dateid[] = "$Date$";
289 /* report version of LaRCsim*/
290 printf("\nLaRCsim %s, %s\n\n", revid, dateid);
292 nowtime_t = time( 0 );
293 nowtime = localtime( &nowtime_t ); /* set fields to correct time values */
294 date = (nowtime->tm_year)*10000
295 + (nowtime->tm_mon + 1)*100
296 + (nowtime->tm_mday);
297 sprintf(sim_control_.date_string, "%06d\0", date);
298 sprintf(sim_control_.time_stamp, "%02d:%02d:%02d\0",
299 nowtime->tm_hour, nowtime->tm_min, nowtime->tm_sec);
300 #ifdef COMPILE_THIS_CODE_THIS_USELESS_CODE
301 cuserid( sim_control_.userid ); /* set up user id */
302 #endif /* COMPILE_THIS_CODE_THIS_USELESS_CODE */
306 void ls_setdefopts( void ) {
307 /* set default values for most options */
309 sim_control_.debug = 0; /* change to non-zero if in dbx! */
310 sim_control_.vision = 0;
311 sim_control_.write_av = 0; /* write Agile-Vu '.flt' file */
312 sim_control_.write_mat = 0; /* write matrix-x/matlab script */
313 sim_control_.write_tab = 0; /* write tab delim. history file */
314 sim_control_.write_asc1 = 0; /* write GetData file */
315 sim_control_.save_spacing = DEFAULT_SAVE_SPACING;
316 /* interpolation on recording */
317 sim_control_.write_spacing = DEFAULT_WRITE_SPACING;
318 /* interpolation on output */
319 sim_control_.end_time = DEFAULT_END_TIME;
320 sim_control_.model_hz = DEFAULT_MODEL_HZ;
321 sim_control_.term_update_hz = DEFAULT_TERM_UPDATE_HZ;
322 sim_control_.time_slices = (long int)(DEFAULT_END_TIME * DEFAULT_MODEL_HZ /
323 DEFAULT_SAVE_SPACING);
324 sim_control_.paused = 0;
330 /* return result codes from ls_checkopts */
335 #ifdef COMPILE_THIS_CODE_THIS_USELESS_CODE
340 int ls_checkopts(argc, argv) /* check and set options flags */
346 int mod_end_time = 0;
347 int mod_buf_size = 0;
348 float buffer_time, data_rate;
350 /* set default values */
352 buffer_time = sim_control_.time_slices * sim_control_.save_spacing /
353 sim_control_.model_hz;
354 data_rate = sim_control_.model_hz / sim_control_.save_spacing;
356 while ((c = getopt(argc, argv, "Aa:b:de:f:hi:kmo:r:s:t:x:")) != EOF)
359 if (sim_control_.sim_type == GLmouse)
361 fprintf(stderr, "Cannot specify both keyboard (k) and ACES (A) cockpits option\n");
362 fprintf(stderr, "Keyboard operation assumed.\n");
365 sim_control_.sim_type = cockpit;
368 sim_control_.write_av = 1;
371 strncpy(fltname, optarg, MAX_FILE_NAME_LENGTH);
376 buffer_time = atof(optarg);
377 if (buffer_time <= 0.) opt_err = -1;
381 sim_control_.debug = 1;
384 sim_control_.end_time = atof(optarg);
388 sim_control_.model_hz = atof(optarg);
394 /* ls_get_settings( optarg ); */
397 sim_control_.sim_type = GLmouse;
400 sim_control_.vision = 1;
403 sim_control_.term_update_hz = atof(optarg);
404 if (sim_control_.term_update_hz <= 0.) opt_err = 1;
407 sim_control_.write_mat = 1;
410 strncpy(matname, optarg, MAX_FILE_NAME_LENGTH);
415 data_rate = atof(optarg);
416 if (data_rate <= 0.) opt_err = -1;
419 sim_control_.write_tab = 1;
422 strncpy(tabname, optarg, MAX_FILE_NAME_LENGTH);
427 sim_control_.write_asc1 = 1;
430 strncpy(asc1name, optarg, MAX_FILE_NAME_LENGTH);
441 fprintf(stderr, "Usage: %s [-options]\n", progname);
442 fprintf(stderr, "\n");
443 fprintf(stderr, " where [-options] is zero or more of the following:\n");
444 fprintf(stderr, "\n");
445 fprintf(stderr, " [A|k] Run mode: [A]CES cockpit [default]\n");
446 fprintf(stderr, " or [k]eyboard\n");
447 fprintf(stderr, "\n");
448 fprintf(stderr, " [i <filename>] [i]nitial conditions filename\n");
449 fprintf(stderr, "\n");
450 fprintf(stderr, " [f <value>] Iteration rate [f]requency, Hz (default is %5.2f Hz)\n",
451 sim_control_.model_hz);
452 fprintf(stderr, "\n");
453 fprintf(stderr, " [o <value>] Display [o]utput frequency, Hz (default is %5.2f Hz)\n",
454 sim_control_.term_update_hz);
455 fprintf(stderr, "\n");
456 fprintf(stderr, " [s <value>] Data storage frequency, Hz (default is %5.2f Hz)\n",
458 fprintf(stderr, "\n");
459 fprintf(stderr, " [e <value>] [e]nd time in seconds (default %5.1f seconds)\n",
460 sim_control_.end_time);
461 fprintf(stderr, "\n");
462 fprintf(stderr, " [b <value>] circular time history storage [b]uffer size, in seconds \n");
463 fprintf(stderr, " (default %5.1f seconds) (normally same as end time)\n",
464 sim_control_.time_slices*sim_control_.save_spacing/
465 sim_control_.model_hz);
466 fprintf(stderr, "\n");
467 fprintf(stderr, " [atxr [<filename>]] Output: [a]gile-vu (default name: %s )\n", fltname);
468 fprintf(stderr, " and/or [t]ab delimited ( '' name: %s )\n", tabname);
469 fprintf(stderr, " and/or [x]plot (default name: %s)\n", asc1name);
470 fprintf(stderr, " and/or mat[r]ix script ( '' name: %s )\n", matname);
471 fprintf(stderr, "\n");
475 /* calculate additional controls */
477 sim_control_.save_spacing = (int) (0.5 + sim_control_.model_hz / data_rate);
478 if (sim_control_.save_spacing < 1) sim_control_.save_spacing = 1;
480 sim_control_.time_slices = buffer_time * sim_control_.model_hz /
481 sim_control_.save_spacing;
482 if (sim_control_.time_slices < 2) sim_control_.time_slices = 2;
486 #endif /* COMPILE_THIS_CODE_THIS_USELESS_CODE */
489 void ls_loop( SCALAR dt, int initialize ) {
490 /* printf (" In ls_loop()\n"); */
491 ls_step( dt, initialize );
492 /* if (sim_control_.sim_type == cockpit ) ls_ACES(); */
494 ls_model( dt, initialize );
500 int ls_cockpit( void ) {
503 sim_control_.paused = 0;
505 c = current_aircraft.controls;
507 Lat_control = FG_Aileron;
508 Long_control = FG_Elevator;
509 Long_trim = FG_Elev_Trim;
510 Rudder_pedal = FG_Rudder;
511 Throttle_pct = FG_Throttle[0];
513 /* printf("Mach = %.2f ", Mach_number);
514 printf("%.4f,%.4f,%.2f ", Latitude, Longitude, Altitude);
515 printf("%.2f,%.2f,%.2f\n", Phi, Theta, Psi); */
521 /* Initialize the LaRCsim flight model, dt is the time increment for
522 each subsequent iteration through the EOM */
523 int fgLaRCsimInit(double dt) {
526 ls_setdefopts(); /* set default options */
528 ls_stamp(); /* ID stamp; record time and date of run */
530 if (speedup == 0.0) {
531 fprintf(stderr, "%s: Cannot run with speedup of 0.\n", progname);
535 printf("LS pre Init pos = %.2f\n", Latitude);
539 printf("LS post Init pos = %.2f\n", Latitude);
542 /* Initialize (get) cockpit (controls) settings */
550 /* Run an iteration of the EOM (equations of motion) */
551 int fgLaRCsimUpdate(fgFLIGHT *f, int multiloop) {
558 // translate FG to LaRCsim structure
559 fgFlight_2_LaRCsim(f);
561 for ( i = 0; i < multiloop; i++ ) {
562 //Insertion by Jeff Goeke-Smith for Autopilot.
564 // run Autopilot system
565 fgPrintf( FG_ALL, FG_BULK,"Attempting autopilot run\n");
571 ls_loop( model_dt, 0);
573 // translate LaRCsim back to FG structure so that the
574 // autopilot (and the rest of the sim can use the updated
576 fgLaRCsim_2_Flight(f);
583 /* Convert from the fgFLIGHT struct to the LaRCsim generic_ struct */
584 int fgFlight_2_LaRCsim (fgFLIGHT *f) {
590 Dx_pilot = FG_Dx_pilot;
591 Dy_pilot = FG_Dy_pilot;
592 Dz_pilot = FG_Dz_pilot;
599 F_north = FG_F_north;
602 F_X_aero = FG_F_X_aero;
603 F_Y_aero = FG_F_Y_aero;
604 F_Z_aero = FG_F_Z_aero;
605 F_X_engine = FG_F_X_engine;
606 F_Y_engine = FG_F_Y_engine;
607 F_Z_engine = FG_F_Z_engine;
608 F_X_gear = FG_F_X_gear;
609 F_Y_gear = FG_F_Y_gear;
610 F_Z_gear = FG_F_Z_gear;
617 M_l_aero = FG_M_l_aero;
618 M_m_aero = FG_M_m_aero;
619 M_n_aero = FG_M_n_aero;
620 M_l_engine = FG_M_l_engine;
621 M_m_engine = FG_M_m_engine;
622 M_n_engine = FG_M_n_engine;
623 M_l_gear = FG_M_l_gear;
624 M_m_gear = FG_M_m_gear;
625 M_n_gear = FG_M_n_gear;
626 V_dot_north = FG_V_dot_north;
627 V_dot_east = FG_V_dot_east;
628 V_dot_down = FG_V_dot_down;
629 U_dot_body = FG_U_dot_body;
630 V_dot_body = FG_V_dot_body;
631 W_dot_body = FG_W_dot_body;
635 A_X_pilot = FG_A_X_pilot;
636 A_Y_pilot = FG_A_Y_pilot;
637 A_Z_pilot = FG_A_Z_pilot;
641 N_X_pilot = FG_N_X_pilot;
642 N_Y_pilot = FG_N_Y_pilot;
643 N_Z_pilot = FG_N_Z_pilot;
644 P_dot_body = FG_P_dot_body;
645 Q_dot_body = FG_Q_dot_body;
646 R_dot_body = FG_R_dot_body;
647 V_north = FG_V_north;
650 V_north_rel_ground = FG_V_north_rel_ground;
651 V_east_rel_ground = FG_V_east_rel_ground;
652 V_down_rel_ground = FG_V_down_rel_ground;
653 V_north_airmass = FG_V_north_airmass;
654 V_east_airmass = FG_V_east_airmass;
655 V_down_airmass = FG_V_down_airmass;
656 V_north_rel_airmass = FG_V_north_rel_airmass;
657 V_east_rel_airmass = FG_V_east_rel_airmass;
658 V_down_rel_airmass = FG_V_down_rel_airmass;
665 V_rel_wind = FG_V_rel_wind;
666 V_true_kts = FG_V_true_kts;
667 V_rel_ground = FG_V_rel_ground;
668 V_inertial = FG_V_inertial;
669 V_ground_speed = FG_V_ground_speed;
670 V_equiv = FG_V_equiv;
671 V_equiv_kts = FG_V_equiv_kts;
672 V_calibrated = FG_V_calibrated;
673 V_calibrated_kts = FG_V_calibrated_kts;
677 P_local = FG_P_local;
678 Q_local = FG_Q_local;
679 R_local = FG_R_local;
680 P_total = FG_P_total;
681 Q_total = FG_Q_total;
682 R_total = FG_R_total;
683 Phi_dot = FG_Phi_dot;
684 Theta_dot = FG_Theta_dot;
685 Psi_dot = FG_Psi_dot;
686 Latitude_dot = FG_Latitude_dot;
687 Longitude_dot = FG_Longitude_dot;
688 Radius_dot = FG_Radius_dot;
689 Lat_geocentric = FG_Lat_geocentric;
690 Lon_geocentric = FG_Lon_geocentric;
691 Radius_to_vehicle = FG_Radius_to_vehicle;
692 Latitude = FG_Latitude;
693 Longitude = FG_Longitude;
694 Altitude = FG_Altitude;
698 T_local_to_body_11 = FG_T_local_to_body_11;
699 T_local_to_body_12 = FG_T_local_to_body_12;
700 T_local_to_body_13 = FG_T_local_to_body_13;
701 T_local_to_body_21 = FG_T_local_to_body_21;
702 T_local_to_body_22 = FG_T_local_to_body_22;
703 T_local_to_body_23 = FG_T_local_to_body_23;
704 T_local_to_body_31 = FG_T_local_to_body_31;
705 T_local_to_body_32 = FG_T_local_to_body_32;
706 T_local_to_body_33 = FG_T_local_to_body_33;
707 Gravity = FG_Gravity;
708 Centrifugal_relief = FG_Centrifugal_relief;
711 Alpha_dot = FG_Alpha_dot;
712 Beta_dot = FG_Beta_dot;
713 Cos_alpha = FG_Cos_alpha;
714 Sin_alpha = FG_Sin_alpha;
715 Cos_beta = FG_Cos_beta;
716 Sin_beta = FG_Sin_beta;
717 Cos_phi = FG_Cos_phi;
718 Sin_phi = FG_Sin_phi;
719 Cos_theta = FG_Cos_theta;
720 Sin_theta = FG_Sin_theta;
721 Cos_psi = FG_Cos_psi;
722 Sin_psi = FG_Sin_psi;
723 Gamma_vert_rad = FG_Gamma_vert_rad;
724 Gamma_horiz_rad = FG_Gamma_horiz_rad;
726 Density = FG_Density;
727 V_sound = FG_V_sound;
728 Mach_number = FG_Mach_number;
729 Static_pressure = FG_Static_pressure;
730 Total_pressure = FG_Total_pressure;
731 Impact_pressure = FG_Impact_pressure;
732 Dynamic_pressure = FG_Dynamic_pressure;
733 Static_temperature = FG_Static_temperature;
734 Total_temperature = FG_Total_temperature;
735 Sea_level_radius = FG_Sea_level_radius;
736 Earth_position_angle = FG_Earth_position_angle;
737 Runway_altitude = FG_Runway_altitude;
738 Runway_latitude = FG_Runway_latitude;
739 Runway_longitude = FG_Runway_longitude;
740 Runway_heading = FG_Runway_heading;
741 Radius_to_rwy = FG_Radius_to_rwy;
742 D_cg_north_of_rwy = FG_D_cg_north_of_rwy;
743 D_cg_east_of_rwy = FG_D_cg_east_of_rwy;
744 D_cg_above_rwy = FG_D_cg_above_rwy;
745 X_cg_rwy = FG_X_cg_rwy;
746 Y_cg_rwy = FG_Y_cg_rwy;
747 H_cg_rwy = FG_H_cg_rwy;
748 D_pilot_north_of_rwy = FG_D_pilot_north_of_rwy;
749 D_pilot_east_of_rwy = FG_D_pilot_east_of_rwy;
750 D_pilot_above_rwy = FG_D_pilot_above_rwy;
751 X_pilot_rwy = FG_X_pilot_rwy;
752 Y_pilot_rwy = FG_Y_pilot_rwy;
753 H_pilot_rwy = FG_H_pilot_rwy;
759 /* Convert from the LaRCsim generic_ struct to the fgFLIGHT struct */
760 int fgLaRCsim_2_Flight (fgFLIGHT *f) {
766 FG_Dx_pilot = Dx_pilot;
767 FG_Dy_pilot = Dy_pilot;
768 FG_Dz_pilot = Dz_pilot;
775 FG_F_north = F_north;
778 FG_F_X_aero = F_X_aero;
779 FG_F_Y_aero = F_Y_aero;
780 FG_F_Z_aero = F_Z_aero;
781 FG_F_X_engine = F_X_engine;
782 FG_F_Y_engine = F_Y_engine;
783 FG_F_Z_engine = F_Z_engine;
784 FG_F_X_gear = F_X_gear;
785 FG_F_Y_gear = F_Y_gear;
786 FG_F_Z_gear = F_Z_gear;
793 FG_M_l_aero = M_l_aero;
794 FG_M_m_aero = M_m_aero;
795 FG_M_n_aero = M_n_aero;
796 FG_M_l_engine = M_l_engine;
797 FG_M_m_engine = M_m_engine;
798 FG_M_n_engine = M_n_engine;
799 FG_M_l_gear = M_l_gear;
800 FG_M_m_gear = M_m_gear;
801 FG_M_n_gear = M_n_gear;
802 FG_V_dot_north = V_dot_north;
803 FG_V_dot_east = V_dot_east;
804 FG_V_dot_down = V_dot_down;
805 FG_U_dot_body = U_dot_body;
806 FG_V_dot_body = V_dot_body;
807 FG_W_dot_body = W_dot_body;
811 FG_A_X_pilot = A_X_pilot;
812 FG_A_Y_pilot = A_Y_pilot;
813 FG_A_Z_pilot = A_Z_pilot;
817 FG_N_X_pilot = N_X_pilot;
818 FG_N_Y_pilot = N_Y_pilot;
819 FG_N_Z_pilot = N_Z_pilot;
820 FG_P_dot_body = P_dot_body;
821 FG_Q_dot_body = Q_dot_body;
822 FG_R_dot_body = R_dot_body;
823 FG_V_north = V_north;
826 FG_V_north_rel_ground = V_north_rel_ground;
827 FG_V_east_rel_ground = V_east_rel_ground;
828 FG_V_down_rel_ground = V_down_rel_ground;
829 FG_V_north_airmass = V_north_airmass;
830 FG_V_east_airmass = V_east_airmass;
831 FG_V_down_airmass = V_down_airmass;
832 FG_V_north_rel_airmass = V_north_rel_airmass;
833 FG_V_east_rel_airmass = V_east_rel_airmass;
834 FG_V_down_rel_airmass = V_down_rel_airmass;
841 FG_V_rel_wind = V_rel_wind;
842 FG_V_true_kts = V_true_kts;
843 FG_V_rel_ground = V_rel_ground;
844 FG_V_inertial = V_inertial;
845 FG_V_ground_speed = V_ground_speed;
846 FG_V_equiv = V_equiv;
847 FG_V_equiv_kts = V_equiv_kts;
848 FG_V_calibrated = V_calibrated;
849 FG_V_calibrated_kts = V_calibrated_kts;
853 FG_P_local = P_local;
854 FG_Q_local = Q_local;
855 FG_R_local = R_local;
856 FG_P_total = P_total;
857 FG_Q_total = Q_total;
858 FG_R_total = R_total;
859 FG_Phi_dot = Phi_dot;
860 FG_Theta_dot = Theta_dot;
861 FG_Psi_dot = Psi_dot;
862 FG_Latitude_dot = Latitude_dot;
863 FG_Longitude_dot = Longitude_dot;
864 FG_Radius_dot = Radius_dot;
865 FG_Lat_geocentric = Lat_geocentric;
866 FG_Lon_geocentric = Lon_geocentric;
867 FG_Radius_to_vehicle = Radius_to_vehicle;
868 FG_Latitude = Latitude;
869 FG_Longitude = Longitude;
870 FG_Altitude = Altitude;
874 FG_T_local_to_body_11 = T_local_to_body_11;
875 FG_T_local_to_body_12 = T_local_to_body_12;
876 FG_T_local_to_body_13 = T_local_to_body_13;
877 FG_T_local_to_body_21 = T_local_to_body_21;
878 FG_T_local_to_body_22 = T_local_to_body_22;
879 FG_T_local_to_body_23 = T_local_to_body_23;
880 FG_T_local_to_body_31 = T_local_to_body_31;
881 FG_T_local_to_body_32 = T_local_to_body_32;
882 FG_T_local_to_body_33 = T_local_to_body_33;
883 FG_Gravity = Gravity;
884 FG_Centrifugal_relief = Centrifugal_relief;
887 FG_Alpha_dot = Alpha_dot;
888 FG_Beta_dot = Beta_dot;
889 FG_Cos_alpha = Cos_alpha;
890 FG_Sin_alpha = Sin_alpha;
891 FG_Cos_beta = Cos_beta;
892 FG_Sin_beta = Sin_beta;
893 FG_Cos_phi = Cos_phi;
894 FG_Sin_phi = Sin_phi;
895 FG_Cos_theta = Cos_theta;
896 FG_Sin_theta = Sin_theta;
897 FG_Cos_psi = Cos_psi;
898 FG_Sin_psi = Sin_psi;
899 FG_Gamma_vert_rad = Gamma_vert_rad;
900 FG_Gamma_horiz_rad = Gamma_horiz_rad;
902 FG_Density = Density;
903 FG_V_sound = V_sound;
904 FG_Mach_number = Mach_number;
905 FG_Static_pressure = Static_pressure;
906 FG_Total_pressure = Total_pressure;
907 FG_Impact_pressure = Impact_pressure;
908 FG_Dynamic_pressure = Dynamic_pressure;
909 FG_Static_temperature = Static_temperature;
910 FG_Total_temperature = Total_temperature;
911 FG_Sea_level_radius = Sea_level_radius;
912 FG_Earth_position_angle = Earth_position_angle;
913 FG_Runway_altitude = Runway_altitude;
914 FG_Runway_latitude = Runway_latitude;
915 FG_Runway_longitude = Runway_longitude;
916 FG_Runway_heading = Runway_heading;
917 FG_Radius_to_rwy = Radius_to_rwy;
918 FG_D_cg_north_of_rwy = D_cg_north_of_rwy;
919 FG_D_cg_east_of_rwy = D_cg_east_of_rwy;
920 FG_D_cg_above_rwy = D_cg_above_rwy;
921 FG_X_cg_rwy = X_cg_rwy;
922 FG_Y_cg_rwy = Y_cg_rwy;
923 FG_H_cg_rwy = H_cg_rwy;
924 FG_D_pilot_north_of_rwy = D_pilot_north_of_rwy;
925 FG_D_pilot_east_of_rwy = D_pilot_east_of_rwy;
926 FG_D_pilot_above_rwy = D_pilot_above_rwy;
927 FG_X_pilot_rwy = X_pilot_rwy;
928 FG_Y_pilot_rwy = Y_pilot_rwy;
929 FG_H_pilot_rwy = H_pilot_rwy;
934 /* Flight Gear Modification Log
937 * Revision 1.18 1998/04/21 16:59:38 curt
938 * Integrated autopilot.
939 * Prepairing for C++ integration.
941 * Revision 1.17 1998/02/23 19:07:58 curt
942 * Incorporated Durk's Astro/ tweaks. Includes unifying the sun position
943 * calculation code between sun display, and other FG sections that use this
944 * for things like lighting.
946 * Revision 1.16 1998/02/07 15:29:38 curt
947 * Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
948 * <chotchkiss@namg.us.anritsu.com>
950 * Revision 1.15 1998/01/22 22:03:47 curt
951 * Removed #include <sys/stat.h>
953 * Revision 1.14 1998/01/19 19:27:04 curt
954 * Merged in make system changes from Bob Kuehne <rpk@sgi.com>
955 * This should simplify things tremendously.
957 * Revision 1.13 1998/01/19 18:40:26 curt
958 * Tons of little changes to clean up the code and to remove fatal errors
959 * when building with the c++ compiler.
961 * Revision 1.12 1998/01/06 01:20:16 curt
962 * Tweaks to help building with MSVC++
964 * Revision 1.11 1998/01/05 22:19:26 curt
965 * #ifdef'd out some unused code that was problematic for MSVC++ to compile.
967 * Revision 1.10 1997/12/10 22:37:43 curt
968 * Prepended "fg" on the name of all global structures that didn't have it yet.
969 * i.e. "struct WEATHER {}" became "struct fgWEATHER {}"
971 * Revision 1.9 1997/08/27 03:30:08 curt
972 * Changed naming scheme of basic shared structures.
974 * Revision 1.8 1997/06/21 17:12:50 curt
975 * Capitalized subdirectory names.
977 * Revision 1.7 1997/05/31 19:16:28 curt
978 * Elevator trim added.
980 * Revision 1.6 1997/05/31 04:13:53 curt
983 * Continuing work on the LaRCsim flight model integration.
984 * Added some MSFS-like keyboard input handling.
986 * Revision 1.5 1997/05/30 23:26:25 curt
987 * Added elevator/aileron controls.
989 * Revision 1.4 1997/05/30 19:30:15 curt
990 * The LaRCsim flight model is starting to look like it is working.
992 * Revision 1.3 1997/05/30 03:54:12 curt
993 * Made a bit more progress towards integrating the LaRCsim flight model.
995 * Revision 1.2 1997/05/29 22:39:59 curt
996 * Working on incorporating the LaRCsim flight model.
998 * Revision 1.1 1997/05/29 00:09:57 curt
999 * Initial Flight Gear revision.