diff --git a/Aircraft/Generic/flightrecorder/components/controls.xml b/Aircraft/Generic/flightrecorder/components/controls.xml new file mode 100644 index 000000000..8b2d99b41 --- /dev/null +++ b/Aircraft/Generic/flightrecorder/components/controls.xml @@ -0,0 +1,73 @@ + + + + + + + + + float + /controls/flight/aileron + + + float + /controls/flight/elevator + + + float + /controls/flight/rudder + + + float + /controls/flight/aileron-trim + + + float + /controls/flight/elevator-trim + + + float + /controls/flight/rudder-trim + + + float + /controls/flight/flaps + + + float + /controls/flight/speedbrake + + + float + /controls/flight/spoilers + + + float + /controls/gear/brake-left + + + float + /controls/gear/brake-right + + + float + /controls/gear/copilot-brake-left + + + float + /controls/gear/copilot-brake-right + + + float + /controls/gear/brake-parking + + + bool + /controls/gear/gear-down + + + bool + /controls/switches/master-avionics + + + diff --git a/Aircraft/Generic/flightrecorder/components/engine-jet.xml b/Aircraft/Generic/flightrecorder/components/engine-jet.xml new file mode 100644 index 000000000..09611bec9 --- /dev/null +++ b/Aircraft/Generic/flightrecorder/components/engine-jet.xml @@ -0,0 +1,72 @@ + + + + + + + + + float + /systems/electrical/outputs/fuel-pump[%i] + + + + float + /controls/engines/engine[%i]/starter + + + + float + /controls/engines/engine[%i]/throttle + + + + float + /controls/engines/engine[%i]/condition + + + + bool + /engines/engine[%i]/running + + + + bool + /engines/engine[%i]/cranking + + + + float + /engines/engine[%i]/rpm + + + + float + /engines/engine[%i]/n1 + + + + float + /engines/engine[%i]/n2 + + + + float/engines/engine[%i]/thrust-lbs + + + + float + /engines/engine[%i]/egt-degf + + + + float + /engines/engine[%i]/epr + + + + float + /engines/engine[%i]/oil-pressure-psi + + + diff --git a/Aircraft/Generic/flightrecorder/components/engine-piston-prop.xml b/Aircraft/Generic/flightrecorder/components/engine-piston-prop.xml new file mode 100644 index 000000000..ef4ea2ec5 --- /dev/null +++ b/Aircraft/Generic/flightrecorder/components/engine-piston-prop.xml @@ -0,0 +1,108 @@ + + + + + + + + + float + /systems/electrical/outputs/fuel-pump[%i] + + + + float + /controls/engines/engine[%i]/starter + + + + bool + /controls/engines/engine[%i]/master-bat + + + + bool + /controls/engines/engine[%i]/master-alt + + + + float + /controls/engines/engine[%i]/throttle + + + + float + /controls/engines/engine[%i]/mixture + + + + float + /controls/engines/engine[%i]/propeller-pitch + + + + float + /controls/engines/engine[%i]/condition + + + + float + /controls/engines/engine[%i]/magnetos + + + + bool + /engines/engine[%i]/running + + + + bool + /engines/engine[%i]/cranking + + + + float + /engines/engine[%i]/rpm + + + + float + /engines/engine[%i]/fuel-flow-gph + + + + float + /engines/engine[%i]/fuel-px-psi + + + + float + /engines/engine[%i]/egt-degf + + + + float + /engines/engine[%i]/cht-degf + + + + float + /engines/engine[%i]/mp-osi + + + + float + /engines/engine[%i]/tit + + + + float + /engines/engine[%i]/oil-temperature-degf + + + + float + /engines/engine[%i]/oil-pressure-psi + + + diff --git a/Aircraft/Generic/flightrecorder/components/engine-turboprop.xml b/Aircraft/Generic/flightrecorder/components/engine-turboprop.xml new file mode 100644 index 000000000..8e99246b8 --- /dev/null +++ b/Aircraft/Generic/flightrecorder/components/engine-turboprop.xml @@ -0,0 +1,122 @@ + + + + + + + + + float + /systems/electrical/outputs/fuel-pump[%i] + + + + float + /controls/engines/engine[%i]/starter + + + + bool + /controls/engines/engine[%i]/master-bat + + + + bool + /controls/engines/engine[%i]/master-alt + + + + float + /controls/engines/engine[%i]/throttle + + + + float + /controls/engines/engine[%i]/mixture + + + + float + /controls/engines/engine[%i]/propeller-pitch + + + + float + /controls/engines/engine[%i]/condition + + + + bool + /engines/engine[%i]/running + + + + bool + /engines/engine[%i]/cranking + + + + float + /engines/engine[%i]/rpm + + + + float + /engines/engine[%i]/fuel-flow-gph + + + + float + /engines/engine[%i]/fuel-px-psi + + + + float + /engines/engine[%i]/egt-degf + + + + float + /engines/engine[%i]/cht-degf + + + + float + /engines/engine[%i]/mp-osi + + + + float + /engines/engine[%i]/tit + + + + float + /engines/engine[%i]/oil-temperature-degf + + + + float + /engines/engine[%i]/oil-pressure-psi + + + + float + /engines/engine[%i]/n1 + + + + float + /engines/engine[%i]/n2 + + + + float/engines/engine[%i]/thrust-lbs + + + + float + /engines/engine[%i]/epr + + + diff --git a/Aircraft/Generic/flightrecorder/components/environment.xml b/Aircraft/Generic/flightrecorder/components/environment.xml new file mode 100644 index 000000000..eab533358 --- /dev/null +++ b/Aircraft/Generic/flightrecorder/components/environment.xml @@ -0,0 +1,41 @@ + + + + + + + + + float + /environment/wind-speed-kt + + + float + /environment/wind-from-heading-deg + + + float + /environment/turbulence/magnitude-norm + + + float + /environment/temperature-degc + + + float + /environment/pressure-sea-level-inhg + + + float + /environment/magnetic-variation-deg + + + bool + /hazards/icing/wing + + + float + /environment/visibility-m + + + diff --git a/Aircraft/Generic/flightrecorder/components/faults-engines.xml b/Aircraft/Generic/flightrecorder/components/faults-engines.xml new file mode 100644 index 000000000..af41fd223 --- /dev/null +++ b/Aircraft/Generic/flightrecorder/components/faults-engines.xml @@ -0,0 +1,42 @@ + + + + + + + + + bool + /controls/flight/flaps-serviceable + + + bool + /controls/engines/engine[%i]/faults/serviceable + + + + bool + /controls/engines/engine[%i]/faults/left-magneto-serviceable + + + + bool + /controls/engines/engine[%i]/faults/right-magneto-serviceable + + + + bool + /controls/engines/engine[%i]/faults/spark-plugs-serviceable + + + + bool + /controls/engines/engine[%i]/faults/oil-pressure-status + + + + bool + /controls/engines/engine[%i]/faults/fuel-pump-serviceable + + + diff --git a/Aircraft/Generic/flightrecorder/components/gear-fixed.xml b/Aircraft/Generic/flightrecorder/components/gear-fixed.xml new file mode 100644 index 000000000..a005a586c --- /dev/null +++ b/Aircraft/Generic/flightrecorder/components/gear-fixed.xml @@ -0,0 +1,28 @@ + + + + + + + + + float + /gear/gear[%i]/steering-norm + + + + float + /gear/gear[%i]/compression-norm + + + + bool + /gear/gear[%i]/wow + + + + float + /gear/gear[%i]/rollspeed-ms + + + diff --git a/Aircraft/Generic/flightrecorder/components/gear-retractable.xml b/Aircraft/Generic/flightrecorder/components/gear-retractable.xml new file mode 100644 index 000000000..165fb81dd --- /dev/null +++ b/Aircraft/Generic/flightrecorder/components/gear-retractable.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + float + /gear/gear[%i]/position-norm + + diff --git a/Aircraft/Generic/flightrecorder/components/position.xml b/Aircraft/Generic/flightrecorder/components/position.xml new file mode 100644 index 000000000..634143709 --- /dev/null +++ b/Aircraft/Generic/flightrecorder/components/position.xml @@ -0,0 +1,132 @@ + + + + + + + + + double + angular-deg + /position/longitude-deg + + + + double + angular-deg + /position/latitude-deg + + + + double + /position/altitude-ft + + + double + /position/altitude-agl-ft + + + + float + angular-deg + /orientation/roll-deg + + + float + angular-deg + /orientation/pitch-deg + + + float + angular-deg + /orientation/heading-deg + + + + float + angular-deg + /orientation/alpha-deg + + + float + angular-rad + /orientation/side-slip-rad + + + float + angular-deg + /orientation/beta-deg + + + float + /orientation/roll-rate-degps + + + float + /orientation/pitch-rate-degps + + + float + /orientation/yaw-rate-degps + + + float + /velocities/airspeed-kt + + + float + /velocities/vertical-speed-fps + + + float + /velocities/speed-north-fps + + + float + /velocities/speed-east-fps + + + float + /velocities/speed-down-fps + + + float + /velocities/vBody-fps + + + float + /velocities/uBody-fps + + + float + /velocities/wBody-fps + + + float + /accelerations/pilot/x-accel-fps_sec + + + float + /accelerations/pilot/y-accel-fps_sec + + + float + /accelerations/pilot/z-accel-fps_sec + + + + bool + /sim/alarms/stall-warning + + + + float + /instrumentation/slip-skid-ball/indicated-slip-skid + + + + float + /position/ground-elev-m + + + diff --git a/Aircraft/Generic/flightrecorder/components/rotor.xml b/Aircraft/Generic/flightrecorder/components/rotor.xml new file mode 100644 index 000000000..7496421bd --- /dev/null +++ b/Aircraft/Generic/flightrecorder/components/rotor.xml @@ -0,0 +1,41 @@ + + + + + + + + + float + roll-deg + angular-deg + + + float + rpm + + + float + stall + + + float + torque + + + float + yaw-deg + angular-deg + + + float + cone-deg + angular-deg + + + diff --git a/Aircraft/Generic/flightrecorder/components/surfaces.xml b/Aircraft/Generic/flightrecorder/components/surfaces.xml new file mode 100644 index 000000000..92daeec95 --- /dev/null +++ b/Aircraft/Generic/flightrecorder/components/surfaces.xml @@ -0,0 +1,45 @@ + + + + + + + + + float + /surface-positions/elevator-pos-norm + + + float + /surface-positions/elevator-trim-tab-pos-norm + + + float + /surface-positions/flap-pos-norm + + + float + /surface-positions/left-aileron-pos-norm + + + float + /surface-positions/right-aileron-pos-norm + + + float + /surface-positions/rudder-pos-norm + + + float + /surface-positions/speedbrake-pos-norm + + + float + /surface-positions/spoilers-pos-norm + + + float + /surface-positions/nose-wheel-pos-norm + + + diff --git a/Aircraft/Generic/flightrecorder/components/tanks.xml b/Aircraft/Generic/flightrecorder/components/tanks.xml new file mode 100644 index 000000000..4a423cf2f --- /dev/null +++ b/Aircraft/Generic/flightrecorder/components/tanks.xml @@ -0,0 +1,17 @@ + + + + + + + + + float + /consumables/fuel/tank[%i]/level-gal_us + + + bool + /controls/fuel/tank[%i]/fuel_selector + + + diff --git a/Aircraft/Generic/flightrecorder/generic-glider.xml b/Aircraft/Generic/flightrecorder/generic-glider.xml new file mode 100644 index 000000000..29ca92fbd --- /dev/null +++ b/Aircraft/Generic/flightrecorder/generic-glider.xml @@ -0,0 +1,29 @@ + + + + + + Generic Flight Recorder for Gliders (no engines/no tanks/single non-retractable gear) + + + + + + 1 + + + + + + float + /controls/engines/engine/throttle + + + + diff --git a/Aircraft/Generic/flightrecorder/generic-helicopter.xml b/Aircraft/Generic/flightrecorder/generic-helicopter.xml new file mode 100644 index 000000000..297d7a74a --- /dev/null +++ b/Aircraft/Generic/flightrecorder/generic-helicopter.xml @@ -0,0 +1,39 @@ + + + + + + Generic Flight Recorder for Helicopters + + + + + 2 + + + + + /rotors/main + + + + + /rotors/tail + + + + + + float + /controls/engines/engine/throttle + + + + diff --git a/Aircraft/Generic/flightrecorder/generic-jet.xml b/Aircraft/Generic/flightrecorder/generic-jet.xml new file mode 100644 index 000000000..76c555ab0 --- /dev/null +++ b/Aircraft/Generic/flightrecorder/generic-jet.xml @@ -0,0 +1,29 @@ + + + + + + Generic Flight Recorder for Jets (2 jet engines/4 tanks/3 retractable gear) + + + + + + 2 + + + 2 + + + 4 + + + 3 + + diff --git a/Aircraft/Generic/flightrecorder/generic-piston-propeller-1.xml b/Aircraft/Generic/flightrecorder/generic-piston-propeller-1.xml new file mode 100644 index 000000000..0e228ed6e --- /dev/null +++ b/Aircraft/Generic/flightrecorder/generic-piston-propeller-1.xml @@ -0,0 +1,29 @@ + + + + + + Generic Flight Recorder (1 piston engine/1 propeller/4 tanks/3 fixed gear) + + + + + + 1 + + + 1 + + + 2 + + + 3 + + diff --git a/Aircraft/Generic/flightrecorder/generic-piston-propeller-4.xml b/Aircraft/Generic/flightrecorder/generic-piston-propeller-4.xml new file mode 100644 index 000000000..be7ee7cb6 --- /dev/null +++ b/Aircraft/Generic/flightrecorder/generic-piston-propeller-4.xml @@ -0,0 +1,30 @@ + + + + + + Generic Flight Recorder (4 piston engines/4 propellers/4 tanks/3 retractable gear) + + + + + + 4 + + + 4 + + + 4 + + + 3 + + diff --git a/Aircraft/Generic/flightrecorder/generic-turboprop-2.xml b/Aircraft/Generic/flightrecorder/generic-turboprop-2.xml new file mode 100644 index 000000000..15f20eefd --- /dev/null +++ b/Aircraft/Generic/flightrecorder/generic-turboprop-2.xml @@ -0,0 +1,29 @@ + + + + + + Generic Flight Recorder (2 turboprop engines/2 propellers/4 tanks/3 retractable gear) + + + + + + 2 + + + 2 + + + 4 + + + 3 + + diff --git a/Docs/README.flightrecorder b/Docs/README.flightrecorder new file mode 100644 index 000000000..e8a40ebe1 --- /dev/null +++ b/Docs/README.flightrecorder @@ -0,0 +1,292 @@ +FlightGear Flight Recorder Mini-HOWTO + +Thorsten Brehm +Started in August 2011 +Last revised: 2011-09-26 + + +FlightGear provides a customizable flight recorder capable of capturing +any selection of properties described via XML configuration files. +The recorder is currently used for the replay system. + + +Feature Brief +------------- +* Generic recording system, adaptable to any aircraft/data, provided that + data is accessible via the property tree. No hard-coded selections or + assumptions on properties to be recorded. +* Configuration read from XML files or the property tree itself. +* Interpolation method configurable per recorded/replayed signal. +* Adaptable recording resolution per signal. +* Multiple configurations supported. + + +Quick Start: Basic Configuration +-------------------------------- +To configure and adapt the flight recorder, add a "/sim/flight-recorder" +section to your aircraft -set.xml file. + +Example: + + + + + + + 0 + + My Aircraft's Flight Recorder + + + float + /controls/gear/nosegear-steering-cmd-norm + linear + + + + + + + + + +Default type for each signal is "float". Default "interpolation" method +is "linear" (for float/double). Default values may be omitted. See +configuration details below. + + +Generic Configuration Files +--------------------------- +Select one of the default configuration files to specify the basic +properties to be recorded. It's not recommended to specify all +properties to be recorded individually. +The following generic files are provided: + +* /Aircraft/Generic/flightrecorder/generic-piston-propeller-4.xml + Matches propeller aircraft with 4 piston engines, 4 tanks, + 3 retractable gear. + It is the same configuration that was hard-coded for the replay system + up to FlightGear 2.4.0. To provide backward compatibility this + configuration is loaded by default, unless an aircraft provides a + specific flight recorder configuration. + +* /Aircraft/Generic/flightrecorder/generic-piston-propeller-1.xml + Matches propeller aircraft with 1 piston engines, 2 tanks, 3 fixed + gear. + +* /Aircraft/Generic/flightrecorder/generic-turboprop-2.xml + Matches turboprop aircraft with 2 turbines/propellers, 4 tanks, + 3 retractable gear. + +* /Aircraft/Generic/flightrecorder/generic-jet.xml + Matches jet aircraft with 2 jet engines, 4 tanks. + +* /Aircraft/Generic/flightrecorder/generic-glider.xml + Matches gliders (no engines, no tanks, single fixed gear). + +* /Aircraft/Generic/flightrecorder/generic-helicopter.xml + Matches helicopters with main and tail rotor (tested with YASim). + +If none of the generic files matches your aircraft, simply use a +configuration which covers more than you need. Alternatively, copy the +contents of one of these generic files to your aircraft, and adapt as +needed (see below). + +FDM experts are welcome to add more generic configuration files to +/Aircraft/Generic/flightrecorder - such as YASim-/JSBSim-specific +configurations, and configurations for other types of aircraft +(balloons, airships, ...). + + +Generic Components +----------------- +The generic configuration files in turn include a set of generic +components. If you copy the contents of a generic file to your aircraft, +you can adapt the components to your needs. See examples. +It is not recommended to copy the contents of the _component_ files to +an aircraft though (causes too much hassle and dependencies). + +Engine Selection: + * /Aircraft/Generic/flightrecorder/components/engine-jet.xml + Records properties of a single jet engine. + For multiple jet engines, use "count". Example for 4 jets: + + 4 + + + * /Aircraft/Generic/flightrecorder/components/engine-piston.xml + Records properties of a single piston engine and propeller. + For multiple piston engines, use "count" (see "jet" example). + + * /Aircraft/Generic/flightrecorder/components/rotor.xml + Records properties of a single helicopter rotor (tested with YASim). + To use this, provide the base property path to the rotor as "prefix". + Example recording the rotor below "/rotors/main": + + /rotors/main + + +Gear Selection: + * /Aircraft/Generic/flightrecorder/components/gear-fixed.xml + Records properties of a single non-retractable gear. + For multiple fixed gear, use "count" (see "jet" example). + + * /Aircraft/Generic/flightrecorder/components/gear-retractable.xml + Records properties of a single retractable gear. + For multiple retractable gear, use "count" (see "jet" example). + +Tanks: + * /Aircraft/Generic/flightrecorder/components/tanks.xml + Records properties of a single fuel tank. + For multiple fuel tanks, use "count" (see "jet" example). + +Other: + * /Aircraft/Generic/flightrecorder/components/surfaces.xml + Records properties of flight control surfaces. Include this + for aircraft (with wings). Not useful for helicopters, + balloons, ... + + * /Aircraft/Generic/flightrecorder/components/faults-engines.xml + Records fault properties of a single engine. Only include this + if your aircraft supports fault simulation. + For multiple engines, use "count" (see "jet" example). If used, + it should be compined with piston or jet engine. + + * /Aircraft/Generic/flightrecorder/components/environment.xml + Records properties of environment/weather (visibility, + temperature - but _not_ cloud position...). + + * /Aircraft/Generic/flightrecorder/components/position.xml + Records properties of a the aircrafts main position (latitude, + longitude, velocities, ...). + This is the most important component. Always include this. + + * /Aircraft/Generic/flightrecorder/components/controls.xml + Records most important flight controls (rudder, aileron, + elevator, ...). Always include this. + + +Custom Properties +----------------- +When the generic or component files are not be sufficient to record or +replay aircraft-specific effects, you can add custom properties (signals +to be recorded) to the configuration. +Each signal consits of a recording type/resolution (which does _not_ +need to match the actual type in the property tree!), the path to the +property and interpolation type. + +Example recording some additional custom properties: + + + + + + float + /controls/gear/nosegear-steering-cmd-norm + + + double + rotational-deg + /ai/model/carrier/alpha-angle-deg + + + bool + /controls/panel/custom-switch + + + + + + +Signal Configuration +-------------------- +Template: + + bool + angular-deg + /controls/panel/custom-switch + + +* type: The signal's type specifies the recording resolution - not the + type of the original property. The following types are supported: + + - double: 8 byte/sample + - float: 4 byte/sample (default) + - int: 4 byte/sample, integer + - int16: 2 byte/sample, integer + - int8: 1 byte/sample, integer + - bool: 1 bit/sample (yes, 1 bit. 8 bools per byte). + + String type is unsupported (too expensive). + +* interpolation: Specifies how values are interpolated during replay, i.e. + when replay is in slow-motion mode and more frames/second are required + than recorded, or when replaying data from the medium/long term memory. + Supported methods: + - discrete: No interpolation. Default for integer/bool types. + - linear: Standard linear interpolation. Default for float/double. + - angular-rad (or angular): Angular values in radians (0-2pi). + - angular-deg: Angular values in degrees (0-360). + +* property: Path to the property to be recorded. + + +Advanced Configuration +---------------------- +- Multipe recorder configurations for a single aircraft are supported + (multiple "" sections for n=0,1,...). + Active configuration to be used for the replay system is selected via + /sim/flight-recorder/replay-config (= 0,1,...). + This can be useful for specific recorders for specific scenarios, + which should not be used by default. For example, a specific recorder + configuration could be provided which also records the position of + an aircraft carrier, of other AI aircraft, ... + This may also be useful for future use, i.e. to select another flight + recorded configuration for a different purpose, such as for the + multiplayer system. + +- Flight recorder configuration can be adapted during run-time + (configuration is visible in the property browser below + /sim/flight-recorder). However it is necessary to reset (reinit) the + replay subsystem first - which also erases earlier recordings. It is + not possible to mix recordings of different configurations on to a + single "tape". + +- Each configuration should be given a name. Useful for a (future) + selection GUI, when multiple configurations are available. + + +Optimizing Performance +---------------------- +- Recording properties consumes memory and also CPU time. A few + additional properties don't matter much, but avoid execessive numbers. + Reduce the resolution (type) of signals to the minimum necessary to + save space. +- Use "bool" types where possible, they are most efficient. +- Avoid recording with "double" resolution (type "double"). Use "float" + instead - even if the original property in the property tree is a + "double" (almost all of them do). "float" precision is almost always + sufficient for recording/replay purposes, with few exceptions (like + latitude/longitude properties). +- Use int16/int8 for "small" integer values. + + +Recording/Replay Limits +----------------------- +- All properties can be recorded, however, only writable properties can + be replayed. Properties marked as read-only, or tied properties not + implementing the "set" method cannot be replayed. +- Replaying a property overwrites the property's value. However, other + sources may also write to the same property - such as Nasal code, + autopilot rules etc. When multiple sources "fight" over a property's + value then the last update "wins" - resulting in a dependency to an + unknown/random sequence. Hence, during deplay, try to disable other + sources writing to properties which were recorded and should be + replayed. + If the other source cannot be disabled, check if you're recording the + right property. It may be better to record the input properties of the + other source instead (i.e. the inputs processed by the Nasal or + autopilot rule). + +__end__ +