FlightGear next
Network/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$
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
25// Version was bumped to 25 following commit 932938cb. This has been
26// reverted to restore backwards compatability. Structs should be
27// considered frozen.
28const uint32_t FG_NET_FDM_VERSION = 24;
29
30
31// Define a structure containing the top level flight dynamics model
32// parameters
33
34class FGNetFDM {
35
36public:
37
38 enum {
40 FG_MAX_WHEELS = 3,
41 FG_MAX_TANKS = 4
42 };
43
44 uint32_t version; // increment when data values change
45 uint32_t padding; // padding
46
47 // Positions
48 double longitude; // geodetic (radians)
49 double latitude; // geodetic (radians)
50 double altitude; // above sea level (meters)
51 float agl; // above ground level (meters)
52 float phi; // roll (radians)
53 float theta; // pitch (radians)
54 float psi; // yaw or true heading (radians)
55 float alpha; // angle of attack (radians)
56 float beta; // side slip angle (radians)
57
58 // Velocities
59 float phidot; // roll rate (radians/sec)
60 float thetadot; // pitch rate (radians/sec)
61 float psidot; // yaw rate (radians/sec)
62 float vcas; // calibrated airspeed
63 float climb_rate; // feet per second
64 float v_north; // north velocity in local/body frame, fps
65 float v_east; // east velocity in local/body frame, fps
66 float v_down; // down/vertical velocity in local/body frame, fps
67 float v_body_u; // ECEF velocity in body frame
68 float v_body_v; // ECEF velocity in body frame
69 float v_body_w; // ECEF velocity in body frame
70
71 // Accelerations
72 float A_X_pilot; // X accel in body frame ft/sec^2
73 float A_Y_pilot; // Y accel in body frame ft/sec^2
74 float A_Z_pilot; // Z accel in body frame ft/sec^2
75
76 // Stall
77 float stall_warning; // 0.0 - 1.0 indicating the amount of stall
78 float slip_deg; // slip ball deflection
79
80 // Pressure
81
82 // Engine status
83 uint32_t num_engines; // Number of valid engines
84 uint32_t eng_state[FG_MAX_ENGINES];// Engine state (off, cranking, running)
85 float rpm[FG_MAX_ENGINES]; // Engine RPM rev/min
86 float fuel_flow[FG_MAX_ENGINES]; // Fuel flow gallons/hr
87 float fuel_px[FG_MAX_ENGINES]; // Fuel pressure psi
88 float egt[FG_MAX_ENGINES]; // Exhuast gas temp deg F
89 float cht[FG_MAX_ENGINES]; // Cylinder head temp deg F
90 float mp_osi[FG_MAX_ENGINES]; // Manifold pressure
91 float tit[FG_MAX_ENGINES]; // Turbine Inlet Temperature
92 float oil_temp[FG_MAX_ENGINES]; // Oil temp deg F
93 float oil_px[FG_MAX_ENGINES]; // Oil pressure psi
94
95 // Consumables
96 uint32_t num_tanks; // Max number of fuel tanks
98
99
100 // Gear status
101 uint32_t num_wheels;
102 uint32_t wow[FG_MAX_WHEELS];
103 float gear_pos[FG_MAX_WHEELS];
106
107 // Environment
108 uint32_t cur_time; // current unix time
109 // FIXME: make this uint64_t before 2038
110 int32_t warp; // offset in seconds to unix time
111 float visibility; // visibility in meters (for env. effects)
112
113 // Control surface positions (normalized values)
114 float elevator;
115 float elevator_trim_tab;
116 float left_flap;
117 float right_flap;
118 float left_aileron;
119 float right_aileron;
120 float rudder;
121 float nose_wheel;
122 float speedbrake;
123 float spoilers;
124};
125
126
127#endif // _NET_FDM_HXX
double altitude
Definition ADA.cxx:46
double latitude
Definition ADA.cxx:53
double longitude
Definition ADA.cxx:54
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]