-
Notifications
You must be signed in to change notification settings - Fork 1.8k
SITL running in-browser / in Configurator as WASM (web assembly) for comparison #11314
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
Open
sensei-hacker
wants to merge
7
commits into
iNavFlight:maintenance-9.x
Choose a base branch
from
sensei-hacker:feature/wasm-sitl-squashed
base: maintenance-9.x
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.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
7f65830
build(wasm): Add WASM/Emscripten toolchain support
sensei-hacker cb1de56
feat(wasm): Add parameter group hooks for WASM runtime allocation
sensei-hacker ee958aa
feat(wasm): Add FC integration hooks for WASM SITL
sensei-hacker f7a037b
feat(wasm): Add WebSocket serial driver for PWA compatibility
sensei-hacker 665b3f1
feat(wasm): Add WASM SITL target implementation
sensei-hacker 79b34a8
test(wasm): Add MSP test harness and PG registry generator
sensei-hacker 803d8bf
Add IndexedDB-based settings persistence for WASM SITL
sensei-hacker 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,4 @@ | ||
| # WASM toolchain checks | ||
| # Emscripten provides its own compiler checks, so this file is minimal | ||
|
|
||
| # No additional checks needed for WASM/Emscripten builds |
This file contains hidden or 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,46 @@ | ||
| # Emscripten/WebAssembly toolchain for SITL | ||
| # This toolchain allows INAV SITL to compile to WebAssembly for browser-based simulation | ||
|
|
||
| # Set build type if not specified | ||
| if(NOT CMAKE_CONFIGURATION_TYPES) | ||
| set(CMAKE_CONFIGURATION_TYPES Debug Release RelWithDebInfo) | ||
| endif() | ||
| if(CMAKE_BUILD_TYPE STREQUAL "") | ||
| set(CMAKE_BUILD_TYPE RelWithDebInfo) | ||
| endif() | ||
|
|
||
| # Find Emscripten | ||
| if(NOT DEFINED ENV{EMSDK}) | ||
| if(EXISTS "$ENV{HOME}/emsdk/emsdk_env.sh") | ||
| message(STATUS "EMSDK not set, trying to use ~/emsdk") | ||
| set(ENV{EMSDK} "$ENV{HOME}/emsdk") | ||
| else() | ||
| message(FATAL_ERROR "EMSDK environment variable not set. Please run: source ~/emsdk/emsdk_env.sh") | ||
| endif() | ||
| endif() | ||
|
|
||
| # Set Emscripten compilers | ||
| set(CMAKE_SYSTEM_NAME Emscripten) | ||
| set(CMAKE_SYSTEM_VERSION 1) | ||
|
|
||
| set(CMAKE_C_COMPILER "emcc" CACHE INTERNAL "c compiler") | ||
| set(CMAKE_CXX_COMPILER "em++" CACHE INTERNAL "c++ compiler") | ||
| set(CMAKE_AR "emar" CACHE INTERNAL "ar") | ||
| set(CMAKE_RANLIB "emranlib" CACHE INTERNAL "ranlib") | ||
|
|
||
| # Build type flags | ||
| set(debug_options "-O0 -g") | ||
| set(release_options "-O2 -DNDEBUG") | ||
| set(relwithdebinfo_options "-g ${release_options}") | ||
|
|
||
| set(CMAKE_C_FLAGS_DEBUG ${debug_options} CACHE INTERNAL "c compiler flags debug") | ||
| set(CMAKE_CXX_FLAGS_DEBUG ${debug_options} CACHE INTERNAL "c++ compiler flags debug") | ||
|
|
||
| set(CMAKE_C_FLAGS_RELEASE ${release_options} CACHE INTERNAL "c compiler flags release") | ||
| set(CMAKE_CXX_FLAGS_RELEASE ${release_options} CACHE INTERNAL "cxx compiler flags release") | ||
|
|
||
| set(CMAKE_C_FLAGS_RELWITHDEBINFO ${relwithdebinfo_options} CACHE INTERNAL "c compiler flags relwithdebinfo") | ||
| set(CMAKE_CXX_FLAGS_RELWITHDEBINFO ${relwithdebinfo_options} CACHE INTERNAL "cxx compiler flags relwithdebinfo") | ||
|
|
||
| # Mark as configured for Emscripten | ||
| set(CMAKE_CROSSCOMPILING_EMULATOR "\${CMAKE_CURRENT_BINARY_DIR}/node_modules/.bin/node" CACHE FILEPATH "Node.js for running WebAssembly") |
This file contains hidden or 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 hidden or 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 hidden or 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
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.
Suggestion: Add the missing MSP bridge functions (
_wasm_msp_process_command,_wasm_msp_get_api_version,_wasm_msp_get_fc_variant) to theEXPORTED_FUNCTIONSlist incmake/sitl.cmaketo ensure they are available to the JavaScript test harness. [possible issue, importance: 9]