X-Git-Url: https://git.xandkar.net/?p=erlang-x-plane-data.git;a=blobdiff_plain;f=README.md;h=382c4b58d3bc85fc417e95b2213a4483770ebb31;hp=9c4654ddac17de1d7e6fea1682beb971f9accc08;hb=HEAD;hpb=924626bcacf350db1e794ecf92753bceccf64c8e diff --git a/README.md b/README.md index 9c4654d..382c4b5 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,10 @@ -[![Build Status](https://travis-ci.org/ibnfirnas/erlang-x_plane_data.svg?branch=master)](https://travis-ci.org/ibnfirnas/erlang-x_plane_data) +[![Build Status](https://travis-ci.org/xandkar/erlang-x-plane-data.svg?branch=master)](https://travis-ci.org/xandkar/erlang-x-plane-data) X-Plane UDP data parser ======================= +![Data output in the cockpit](screenshot.png) + Examples -------- @@ -23,7 +25,7 @@ Examples #### Raw -At this stage, only the structure of the packet was parsed. No attempt at +At this stage, only the structure of the packet was parsed. No attempts at interpreting the values have been made: ```erlang @@ -55,8 +57,8 @@ interpreting the values have been made: #### Named Here we identify what each of the numbered groups mean in a given X-Plane -version. Right now only X-Plane 10 is supported and I only identified 3 groups -so far: +version. Right now only X-Plane 10 (packet index 64) is supported and I only +identified 3 groups so far: | packet index | group index | group name | |--------------|-------------|----------------------| @@ -75,12 +77,7 @@ a filter), so you'll have to access their raw version, if needed. ##### Access ```erlang --include_lib("x_plane_data_group_lat_lon_alt.hrl"). --include_lib("x_plane_data_group_pitch_roll_heading.hrl"). --include_lib("x_plane_data_group_speeds.hrl"). - -... - +-include_lib("x_plane_data/include/x_plane_data_group_speeds.hrl"). {speeds, #x_plane_data_group_speeds { vind_kias = VindKias , vind_keas = VindKeas @@ -92,6 +89,9 @@ a filter), so you'll have to access their raw version, if needed. } } = lists:keyfind(speeds, 1, GroupsNamed), +... + +-include_lib("x_plane_data/include/x_plane_data_group_pitch_roll_heading.hrl"). {pitch_roll_heading, #x_plane_data_group_pitch_roll_heading { pitch_deg = PitchDeg , roll_deg = RollDeg @@ -99,10 +99,61 @@ a filter), so you'll have to access their raw version, if needed. , hding_mag = HdingMag } } = lists:keyfind(pitch_roll_heading, 1, GroupsNamed), + +... + +-include_lib("x_plane_data/include/x_plane_data_group_lat_lon_alt.hrl"). +{lat_lon_alt, #x_plane_data_group_lat_lon_alt + { lat_deg = LatDeg + , lon_deg = LonDeg + , alt_ftmsl = AltFtmsl + , alt_ftagl = AltFtagl + , on_runwy = OnRunwy + , alt_ind = AltInd + , lat_south = LatSouth + , lon_west = LonWest + } +} = lists:keyfind(lat_lon_alt, 1, GroupsNamed), +``` + +Packet structure +---------------- + +```erlang +<<"DATA", PacketIndex:8/integer, Groups/binary>>, +<< GroupIndex:32/little-integer + , GroupValue1:32/little-float + , GroupValue2:32/little-float + , GroupValue3:32/little-float + , GroupValue4:32/little-float + , GroupValue5:32/little-float + , GroupValue6:32/little-float + , GroupValue7:32/little-float + , GroupValue8:32/little-float + , GroupsRest/binary +>> = Groups, ``` -Data format references ----------------------- +Where `PacketIndex` indicates something like a schema version, i.e. what each +of the numbered groups means. For example, in X-Plane 10, packet index is 64 +(character `"@"`) and group 3 contains speed data, in which the 8 group values +are: + +| Location | Label | Description | +|----------|---------------|-------------| +| 1 | `vind_kias` | Velocity indicated, in knots indicated airspeed. | +| 2 | `vind_keas` | Velocity indicated, in knots equivalent airspeed (the calibrated airspeed corrected for adiabatic compressible flow at the craft's current altitude). | +| 3 | `vtrue_ktas` | Velocity true (the speed of the craft relative to undisturbed air), in knots true airspeed. | +| 4 | `vtrue_ktgs` | Velocity true, in knots true ground speed. | +| 5 | | Unused. Contains a dummy value. | +| 6 | `vind_mph` | Velocity indicated, in miles per hour. | +| 7 | `vtrue_mphas` | Velocity true, in miles per hour airspeed. | +| 8 | `vtrue_mphgs` | Velocity true, in miles per hour ground speed. | + + +References +---------- +- `X-Plane_10_manual.pdf` (distributed with X-Plane 10) - http://b58.svglobe.com/data.html - http://www.nuclearprojects.com/xplane/xplaneref.html