FlightGear next
FDM/JSBSim/input_output/net_fdm.hxx
Go to the documentation of this file.
1// net_fdm.hxx -- defines a common net I/O interface to the flight
2// dynamics model
3//
4// Written by Curtis Olson - http://www.flightgear.org/~curt
5// Started September 2001.
6//
7// This file is in the Public Domain, and comes with no warranty.
8//
9// $Id: net_fdm.hxx,v 1.6 2013/11/09 14:06:36 bcoconni Exp $
10
11
12#ifndef _NET_FDM_HXX
13#define _NET_FDM_HXX
14
15
16#include <time.h> // time_t
17#include <simgear/misc/stdint.hxx>
18
19// NOTE: this file defines an external interface structure. Due to
20// variability between platforms and architectures, we only used fixed
21// length types here. Specifically, integer types can vary in length.
22// I am not aware of any platforms that don't use 4 bytes for float
23// and 8 bytes for double.
24
25const uint32_t FG_NET_FDM_VERSION = 24;
26
27
28// Define a structure containing the top level flight dynamics model
29// parameters
30
31class FGNetFDM {
32
33public:
34
35 enum {
39 };
40
41 uint32_t version; // increment when data values change
42 uint32_t padding; // padding
43
44 // Positions
45 double longitude; // geodetic (radians)
46 double latitude; // geodetic (radians)
47 double altitude; // above sea level (meters)
48 float agl; // above ground level (meters)
49 float phi; // roll (radians)
50 float theta; // pitch (radians)
51 float psi; // yaw or true heading (radians)
52 float alpha; // angle of attack (radians)
53 float beta; // side slip angle (radians)
54
55 // Velocities
56 float phidot; // roll rate (radians/sec)
57 float thetadot; // pitch rate (radians/sec)
58 float psidot; // yaw rate (radians/sec)
59 float vcas; // calibrated airspeed
60 float climb_rate; // feet per second
61 float v_north; // north velocity in local/body frame, fps
62 float v_east; // east velocity in local/body frame, fps
63 float v_down; // down/vertical velocity in local/body frame, fps
64 float v_body_u; // ECEF velocity in body axis
65 float v_body_v; // ECEF velocity in body axis
66 float v_body_w; // ECEF velocity in body axis
67
68 // Accelerations
69 float A_X_pilot; // X accel in body frame ft/sec^2
70 float A_Y_pilot; // Y accel in body frame ft/sec^2
71 float A_Z_pilot; // Z accel in body frame ft/sec^2
72
73 // Stall
74 float stall_warning; // 0.0 - 1.0 indicating the amount of stall
75 float slip_deg; // slip ball deflection
76
77 // Pressure
78
79 // Engine status
80 uint32_t num_engines; // Number of valid engines
81 uint32_t eng_state[FG_MAX_ENGINES];// Engine state (off, cranking, running)
82 float rpm[FG_MAX_ENGINES]; // Engine RPM rev/min
83 float fuel_flow[FG_MAX_ENGINES]; // Fuel flow gallons/hr
84 float fuel_px[FG_MAX_ENGINES]; // Fuel pressure psi
85 float egt[FG_MAX_ENGINES]; // Exhuast gas temp deg F
86 float cht[FG_MAX_ENGINES]; // Cylinder head temp deg F
87 float mp_osi[FG_MAX_ENGINES]; // Manifold pressure
88 float tit[FG_MAX_ENGINES]; // Turbine Inlet Temperature
89 float oil_temp[FG_MAX_ENGINES]; // Oil temp deg F
90 float oil_px[FG_MAX_ENGINES]; // Oil pressure psi
91
92 // Consumables
93 uint32_t num_tanks; // Max number of fuel tanks
95
96 // Gear status
97 uint32_t num_wheels;
98 uint32_t wow[FG_MAX_WHEELS];
102
103 // Environment
104 uint32_t cur_time; // current unix time
105 // FIXME: make this uint64_t before 2038
106 int32_t warp; // offset in seconds to unix time
107 float visibility; // visibility in meters (for env. effects)
108
109 // Control surface positions (normalized values)
110 float elevator;
116 float rudder;
119 float spoilers;
120};
121
122
123#endif // _NET_FDM_HXX
const uint32_t FG_NET_FDM_VERSION
uint32_t wow[FG_MAX_WHEELS]
float cht[FG_MAX_ENGINES]
float fuel_flow[FG_MAX_ENGINES]
float mp_osi[FG_MAX_ENGINES]
float gear_steer[FG_MAX_WHEELS]
float gear_pos[FG_MAX_WHEELS]
float tit[FG_MAX_ENGINES]
float egt[FG_MAX_ENGINES]
float oil_temp[FG_MAX_ENGINES]
float rpm[FG_MAX_ENGINES]
uint32_t eng_state[FG_MAX_ENGINES]
float gear_compression[FG_MAX_WHEELS]
float fuel_quantity[FG_MAX_TANKS]
float fuel_px[FG_MAX_ENGINES]
float oil_px[FG_MAX_ENGINES]