-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(RA): RA model based on a probe mesh implementation #7807
Open
Taz5150
wants to merge
37
commits into
flybywiresim:master
Choose a base branch
from
Taz5150:radalt-system
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,043
−46
Open
Changes from all commits
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
071296b
feat(RA): RA model based on a probe mesh implementation
Taz5150 123f408
feat(RA): RA model based on a probe mesh implementation
Taz5150 3f1e332
Merge branch 'flybywiresim:master' into radalt-system
Taz5150 7f22c11
Merge branch 'master' into radalt-system
Taz5150 ce4fb6d
feat: baseline for RA calculation by signal SNR
Taz5150 9917c4f
fix: included noise floor to SNR
Taz5150 4f43eb8
Merge branch 'master' into radalt-system
Taz5150 9876f2f
Merge branch 'master' into radalt-system
Taz5150 a63cef2
Update CHANGELOG.md
Taz5150 d100069
Merge remote-tracking branch 'upstream/master' into radalt-system
Taz5150 6c0c7f7
Merge branch 'radalt-system' of https://github.com/Taz5150/a32nx into…
Taz5150 019d96f
feat: new probe algorithm to improve performance
Taz5150 7fe265e
Merge branch 'flybywiresim:master' into radalt-system
Taz5150 b2c67a3
feat: probes measured by received power
Taz5150 707df21
Merge branch 'radalt-system' of https://github.com/Taz5150/a32nx into…
Taz5150 1e44064
Merge branch 'flybywiresim:master' into radalt-system
Taz5150 2328176
Merge branch 'flybywiresim:master' into radalt-system
Taz5150 6f2921e
refactor & feat: AC Bus power on
Taz5150 e89493a
Merge branch 'master' into radalt-system
Taz5150 98e254e
Update build.sh
Taz5150 759c047
Make build.sh executable
Taz5150 8a4bb9a
fix: TCAS probe detection fixed
Taz5150 31bb03e
Merge branch 'master' into radalt-system
Taz5150 b44ab3a
Update TcasComputer.ts
Taz5150 5b59985
Merge branch 'radalt-system' of https://github.com/Taz5150/a32nx into…
Taz5150 a494c71
Merge branch 'master' into radalt-system
Taz5150 b181f4d
fix: several documented fixes
Taz5150 8943e1a
Merge branch 'master' into radalt-system
Taz5150 5f8240e
Update fbw-a32nx/src/wasm/radalt_a320/src/radaltControl.h
Taz5150 bb89a1f
Update fbw-a32nx/src/wasm/radalt_a320/src/radaltControl.h
Taz5150 f771496
Update fbw-a32nx/src/wasm/radalt_a320/src/radaltControl.h
Taz5150 2fb7485
Update fbw-a32nx/src/wasm/radalt_a320/src/radaltControl.h
Taz5150 2fabd17
Update fbw-a32nx/src/wasm/radalt_a320/src/radaltGauge.cpp
Taz5150 2481d44
Update fbw-a32nx/src/wasm/radalt_a320/src/radaltControl.h
Taz5150 4b91d0f
Merge branch 'master' into radalt-system
Taz5150 f318045
update: suggestions from 2Hwk
Taz5150 e99292c
Merge branch 'master' into radalt-system
tracernz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+36 Bytes
...bywire-aircraft-a320-neo/SimObjects/GroundVehicles/Probe/model/triangleWithoutIndices.bin
Binary file not shown.
54 changes: 54 additions & 0 deletions
54
...ywire-aircraft-a320-neo/SimObjects/GroundVehicles/Probe/model/triangleWithoutIndices.gltf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
{ | ||
"scene" : 0, | ||
"scenes" : [ | ||
{ | ||
"nodes" : [ 0 ] | ||
} | ||
], | ||
|
||
"nodes" : [ | ||
{ | ||
"mesh" : 0 | ||
} | ||
], | ||
|
||
"meshes" : [ | ||
{ | ||
"primitives" : [ { | ||
"attributes" : { | ||
"POSITION" : 0 | ||
} | ||
} ] | ||
} | ||
], | ||
|
||
"buffers" : [ | ||
{ | ||
"uri" : "triangleWithoutIndices.bin", | ||
"byteLength" : 36 | ||
} | ||
], | ||
"bufferViews" : [ | ||
{ | ||
"buffer" : 0, | ||
"byteOffset" : 0, | ||
"byteLength" : 36, | ||
"target" : 34962 | ||
} | ||
], | ||
"accessors" : [ | ||
{ | ||
"bufferView" : 0, | ||
"byteOffset" : 0, | ||
"componentType" : 5126, | ||
"count" : 3, | ||
"type" : "VEC3", | ||
"max" : [ 1.0, 1.0, 0.0 ], | ||
"min" : [ 0.0, 0.0, 0.0 ] | ||
} | ||
], | ||
|
||
"asset" : { | ||
"version" : "2.0" | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
fbw-a32nx/src/base/flybywire-aircraft-a320-neo/SimObjects/GroundVehicles/Probe/sim.cfg
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[VERSION] | ||
Major=1 | ||
Minor=0 | ||
|
||
|
||
[fltsim.0] | ||
title=triangleWithoutIndices | ||
model= | ||
texture= | ||
|
||
[General] | ||
category=GroundVehicle |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# This CMakeLists.txt file is used only for syntax highlighting and navigating | ||
# through the code in an IDE. It is not used for building the project. | ||
|
||
cmake_minimum_required(VERSION 3.19) | ||
project(flybywire-a32nx-radalt) | ||
|
||
set(CMAKE_CXX_STANDARD 20) | ||
set(MSFS_SDK "C:\\MSFS SDK") | ||
|
||
set(CMAKE_CXX_FLAGS "-c -g -DDEBUG -Wno-unused-command-line-argument -Wno-ignored-attributes -Wno-macro-redefined --sysroot \"${MSFS_SDK}/WASM/wasi-sysroot\" -target wasm32-unknown-wasi -flto -D_MSFS_WASM=1 -D__wasi__ -D_LIBCPP_HAS_NO_THREADS -D_WINDLL -D_MBCS -mthread-model single -fno-exceptions -fms-extensions") | ||
|
||
include_directories("${MSFS_SDK}/WASM/include") | ||
include_directories("${MSFS_SDK}/WASM/wasi-sysroot/include") | ||
include_directories("${MSFS_SDK}/SimConnect SDK/include") | ||
|
||
include_directories( | ||
./src | ||
) | ||
|
||
add_executable(flybywire-a32nx-radalt | ||
./src/radaltGauge.cpp | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
#!/bin/bash | ||
|
||
# get directory of this script relative to root | ||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" | ||
OUTPUT="${DIR}/../../../out/flybywire-aircraft-a320-neo/SimObjects/AirPlanes/FlyByWire_A320_NEO/panel/radalt.wasm" | ||
|
||
if [ "$1" == "--debug" ]; then | ||
CLANG_ARGS="-g" | ||
else | ||
WASMLD_ARGS="--strip-debug" | ||
fi | ||
|
||
set -ex | ||
|
||
# create temporary folder for o files | ||
mkdir -p "${DIR}/obj" | ||
pushd "${DIR}/obj" | ||
|
||
# compile c++ code for the A32NX | ||
clang++ \ | ||
-c \ | ||
${CLANG_ARGS} \ | ||
-std=c++20 \ | ||
-Wno-unused-command-line-argument \ | ||
-Wno-ignored-attributes \ | ||
-Wno-macro-redefined \ | ||
--sysroot "${MSFS_SDK}/WASM/wasi-sysroot" \ | ||
-target wasm32-unknown-wasi \ | ||
-flto \ | ||
-D_MSFS_WASM=1 \ | ||
-D__wasi__ \ | ||
-D_LIBCPP_HAS_NO_THREADS \ | ||
-D_WINDLL \ | ||
-D_MBCS \ | ||
-mthread-model single \ | ||
-fno-exceptions \ | ||
-fms-extensions \ | ||
-fvisibility=hidden \ | ||
-O3 \ | ||
-I "${MSFS_SDK}/WASM/include" \ | ||
-I "${MSFS_SDK}/SimConnect SDK/include" \ | ||
"${DIR}/src/radaltGauge.cpp" | ||
|
||
# restore directory. | ||
popd | ||
|
||
wasm-ld \ | ||
--no-entry \ | ||
--allow-undefined \ | ||
-L "${MSFS_SDK}/WASM/wasi-sysroot/lib/wasm32-wasi" \ | ||
-lc "${MSFS_SDK}/WASM/wasi-sysroot/lib/wasm32-wasi/libclang_rt.builtins-wasm32.a" \ | ||
--export __wasm_call_ctors \ | ||
${WASMLD_ARGS} \ | ||
--export-dynamic \ | ||
--export malloc \ | ||
--export free \ | ||
--export __wasm_call_ctors \ | ||
--export-table \ | ||
--gc-sections \ | ||
-O3 --lto-O3 \ | ||
-lc++ -lc++abi \ | ||
${DIR}/obj/*.o \ | ||
-o $OUTPUT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
#pragma once | ||
|
||
/// <summary> | ||
/// A collection of SimVar unit enums. | ||
/// </summary> | ||
class Units { | ||
public: | ||
ENUM Percent = get_units_enum("Percent"); | ||
ENUM Pounds = get_units_enum("Pounds"); | ||
ENUM Psi = get_units_enum("Psi"); | ||
ENUM Pph = get_units_enum("Pounds per hour"); | ||
ENUM Gallons = get_units_enum("Gallons"); | ||
ENUM Feet = get_units_enum("Feet"); | ||
ENUM FootPounds = get_units_enum("Foot pounds"); | ||
ENUM FeetMin = get_units_enum("Feet per minute"); | ||
ENUM Number = get_units_enum("Number"); | ||
ENUM Mach = get_units_enum("Mach"); | ||
ENUM Millibars = get_units_enum("Millibars"); | ||
ENUM SluggerSlugs = get_units_enum("Slug per cubic feet"); | ||
ENUM Celsius = get_units_enum("Celsius"); | ||
ENUM Bool = get_units_enum("Bool"); | ||
ENUM Hours = get_units_enum("Hours"); | ||
ENUM Seconds = get_units_enum("Seconds"); | ||
}; | ||
|
||
/// <summary> | ||
/// A collection of SimVars and LVars for the A32NX | ||
/// </summary> | ||
class SimVars { | ||
public: | ||
Units* m_Units; | ||
|
||
/// <summary> | ||
/// Collection of LVars for the A32NX | ||
/// </summary> | ||
ENUM PlaneAltitudeAGL = get_aircraft_var_enum("PLANE ALT ABOVE GROUND"); | ||
|
||
ID DevVar; | ||
ID ProbeZero; | ||
ID RadAlt; | ||
ID AcBus1; | ||
ID AcBus2; | ||
|
||
SimVars() { this->initializeVars(); } | ||
|
||
void initializeVars() { | ||
DevVar = register_named_variable("A32NX_DEVELOPER_STATE"); | ||
ProbeZero = register_named_variable("A32NX_RA_PROBE_ZERO"); | ||
RadAlt = register_named_variable("A32NX_RA_RAW"); | ||
AcBus1 = register_named_variable("A32NX_ELEC_AC_1_BUS_IS_POWERED"); | ||
AcBus2 = register_named_variable("A32NX_ELEC_AC_2_BUS_IS_POWERED"); | ||
|
||
//this->setDeveloperState(0); | ||
this->setRadioAltitude(99999); | ||
this->setProbeZero(0); | ||
|
||
|
||
m_Units = new Units(); | ||
} | ||
// Collection of LVar 'set' Functions | ||
void setProbeZero(FLOAT64 value) { set_named_variable_value(ProbeZero, value); } | ||
void setDeveloperState(FLOAT64 value) { set_named_variable_value(DevVar, value); } | ||
void setRadioAltitude(FLOAT64 value) { set_named_variable_value(RadAlt, value); } | ||
|
||
// Collection of SimVar/LVar 'get' Functions | ||
FLOAT64 getDeveloperState() { return get_named_variable_value(DevVar); } | ||
FLOAT64 getRadarAltitude() { return get_named_variable_value(RadAlt); } | ||
FLOAT64 getAcBusState1() { return get_named_variable_value(AcBus1); } | ||
FLOAT64 getAcBusState2() { return get_named_variable_value(AcBus2); } | ||
FLOAT64 getPlaneAltitudeAGL() { return aircraft_varget(PlaneAltitudeAGL, m_Units->Feet, 0); } | ||
}; |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please rebase/merge and move to 0.13.0.