ArduPilot / ardupilot

ArduPlane, ArduCopter, ArduRover, ArduSub source
http://ardupilot.org/
GNU General Public License v3.0
11.06k stars 17.62k forks source link

Basic webasm build #28742

Open patrickelectric opened 14 hours ago

patrickelectric commented 14 hours ago

It gets starting but there is a bunch of stuff to do yet. I'm opening this as a draft to see if someone continue this work, maybe myself in the future.

davidbuzz commented 9 hours ago

I did a wasm sitl branch a while back just to see if I could.... I just commented out stuff that didnt work, or hacked stuff. https://github.com/davidbuzz/ardupilot/tree/buzz-wasm-testing

key gotchas:

used this: https://github.com/emscripten-core/emsdk.git ./emsdk install latest ./emsdk activate latest export CC=emcc export CXX=em++ export EMCC_DEBUG=1

davidbuzz commented 9 hours ago

extension project that could make this really valuable would be to enable "networking in browser" with a Tailscale wasm client, like is done here: https://github.com/leaningtech/webvm .. they have a "enable browser networking" functionality that can connect to TailScale server/s over websockets, ie does not require any ongoing server-side proxy. Tailscale has a free plan. you could connect a GCS that is elsewhere ( eg in another tab, on another puter) to the sitl-in-browser or other stuff.

patrickelectric commented 9 hours ago

My original idea was to integrate a full 3D environment, GCS and SITL (this PR) in the browser for simulation and decreasing the gap between ArduPilot and new developers.

davidbuzz commented 8 hours ago

My original idea was to integrate a full 3D environment, GCS and SITL (this PR) in the browser for simulation and decreasing the gap between ArduPilot and new developers.

...yup, that use-case, where all your other backend is on the same "box" wouldnt require tailscale, but would require a backend-server that supports websockets, and adding explicit websockets support to sitl as a compile-time alternative to raw TCP