From 600964a0b3f99e51c13243df6b25450ccf39cf85 Mon Sep 17 00:00:00 2001 From: Carlos Villalobos Date: Wed, 10 Jul 2024 00:33:23 -0500 Subject: [PATCH] chore: add new plane related offsets --- .changeset/lovely-trains-mix.md | 5 ++++ .../position-attitude/position-attitude.ts | 29 ++++++++++++++++++- 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 .changeset/lovely-trains-mix.md diff --git a/.changeset/lovely-trains-mix.md b/.changeset/lovely-trains-mix.md new file mode 100644 index 0000000..d8c86d0 --- /dev/null +++ b/.changeset/lovely-trains-mix.md @@ -0,0 +1,5 @@ +--- +'@fsuipc.js/api': patch +--- + +add plane related offsets (altitude AMSL, atltitude AGL, indicated altitude, landing rate) diff --git a/packages/api/src/utils/offsets/position-attitude/position-attitude.ts b/packages/api/src/utils/offsets/position-attitude/position-attitude.ts index 98277fa..932cec9 100644 --- a/packages/api/src/utils/offsets/position-attitude/position-attitude.ts +++ b/packages/api/src/utils/offsets/position-attitude/position-attitude.ts @@ -117,11 +117,29 @@ export const positionAttitude: OffsetList = { value: 0x570, name: 'altitude', category: OffsetCategory.POSITION_ATTITUDE, - description: 'altitude - AGL', + description: 'altitude - AMSL', type: Type.Int64, convert: '+({VAL} * 3.28084 / (65536 * 65536)).toFixed(2)', permission: 'rw' }), + altitudeAgl: new Offset({ + value: 0x31e4, + name: 'altitudeAgl', + category: OffsetCategory.POSITION_ATTITUDE, + description: 'altitude - radio', + type: Type.Int32, + convert: '+({VAL} * 3.28084 / 65536).toFixed(2)', + permission: 'rw' + }), + altitudeCalibrated: new Offset({ + value: 0x3324, + name: 'altitudeCalibrated', + category: OffsetCategory.POSITION_ATTITUDE, + description: 'altitude - calibrated - ft - from altimeter', + type: Type.Int32, + convert: '+({VAL}).toFixed(2)', + permission: 'r' + }), pitch: new Offset({ value: 0x578, name: 'pitch', @@ -255,5 +273,14 @@ export const positionAttitude: OffsetList = { convert: '{VAL} / 20480', type: Type.UInt16, permission: 'r' + }), + landingRate: new Offset({ + value: 0x030c, + name: 'landingRate', + category: OffsetCategory.POSITION_ATTITUDE, + description: 'landing rate - ft/min', + convert: '{VAL} * 60 * 3.28084 / 256', + type: Type.Int16, + permission: 'r' }) };