]> git.mxchange.org Git - flightgear.git/blob - src/FDM/flight.cxx
7d7f9723381fdd95f5eb2f319bfaeeec1c7d4585
[flightgear.git] / src / FDM / flight.cxx
1 // flight.c -- a general interface to the various flight models
2 //
3 // Written by Curtis Olson, started May 1997.
4 //
5 // Copyright (C) 1997  Curtis L. Olson  - curt@infoplane.com
6 //
7 // This program is free software; you can redistribute it and/or
8 // modify it under the terms of the GNU General Public License as
9 // published by the Free Software Foundation; either version 2 of the
10 // License, or (at your option) any later version.
11 //
12 // This program is distributed in the hope that it will be useful, but
13 // WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15 // General Public License for more details.
16 //
17 // You should have received a copy of the GNU General Public License
18 // along with this program; if not, write to the Free Software
19 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 //
21 // $Id$
22
23
24 #include <stdio.h>
25
26 #include <simgear/constants.h>
27 #include <simgear/debug/logstream.hxx>
28 #include <simgear/math/sg_geodesy.hxx>
29 #include <simgear/timing/timestamp.hxx>
30
31 #include <Scenery/scenery.hxx>
32 #include <FDM/LaRCsim/ls_interface.h>
33 #include <Main/globals.hxx>
34 #include <Main/fg_props.hxx>
35
36 #include "External.hxx"
37 #include "flight.hxx"
38 #include "JSBSim.hxx"
39 #include "LaRCsim.hxx"
40 #include "Balloon.h"
41
42
43 // base_fdm_state is the internal state that is updated in integer
44 // multiples of "dt".  This leads to "jitter" with respect to the real
45 // world time, so we introduce cur_fdm_state which is extrapolated by
46 // the difference between sim time and real world time
47
48 FGInterface *cur_fdm_state;
49 FGInterface base_fdm_state;
50
51 inline void init_vec(FG_VECTOR_3 vec) {
52     vec[0] = 0.0; vec[1] = 0.0; vec[2] = 0.0;
53 }  
54
55 FGEngInterface::FGEngInterface() {
56     
57     // inputs
58     Throttle=0;
59     Mixture=0;
60     Prop_Advance=0;
61
62     // outputs
63     RPM=0;
64     Manifold_Pressure=0;
65     MaxHP=0;
66     Percentage_Power=0;
67     EGT=0;
68     prop_thrust=0;
69 }
70
71 FGEngInterface::~FGEngInterface(void) {
72 }
73
74
75 // Constructor
76 FGInterface::FGInterface() {
77     init();
78 }  
79
80 FGInterface::FGInterface( double dt ) {
81     
82     init();
83     delta_t = dt;
84     remainder = elapsed = multi_loop = 0;
85 }
86
87 // Destructor
88 FGInterface::~FGInterface() {
89 //   unbind();                  // FIXME: should be called explicitly
90 }
91
92
93 void
94 FGInterface::init ()
95 {
96     init_vec( d_pilot_rp_body_v );
97     init_vec( d_cg_rp_body_v );
98     init_vec( f_body_total_v );
99     init_vec( f_local_total_v );
100     init_vec( f_aero_v );
101     init_vec( f_engine_v );
102     init_vec( f_gear_v );
103     init_vec( m_total_rp_v );
104     init_vec( m_total_cg_v );
105     init_vec( m_aero_v );
106     init_vec( m_engine_v );
107     init_vec( m_gear_v );
108     init_vec( v_dot_local_v );
109     init_vec( v_dot_body_v );
110     init_vec( a_cg_body_v );
111     init_vec( a_pilot_body_v );
112     init_vec( n_cg_body_v );
113     init_vec( n_pilot_body_v );
114     init_vec( omega_dot_body_v );
115     init_vec( v_local_v );
116     init_vec( v_local_rel_ground_v ); 
117     init_vec( v_local_airmass_v );    
118     init_vec( v_local_rel_airmass_v );  
119     init_vec( v_local_gust_v ); 
120     init_vec( v_wind_body_v );     
121     init_vec( omega_body_v );         
122     init_vec( omega_local_v );        
123     init_vec( omega_total_v );       
124     init_vec( euler_rates_v );
125     init_vec( geocentric_rates_v );   
126     init_vec( geocentric_position_v );
127     init_vec( geodetic_position_v );
128     init_vec( euler_angles_v );
129     init_vec( d_cg_rwy_local_v );     
130     init_vec( d_cg_rwy_rwy_v );       
131     init_vec( d_pilot_rwy_local_v );  
132     init_vec( d_pilot_rwy_rwy_v );    
133     init_vec( t_local_to_body_m[0] );
134     init_vec( t_local_to_body_m[1] );
135     init_vec( t_local_to_body_m[2] );
136     
137     mass=i_xx=i_yy=i_zz=i_xz=0;
138     nlf=0;  
139     v_rel_wind=v_true_kts=v_rel_ground=v_inertial=0;
140     v_ground_speed=v_equiv=v_equiv_kts=0;
141     v_calibrated=v_calibrated_kts=0;
142     gravity=0;            
143     centrifugal_relief=0; 
144     alpha=beta=alpha_dot=beta_dot=0;   
145     cos_alpha=sin_alpha=cos_beta=sin_beta=0;
146     cos_phi=sin_phi=cos_theta=sin_theta=cos_psi=sin_psi=0;
147     gamma_vert_rad=gamma_horiz_rad=0;    
148     sigma=density=v_sound=mach_number=0;
149     static_pressure=total_pressure=impact_pressure=0;
150     dynamic_pressure=0;
151     static_temperature=total_temperature=0;
152     sea_level_radius=earth_position_angle=0;
153     runway_altitude=runway_latitude=runway_longitude=0;
154     runway_heading=0;
155     radius_to_rwy=0;
156     climb_rate=0;           
157     sin_lat_geocentric=cos_lat_geocentric=0;
158     sin_latitude=cos_latitude=0;
159     sin_longitude=cos_longitude=0;
160     altitude_agl=0;
161 }
162
163 void
164 FGInterface::bind ()
165 {
166                                 // Time management (read-only)
167   fgTie("/fdm/time/delta_t", this, 
168         &FGInterface::get_delta_t); // read-only
169   fgTie("/fdm/time/elapsed", this, 
170         &FGInterface::get_elapsed); // read-only
171   fgTie("/fdm/time/remainder", this, 
172         &FGInterface::get_remainder); // read-only
173   fgTie("/fdm/time/multi_loop", this, 
174         &FGInterface::get_multi_loop); // read-only
175
176                         // Aircraft position
177   fgTie("/position/latitude", this,
178         &FGInterface::get_Latitude_deg,
179         &FGInterface::set_Latitude_deg,
180         false);
181   fgTie("/position/longitude", this,
182         &FGInterface::get_Longitude_deg,
183         &FGInterface::set_Longitude_deg,
184         false);
185   fgTie("/position/altitude", this,
186         &FGInterface::get_Altitude,
187         &FGInterface::set_Altitude,
188         false);
189   fgTie("/position/altitude-agl", this,
190         &FGInterface::get_Altitude_AGL); // read-only
191
192                                 // Orientation
193   fgTie("/orientation/roll", this,
194         &FGInterface::get_Phi_deg,
195         &FGInterface::set_Phi_deg,
196         true);
197   fgTie("/orientation/pitch", this,
198         &FGInterface::get_Theta_deg,
199         &FGInterface::set_Theta_deg,
200         true);
201   fgTie("/orientation/heading", this,
202         &FGInterface::get_Psi_deg,
203         &FGInterface::set_Psi_deg,
204         true);
205
206                                 // Calibrated airspeed
207   fgTie("/velocities/airspeed", this,
208         &FGInterface::get_V_calibrated_kts,
209         &FGInterface::set_V_calibrated_kts,
210         true);
211
212                                 // Local velocities
213   fgTie("/velocities/speed-north", this,
214         &FGInterface::get_V_north); // read-only
215   fgTie("/velocities/speed-east", this,
216         &FGInterface::get_V_east,
217         &FGInterface::set_V_east,
218         true);
219   fgTie("/velocities/speed-down", this,
220         &FGInterface::get_V_down,
221         &FGInterface::set_V_down,
222         true);
223
224                                 // Relative wind
225   fgTie("/velocities/uBody", this,
226         &FGInterface::get_uBody,
227         &FGInterface::set_uBody,
228         true);
229   fgTie("/velocities/vBody", this,
230         &FGInterface::get_vBody,
231         &FGInterface::set_vBody,
232         true);
233   fgTie("/velocities/wBody", this,
234         &FGInterface::get_wBody,
235         &FGInterface::set_wBody,
236         true);
237
238                                 // Climb and slip (read-only)
239   fgTie("/velocities/vertical-speed", this,
240         &FGInterface::get_Climb_Rate); // read-only
241   fgTie("/velocities/side-slip", this,
242         &FGInterface::get_Beta); // read-only
243 }
244
245 void
246 FGInterface::unbind ()
247 {
248   fgUntie("/fdm/time/delta_t");
249   fgUntie("/fdm/time/elapsed");
250   fgUntie("/fdm/time/remainder");
251   fgUntie("/fdm/time/multi_loop");
252   fgUntie("/position/latitude");
253   fgUntie("/position/longitude");
254   fgUntie("/position/altitude");
255   fgUntie("/position/heading");
256   fgUntie("/position/pitch");
257   fgUntie("/position/roll");
258   fgUntie("/velocities/airspeed");
259   fgUntie("/velocities/speed-north");
260   fgUntie("/velocities/speed-east");
261   fgUntie("/velocities/speed-down");
262   fgUntie("/velocities/uBody");
263   fgUntie("/velocities/vBody");
264   fgUntie("/velocities/wBody");
265   fgUntie("/velocities/vertical-speed");
266   fgUntie("/velocities/side-slip");
267 }
268
269 void
270 FGInterface::update ()
271 {
272   update(1);
273 }
274
275
276 bool FGInterface::update( int multi_loop ) {
277     cout << "dummy update() ... SHOULDN'T BE CALLED!" << endl;
278     return false;
279 }
280
281   
282 void FGInterface::_updatePosition( double lat_geoc, double lon, double alt ) {
283     double lat_geod, tmp_alt, sl_radius1, sl_radius2, tmp_lat_geoc;
284         
285     sgGeocToGeod( lat_geoc, ( get_Sea_level_radius() + alt ) * SG_FEET_TO_METER,
286                   &lat_geod, &tmp_alt, &sl_radius1 );
287     sgGeodToGeoc( lat_geod, alt * SG_FEET_TO_METER, &sl_radius2, &tmp_lat_geoc );
288
289     SG_LOG( SG_FLIGHT, SG_DEBUG, "lon = " << lon 
290             << " lat_geod = " << lat_geod
291             << " lat_geoc = " << lat_geoc
292             << " alt = " << alt 
293             << " tmp_alt = " << tmp_alt * SG_METER_TO_FEET
294             << " sl_radius1 = " << sl_radius1 * SG_METER_TO_FEET
295             << " sl_radius2 = " << sl_radius2 * SG_METER_TO_FEET
296             << " Equator = " << SG_EQUATORIAL_RADIUS_FT );
297
298     _set_Geocentric_Position( lat_geoc, lon, 
299                               sl_radius2 * SG_METER_TO_FEET + alt );
300         
301     _set_Geodetic_Position( lat_geod, lon, alt );
302         
303     _set_Sea_level_radius( sl_radius2 * SG_METER_TO_FEET );
304     _set_Runway_altitude( scenery.cur_elev*METERS_TO_FEET ); 
305         
306     _set_sin_lat_geocentric( lat_geoc );
307     _set_cos_lat_geocentric( lat_geoc );
308         
309     _set_sin_cos_longitude( lon );
310         
311     _set_sin_cos_latitude( lat_geod );
312         
313     /* Norman's code for slope of the terrain */
314     /* needs to be tested -- get it on the HUD and taxi around */
315     /* double *tnorm = scenery.cur_normal;
316         
317        double sy = sin ( -get_Psi() ) ;
318        double cy = cos ( -get_Psi() ) ;
319
320        double phitb, thetatb, psitb;
321        if(tnorm[1] != 0.0) {
322                 psitb = -atan2 ( tnorm[0], tnorm[1] );
323        }
324        if(tnorm[2] != 0.0) {    
325                 thetatb =  atan2 ( tnorm[0] * cy - tnorm[1] * sy, tnorm[2] );
326                 phitb = -atan2 ( tnorm[1] * cy + tnorm[0] * sy, tnorm[2] );  
327        }        
328         
329        _set_terrain_slope(phitb, thetatb, psitb) 
330      */
331 }
332
333
334 // Extrapolate fdm based on time_offset (in usec)
335 void FGInterface::extrapolate( int time_offset ) {
336     double dt = time_offset / 1000000.0;
337
338     // -dw- metrowerks complains about ambiguous access, not critical
339     // to keep this ;)
340 #ifndef __MWERKS__
341     cout << "extrapolating FDM by dt = " << dt << endl;
342 #endif
343
344     double lat = geodetic_position_v[0] + geocentric_rates_v[0] * dt;
345     double lat_geoc = geocentric_position_v[0] + geocentric_rates_v[0] * dt;
346
347     double lon = geodetic_position_v[1] + geocentric_rates_v[1] * dt;
348     double lon_geoc = geocentric_position_v[1] + geocentric_rates_v[1] * dt;
349
350     double alt = geodetic_position_v[2] + geocentric_rates_v[2] * dt;
351     double radius = geocentric_position_v[2] + geocentric_rates_v[2] * dt;
352
353     geodetic_position_v[0] = lat;
354     geocentric_position_v[0] = lat_geoc;
355
356     geodetic_position_v[1] = lon;
357     geocentric_position_v[1] = lon_geoc;
358
359     geodetic_position_v[2] = alt;
360     geocentric_position_v[2] = radius;
361 }
362
363
364 // Set the altitude (force)
365 void fgFDMForceAltitude(const string &model, double alt_meters) {
366     double sea_level_radius_meters;
367     double lat_geoc;
368
369     // Set the FG variables first
370     sgGeodToGeoc( base_fdm_state.get_Latitude(), alt_meters, 
371                   &sea_level_radius_meters, &lat_geoc);
372
373     base_fdm_state.set_Altitude( alt_meters * SG_METER_TO_FEET );
374     base_fdm_state.set_Sea_level_radius( sea_level_radius_meters *
375                                          SG_METER_TO_FEET ); 
376                                           
377
378     // additional work needed for some flight models
379     if ( model == "larcsim" ) {
380         ls_ForceAltitude( base_fdm_state.get_Altitude() );
381     }
382 }
383
384
385 // Set the local ground elevation
386 void fgFDMSetGroundElevation(const string &model, double ground_meters) {
387     SG_LOG( SG_FLIGHT,SG_INFO, "fgFDMSetGroundElevation: "
388             << ground_meters*SG_METER_TO_FEET ); 
389     base_fdm_state.set_Runway_altitude( ground_meters * SG_METER_TO_FEET );
390     cur_fdm_state->set_Runway_altitude( ground_meters * SG_METER_TO_FEET );
391 }
392
393
394 // Positions
395 void FGInterface::set_Latitude(double lat) { 
396     geodetic_position_v[0] = lat;
397 }  
398
399 void FGInterface::set_Longitude(double lon) {
400     geodetic_position_v[1] = lon;
401 }       
402
403 void FGInterface::set_Altitude(double alt) {
404     geodetic_position_v[2] = alt;
405 }          
406
407 void FGInterface::set_AltitudeAGL(double altagl) {
408     altitude_agl=altagl;
409 }  
410
411 // Velocities
412 void FGInterface::set_V_calibrated_kts(double vc) {
413     v_calibrated_kts = vc;
414 }  
415
416 void FGInterface::set_Mach_number(double mach) {
417     mach_number = mach;
418 }  
419
420 void FGInterface::set_Velocities_Local( double north, 
421                                         double east, 
422                                         double down ){
423     v_local_v[0] = north;
424     v_local_v[1] = east;
425     v_local_v[2] = down;                                                 
426 }  
427
428 void FGInterface::set_Velocities_Wind_Body( double u, 
429                                             double v, 
430                                             double w){
431     v_wind_body_v[0] = u;
432     v_wind_body_v[1] = v;
433     v_wind_body_v[2] = w;
434
435
436 // Euler angles 
437 void FGInterface::set_Euler_Angles( double phi, 
438                                     double theta, 
439                                     double psi ) {
440     euler_angles_v[0] = phi;
441     euler_angles_v[1] = theta;
442     euler_angles_v[2] = psi;                                            
443 }  
444
445 // Flight Path
446 void FGInterface::set_Climb_Rate( double roc) {
447     climb_rate = roc;
448 }  
449
450 void FGInterface::set_Gamma_vert_rad( double gamma) {
451     gamma_vert_rad = gamma;
452 }  
453
454 // Earth
455 void FGInterface::set_Sea_level_radius(double slr) {
456     sea_level_radius = slr;
457 }  
458
459 void FGInterface::set_Runway_altitude(double ralt) {
460     runway_altitude = ralt;
461 }  
462
463 void FGInterface::set_Static_pressure(double p) { static_pressure = p; }
464 void FGInterface::set_Static_temperature(double T) { static_temperature = T; }
465 void FGInterface::set_Density(double rho) { density = rho; }
466
467 void FGInterface::set_Velocities_Local_Airmass (double wnorth, 
468                                                 double weast, 
469                                                 double wdown ) {
470     v_local_airmass_v[0] = wnorth;
471     v_local_airmass_v[1] = weast;
472     v_local_airmass_v[2] = wdown;
473 }     
474
475
476 void FGInterface::_busdump(void) {
477
478     SG_LOG(SG_FLIGHT,SG_INFO,"d_pilot_rp_body_v[3]: " << d_pilot_rp_body_v[0] << ", " << d_pilot_rp_body_v[1] << ", " << d_pilot_rp_body_v[2]);
479     SG_LOG(SG_FLIGHT,SG_INFO,"d_cg_rp_body_v[3]: " << d_cg_rp_body_v[0] << ", " << d_cg_rp_body_v[1] << ", " << d_cg_rp_body_v[2]);
480     SG_LOG(SG_FLIGHT,SG_INFO,"f_body_total_v[3]: " << f_body_total_v[0] << ", " << f_body_total_v[1] << ", " << f_body_total_v[2]);
481     SG_LOG(SG_FLIGHT,SG_INFO,"f_local_total_v[3]: " << f_local_total_v[0] << ", " << f_local_total_v[1] << ", " << f_local_total_v[2]);
482     SG_LOG(SG_FLIGHT,SG_INFO,"f_aero_v[3]: " << f_aero_v[0] << ", " << f_aero_v[1] << ", " << f_aero_v[2]);
483     SG_LOG(SG_FLIGHT,SG_INFO,"f_engine_v[3]: " << f_engine_v[0] << ", " << f_engine_v[1] << ", " << f_engine_v[2]);
484     SG_LOG(SG_FLIGHT,SG_INFO,"f_gear_v[3]: " << f_gear_v[0] << ", " << f_gear_v[1] << ", " << f_gear_v[2]);
485     SG_LOG(SG_FLIGHT,SG_INFO,"m_total_rp_v[3]: " << m_total_rp_v[0] << ", " << m_total_rp_v[1] << ", " << m_total_rp_v[2]);
486     SG_LOG(SG_FLIGHT,SG_INFO,"m_total_cg_v[3]: " << m_total_cg_v[0] << ", " << m_total_cg_v[1] << ", " << m_total_cg_v[2]);
487     SG_LOG(SG_FLIGHT,SG_INFO,"m_aero_v[3]: " << m_aero_v[0] << ", " << m_aero_v[1] << ", " << m_aero_v[2]);
488     SG_LOG(SG_FLIGHT,SG_INFO,"m_engine_v[3]: " << m_engine_v[0] << ", " << m_engine_v[1] << ", " << m_engine_v[2]);
489     SG_LOG(SG_FLIGHT,SG_INFO,"m_gear_v[3]: " << m_gear_v[0] << ", " << m_gear_v[1] << ", " << m_gear_v[2]);
490     SG_LOG(SG_FLIGHT,SG_INFO,"v_dot_local_v[3]: " << v_dot_local_v[0] << ", " << v_dot_local_v[1] << ", " << v_dot_local_v[2]);
491     SG_LOG(SG_FLIGHT,SG_INFO,"v_dot_body_v[3]: " << v_dot_body_v[0] << ", " << v_dot_body_v[1] << ", " << v_dot_body_v[2]);
492     SG_LOG(SG_FLIGHT,SG_INFO,"a_cg_body_v[3]: " << a_cg_body_v[0] << ", " << a_cg_body_v[1] << ", " << a_cg_body_v[2]);
493     SG_LOG(SG_FLIGHT,SG_INFO,"a_pilot_body_v[3]: " << a_pilot_body_v[0] << ", " << a_pilot_body_v[1] << ", " << a_pilot_body_v[2]);
494     SG_LOG(SG_FLIGHT,SG_INFO,"n_cg_body_v[3]: " << n_cg_body_v[0] << ", " << n_cg_body_v[1] << ", " << n_cg_body_v[2]);
495     SG_LOG(SG_FLIGHT,SG_INFO,"n_pilot_body_v[3]: " << n_pilot_body_v[0] << ", " << n_pilot_body_v[1] << ", " << n_pilot_body_v[2]);
496     SG_LOG(SG_FLIGHT,SG_INFO,"omega_dot_body_v[3]: " << omega_dot_body_v[0] << ", " << omega_dot_body_v[1] << ", " << omega_dot_body_v[2]);
497     SG_LOG(SG_FLIGHT,SG_INFO,"v_local_v[3]: " << v_local_v[0] << ", " << v_local_v[1] << ", " << v_local_v[2]);
498     SG_LOG(SG_FLIGHT,SG_INFO,"v_local_rel_ground_v[3]: " << v_local_rel_ground_v[0] << ", " << v_local_rel_ground_v[1] << ", " << v_local_rel_ground_v[2]);
499     SG_LOG(SG_FLIGHT,SG_INFO,"v_local_airmass_v[3]: " << v_local_airmass_v[0] << ", " << v_local_airmass_v[1] << ", " << v_local_airmass_v[2]);
500     SG_LOG(SG_FLIGHT,SG_INFO,"v_local_rel_airmass_v[3]: " << v_local_rel_airmass_v[0] << ", " << v_local_rel_airmass_v[1] << ", " << v_local_rel_airmass_v[2]);
501     SG_LOG(SG_FLIGHT,SG_INFO,"v_local_gust_v[3]: " << v_local_gust_v[0] << ", " << v_local_gust_v[1] << ", " << v_local_gust_v[2]);
502     SG_LOG(SG_FLIGHT,SG_INFO,"v_wind_body_v[3]: " << v_wind_body_v[0] << ", " << v_wind_body_v[1] << ", " << v_wind_body_v[2]);
503     SG_LOG(SG_FLIGHT,SG_INFO,"omega_body_v[3]: " << omega_body_v[0] << ", " << omega_body_v[1] << ", " << omega_body_v[2]);
504     SG_LOG(SG_FLIGHT,SG_INFO,"omega_local_v[3]: " << omega_local_v[0] << ", " << omega_local_v[1] << ", " << omega_local_v[2]);
505     SG_LOG(SG_FLIGHT,SG_INFO,"omega_total_v[3]: " << omega_total_v[0] << ", " << omega_total_v[1] << ", " << omega_total_v[2]);
506     SG_LOG(SG_FLIGHT,SG_INFO,"euler_rates_v[3]: " << euler_rates_v[0] << ", " << euler_rates_v[1] << ", " << euler_rates_v[2]);
507     SG_LOG(SG_FLIGHT,SG_INFO,"geocentric_rates_v[3]: " << geocentric_rates_v[0] << ", " << geocentric_rates_v[1] << ", " << geocentric_rates_v[2]);
508     SG_LOG(SG_FLIGHT,SG_INFO,"geocentric_position_v[3]: " << geocentric_position_v[0] << ", " << geocentric_position_v[1] << ", " << geocentric_position_v[2]);
509     SG_LOG(SG_FLIGHT,SG_INFO,"geodetic_position_v[3]: " << geodetic_position_v[0] << ", " << geodetic_position_v[1] << ", " << geodetic_position_v[2]);
510     SG_LOG(SG_FLIGHT,SG_INFO,"euler_angles_v[3]: " << euler_angles_v[0] << ", " << euler_angles_v[1] << ", " << euler_angles_v[2]);
511     SG_LOG(SG_FLIGHT,SG_INFO,"d_cg_rwy_local_v[3]: " << d_cg_rwy_local_v[0] << ", " << d_cg_rwy_local_v[1] << ", " << d_cg_rwy_local_v[2]);
512     SG_LOG(SG_FLIGHT,SG_INFO,"d_cg_rwy_rwy_v[3]: " << d_cg_rwy_rwy_v[0] << ", " << d_cg_rwy_rwy_v[1] << ", " << d_cg_rwy_rwy_v[2]);
513     SG_LOG(SG_FLIGHT,SG_INFO,"d_pilot_rwy_local_v[3]: " << d_pilot_rwy_local_v[0] << ", " << d_pilot_rwy_local_v[1] << ", " << d_pilot_rwy_local_v[2]);
514     SG_LOG(SG_FLIGHT,SG_INFO,"d_pilot_rwy_rwy_v[3]: " << d_pilot_rwy_rwy_v[0] << ", " << d_pilot_rwy_rwy_v[1] << ", " << d_pilot_rwy_rwy_v[2]);
515   
516     SG_LOG(SG_FLIGHT,SG_INFO,"t_local_to_body_m[0][3]: " << t_local_to_body_m[0][0] << ", " << t_local_to_body_m[0][1] << ", " << t_local_to_body_m[0][2]);
517     SG_LOG(SG_FLIGHT,SG_INFO,"t_local_to_body_m[1][3]: " << t_local_to_body_m[1][0] << ", " << t_local_to_body_m[1][1] << ", " << t_local_to_body_m[1][2]);
518     SG_LOG(SG_FLIGHT,SG_INFO,"t_local_to_body_m[2][3]: " << t_local_to_body_m[2][0] << ", " << t_local_to_body_m[2][1] << ", " << t_local_to_body_m[2][2]);
519
520     SG_LOG(SG_FLIGHT,SG_INFO,"mass: " << mass );
521     SG_LOG(SG_FLIGHT,SG_INFO,"i_xx: " << i_xx );
522     SG_LOG(SG_FLIGHT,SG_INFO,"i_yy: " << i_yy );
523     SG_LOG(SG_FLIGHT,SG_INFO,"i_zz: " << i_zz );
524     SG_LOG(SG_FLIGHT,SG_INFO,"i_xz: " << i_xz );
525     SG_LOG(SG_FLIGHT,SG_INFO,"nlf: " << nlf );
526     SG_LOG(SG_FLIGHT,SG_INFO,"v_rel_wind: " << v_rel_wind );
527     SG_LOG(SG_FLIGHT,SG_INFO,"v_true_kts: " << v_true_kts );
528     SG_LOG(SG_FLIGHT,SG_INFO,"v_rel_ground: " << v_rel_ground );
529     SG_LOG(SG_FLIGHT,SG_INFO,"v_inertial: " << v_inertial );
530     SG_LOG(SG_FLIGHT,SG_INFO,"v_ground_speed: " << v_ground_speed );
531     SG_LOG(SG_FLIGHT,SG_INFO,"v_equiv: " << v_equiv );
532     SG_LOG(SG_FLIGHT,SG_INFO,"v_equiv_kts: " << v_equiv_kts );
533     SG_LOG(SG_FLIGHT,SG_INFO,"v_calibrated: " << v_calibrated );
534     SG_LOG(SG_FLIGHT,SG_INFO,"v_calibrated_kts: " << v_calibrated_kts );
535     SG_LOG(SG_FLIGHT,SG_INFO,"gravity: " << gravity );
536     SG_LOG(SG_FLIGHT,SG_INFO,"centrifugal_relief: " << centrifugal_relief );
537     SG_LOG(SG_FLIGHT,SG_INFO,"alpha: " << alpha );
538     SG_LOG(SG_FLIGHT,SG_INFO,"beta: " << beta );
539     SG_LOG(SG_FLIGHT,SG_INFO,"alpha_dot: " << alpha_dot );
540     SG_LOG(SG_FLIGHT,SG_INFO,"beta_dot: " << beta_dot );
541     SG_LOG(SG_FLIGHT,SG_INFO,"cos_alpha: " << cos_alpha );
542     SG_LOG(SG_FLIGHT,SG_INFO,"sin_alpha: " << sin_alpha );
543     SG_LOG(SG_FLIGHT,SG_INFO,"cos_beta: " << cos_beta );
544     SG_LOG(SG_FLIGHT,SG_INFO,"sin_beta: " << sin_beta );
545     SG_LOG(SG_FLIGHT,SG_INFO,"cos_phi: " << cos_phi );
546     SG_LOG(SG_FLIGHT,SG_INFO,"sin_phi: " << sin_phi );
547     SG_LOG(SG_FLIGHT,SG_INFO,"cos_theta: " << cos_theta );
548     SG_LOG(SG_FLIGHT,SG_INFO,"sin_theta: " << sin_theta );
549     SG_LOG(SG_FLIGHT,SG_INFO,"cos_psi: " << cos_psi );
550     SG_LOG(SG_FLIGHT,SG_INFO,"sin_psi: " << sin_psi );
551     SG_LOG(SG_FLIGHT,SG_INFO,"gamma_vert_rad: " << gamma_vert_rad );
552     SG_LOG(SG_FLIGHT,SG_INFO,"gamma_horiz_rad: " << gamma_horiz_rad );
553     SG_LOG(SG_FLIGHT,SG_INFO,"sigma: " << sigma );
554     SG_LOG(SG_FLIGHT,SG_INFO,"density: " << density );
555     SG_LOG(SG_FLIGHT,SG_INFO,"v_sound: " << v_sound );
556     SG_LOG(SG_FLIGHT,SG_INFO,"mach_number: " << mach_number );
557     SG_LOG(SG_FLIGHT,SG_INFO,"static_pressure: " << static_pressure );
558     SG_LOG(SG_FLIGHT,SG_INFO,"total_pressure: " << total_pressure );
559     SG_LOG(SG_FLIGHT,SG_INFO,"impact_pressure: " << impact_pressure );
560     SG_LOG(SG_FLIGHT,SG_INFO,"dynamic_pressure: " << dynamic_pressure );
561     SG_LOG(SG_FLIGHT,SG_INFO,"static_temperature: " << static_temperature );
562     SG_LOG(SG_FLIGHT,SG_INFO,"total_temperature: " << total_temperature );
563     SG_LOG(SG_FLIGHT,SG_INFO,"sea_level_radius: " << sea_level_radius );
564     SG_LOG(SG_FLIGHT,SG_INFO,"earth_position_angle: " << earth_position_angle );
565     SG_LOG(SG_FLIGHT,SG_INFO,"runway_altitude: " << runway_altitude );
566     SG_LOG(SG_FLIGHT,SG_INFO,"runway_latitude: " << runway_latitude );
567     SG_LOG(SG_FLIGHT,SG_INFO,"runway_longitude: " << runway_longitude );
568     SG_LOG(SG_FLIGHT,SG_INFO,"runway_heading: " << runway_heading );
569     SG_LOG(SG_FLIGHT,SG_INFO,"radius_to_rwy: " << radius_to_rwy );
570     SG_LOG(SG_FLIGHT,SG_INFO,"climb_rate: " << climb_rate );
571     SG_LOG(SG_FLIGHT,SG_INFO,"sin_lat_geocentric: " << sin_lat_geocentric );
572     SG_LOG(SG_FLIGHT,SG_INFO,"cos_lat_geocentric: " << cos_lat_geocentric );
573     SG_LOG(SG_FLIGHT,SG_INFO,"sin_longitude: " << sin_longitude );
574     SG_LOG(SG_FLIGHT,SG_INFO,"cos_longitude: " << cos_longitude );
575     SG_LOG(SG_FLIGHT,SG_INFO,"sin_latitude: " << sin_latitude );
576     SG_LOG(SG_FLIGHT,SG_INFO,"cos_latitude: " << cos_latitude );
577     SG_LOG(SG_FLIGHT,SG_INFO,"altitude_agl: " << altitude_agl );
578 }  
579