
Open Source Drone Simulator
Test drone autonomy in your browser — zero install.
以下正文同步自 Hacker News 最新,版权归原站所有,已转换为易读排版。
skysim-demo1-preview-720p.mp4
Test drone autonomy in your browser — zero install.
Real aerodynamics in C++20. Real flight-controller firmware in the loop. ArduPilot · PX4 · Betaflight · Windows · Linux · macOS · WebAssembly
⬇ Download · ⬇ Download · 🧪 Benchmarks · 🗺 Roadmap · 🤝 Contribute
Every simulator that lets you test drone algorithms needs Linux, ROS, or a game engine and a GPU. SkySim's goal is to make it a URL.
Tested end-to-end: the Python agent interface, perception, data pipeline, benchmarks, and determinism harness; the Godot agent server, perception, and domain randomization (validated against Godot 4.3); and the web physics core (decoupled from Godot, validated natively).
Still needs the compiled C++ extension + hardware: real-flight aerodynamics, RGB rendering, cross-machine determinism numbers, and — the one thing no code can produce — a sim-to-real transfer result (see docs/sim_to_real.md). That last one is the single most valuable contribution open right now.
See ROADMAP.md for phase-by-phase progress.
- Fly it in your browser — nothing to install
(Phase 4, preview)
👉 Open the live demo — works in any modern desktop browser (Chrome, Firefox, Edge, Safari).
The physics core compiles to WebAssembly and runs entirely client-side. Fly with the keyboard, or drop in a JavaScript control function. The demo is rebuilt and redeployed automatically on every push to main (.github/workflows/pages.yml). To host your own copy, run web/build_wasm.sh and serve web/. Heavy ML and firmware SITL use the native agent server; the browser tier is for interactive flight and classical/light control.
Grab a standalone build from the Releases page:
No Godot, no compiler, no dependencies. Everything is bundled.
Pick the zip for your OS from the Assets list on the latest release
The build is unsigned, so Gatekeeper blocks a normal double-click. Right-click (or Control-click) the app and choose Open, then confirm once.
Install Godot 4.3+ — one portable download, no admin rights, no installer needed.
From Releases, download SkySim-godot-project.zip and unzip it. Prebuilt extension binaries for every OS are already inside — you don't compile anything.
Open Godot → Import → select the unzipped folder → Play.
① Click Import ② Select the unzipped folder ③ Press Play (F5)
- Developer / modder — build the C++ extension from source
You only need this if you're changing the C++ physics. It's one command and godot-cpp is fetched automatically — no git submodules.
Linux / macOS
./scripts/build.sh
Windows
scripts\build.bat
Prefer raw CMake? cmake -B build -DCMAKE_BUILD_TYPE=Release cmake --build build --parallel
Output: gdextension/bin/(lib)drone_sim.<platform>.release.<arch>.(dll|so|dylib)
Requirements: CMake ≥ 3.22, a C++20 compiler (MSVC 2022 / GCC 12+ / Clang 15+), Python 3.8+. Match godot-cpp to your editor with -DGODOTCPP_GIT_TAG=godot-4.3-stable.
Portability note: binaries are built without -march=native on purpose, so they run on any CPU of the same architecture. Turn on -DDRONE_SIM_NATIVE=ON only for a private single-machine build — it bakes in your CPU's instruction set and will crash elsewhere.
How the cross-platform binaries are made: you don't make them. Pushing a v* tag triggers GitHub Actions (.github/workflows/), which compiles the extension on Windows, Linux, and macOS (x86_64 + arm64), exports the standalone apps, and attaches everything to a Release automatically.
DroneBody (RigidBody3D subclass) ├── RotorArray → BladeElementSolver × N ← BET thrust/torque per rotor ├── Atmosphere ← ISA density/pressure + Dryden turbulence (MIL-HDBK-1797) ├── AeroEffectsBundle ← Cheeseman-Bennett ground effect + Leishman VRS ├── FlightController ← PX4-style cascade PID (attitude + rate) ├── MixerMatrix ← wrench → per-rotor throttle allocation ├── SensorSuite ← IMU / barometer / GPS with noise + bias └── SITLManager ← ArduPilot / PX4 / Betaflight bridges
Control priority each physics tick: SITL firmware (fresh actuator frame < 0.5 s) → set_rotor_throttles() → internal PID → motors off.
Copy the gdextension/ folder into your project root (Godot 4 auto-detects it — no plugin to enable).
Add a DroneBody node (appears under RigidBody3D) with a CollisionShape3D and a visual MeshInstance3D child.
For firmware-in-the-loop, add a SITLManager as a child of DroneBody.
Set Project Settings → Physics → Physics Ticks per Second = 250–400 (400 for ArduCopter). This project already ships at 400.
A minimal DroneBody scene tree Physics ticks set to 400
🔌 Flying with real flight-controller firmware (SITL)
Firmware Transport Port Who connects
ArduPilot UDP (sim = server) 9002 AP sends servo packets to us
PX4 TCP (sim = server) 4560 PX4 SITL connects to us
Betaflight TCP (sim = client) 5760 We connect to Betaflight
ArduPilot
cd ardupilot && sim_vehicle.py -v ArduCopter -f JSON:127.0.0.1 --console --map
PX4
cd PX4-Autopilot && make px4_sitl none_iris
Betaflight
cd betaflight && make TARGET=SITL && ./obj/main/betaflight_SITL.elf
Run the SkySim scene first, then start the firmware. Arming, modes, and missions come from your GCS (Mission Planner / QGroundControl). Frames are aerospace-standard (NED world / FRD body, see include/core/frames.hpp); rotor order follows the ArduPilot/PX4 quad-X convention.
SkySim on the left, QGroundControl on the right — the drone is flown by real PX4 firmware
tools/ap_json_probe.py and tools/px4_probe.py let you exercise the bridges without a full firmware checkout.
drone.get_telemetry() returns every physics tick: altitude, ground_speed, vertical_speed, roll/pitch/yaw_deg, roll/pitch/yaw_rate, total_thrust, power_draw, vrs_active, vrs_severity, ground_effect_factor, air_density, wind, sitl_active, sitl_source. Live PID tuning:
drone.set_rate_roll_pid(0.15, 0.05, 0.003) drone.set_rate_pitch_pid(0.15, 0.05, 0.003) drone.set_rate_yaw_pid(0.20, 0.10, 0.0)
🧪 Benchmarks & reproducibility
A small, stable suite of seeded tasks (hover, waypoint, gps_denied_nav) lets algorithms be compared and cited:
python examples/run_benchmark.py --port 5557 --out scorecard.json python examples/check_determinism.py --port 5557
For reference-quality reproducible numbers, build the extension with -DDRONE_SIM_DETERMINISTIC=ON (strict floating point). Details and how to submit results: docs/benchmarks.md.
Issues and PRs welcome — and you don't need to be a C++ physics person to help. A few places to start:
CI builds every PR on all three platforms, so if it compiles in the workflow it works for everyone. Physics stays in C++ (src/, include/); scene logic and dynamic-world helpers stay in GDScript (demo/).
If SkySim is useful to you, a ⭐ helps others find it.
正文由 探How 从来源站点 RSS 同步,内容未经改写;遇到排版缺失或需要图片、视频时请以原文为准。