| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
GAP is a reinforcement-learning attack framework for demonstrating an architectural blind spot in UAV control pipelines. This repository contains the patched PX4 and ArduPilot firmware, GAP evaluation code, analysis scripts, and the pre-baked outputs used by the paper. The artifact bundle is distributed through Zenodo.
Zenodo DOI: 10.5281/zenodo.19652756
Given externally observable drone state, GAP generates an action intended to move the drone toward a target region. The action is a gyroscope bias vector that is added to the raw gyroscope readings before they reach the flight controller's state estimator. The biased readings perturb the controller's attitude estimate in a controlled way, which in turn causes the drone to drift in the direction GAP wants. The bias is held for one second; GAP then reads the next drone state, computes the next bias, and repeats this loop until the drone reaches the target region or the episode times out.
The artifact uses two evaluation geometries.
RQ6-sim uses the same inward parallel PX4-jMAVSim geometry as RQ1 (GAP) and RQ2. RQ6-real does not follow either geometry: the physical drone takes off, GAP issues bias commands, and the operator directs the trial manually in real time, one flight per trial.
In either geometry, each episode is scored against four success criteria at once, where Cyl. denotes a vertical cylinder around the target and Sph. denotes a sphere centered on the target:
The paper's headline numbers use Cyl. 10 m, which is what verify_claims.sh also reports.
RQ4 and real-drone RQ6 are manual workflows. See:
The Zenodo bundle offers two equivalent entry points. Pick whichever fits your environment.
A ready-to-run Ubuntu 22.04 VirtualBox image with the repository, Python environment, built firmwares, model checkpoints, and QGroundControl already in place. Import the image into VirtualBox, log in, and skip directly to Verify the Installation. Import time on a desktop-class host: about 5 minutes.
This VM image is equivalent to running Path B's ./setup.sh on a clean Ubuntu 22.04 install, so reviewers who prefer to rebuild from scratch can reproduce it end-to-end via Path B.
Build from scratch on a clean Ubuntu 22.04 host.
Side effects. ./setup.sh requires Internet, invokes sudo apt-get install (needs sudo), installs Python packages, and compiles both PX4 and ArduPilot. Expect about 30 minutes and an extra ~30 GiB of disk. The setup script creates a project-local .venv/ and builds the two firmware submodules under GAP-PX4-Autopilot/build/ and GAP-ardupilot/build/.
git clone --recurse-submodules https://github.com/postech-compsec/GAP.git ~/GAP
cd ~/GAP
./setup.sh
source .venv/bin/activateDownload and setup GAP models
The two RL checkpoints are distributed through Zenodo, not Git. Unpack them into:
gap_model/ is used by RQ1 to RQ5. sim-to-real_model/ is used by RQ6.
Path A reviewers already have both checkpoints in place and can skip this step.
Run this first to check that the artifact is installed correctly and that the shipped pre-baked results are internally consistent:
./experiments/run_smoke_test.sh
bash analysis/verify_claims.sh pre-baked
bash analysis/generate_all.sh pre-bakedWhat this does:
The main fresh automated reruns are RQ1, RQ2, and RQ3:
./experiments/run_rq1.sh --mode approx
./experiments/run_rq2.sh --mode approx
./experiments/run_rq3.sh
bash analysis/generate_all.sh fresh
bash analysis/verify_claims.sh freshOr run the same automated path through one wrapper:
./experiments/run_all.sh --mode approx
bash analysis/verify_claims.sh freshrun_all.sh executes the fresh automated path for RQ1, RQ2, and RQ3, then runs bash analysis/generate_all.sh fresh.
Fresh outputs are written under results/fresh/.
The --mode flag controls how many fresh trials are run per worker. approx runs 2 trials per worker — reviewers can exercise the fresh execution path without paying the paper's full wall-clock cost. full runs 100 trials per worker and matches the paper sample count. Both modes use the same code path; only the trial count differs. The shipped pre-baked data remains the exact paper result set in either case. All fresh reruns additionally need at least 10 GB free under results/fresh/ for raw flight logs.
Practical wall-clock estimates from our 12-core Ubuntu 22.04 reference host:
| Path | Human | Compute | Supports |
|---|---|---|---|
| Smoke test + pre-baked verify + regenerate | 5 min | ~10 min | C1–C6 |
| Fresh RQ1 (approx) | 5 min | ~2 h | C1 |
| Fresh RQ1 (full) | 5 min | ~4 h | C1 |
| Fresh RQ2 (approx) | 5 min | ~15 min | C2 |
| Fresh RQ2 (full) | 5 min | ~9 h | C2 |
| Fresh RQ3 | 5 min | ~7 h | C3 |
| Shipped RQ4 analysis | 3 min | <1 min | C4 |
| RQ5 failsafe analysis | 2 min | <1 min | C5 |
| Shipped RQ6 analysis | 2 min | <1 min | C6 |
Full automated fresh path (RQ1 + RQ2 + RQ3, approx): ~10 h wall-clock on 12 cores. In full mode: ~20 h.
analysis/verify_claims.sh has two modes that answer two different questions:
Use pre-baked for formal PASS/SKIP. Use fresh to interpret OBSERVED values as supplementary evidence for the same claims.
Common entrypoints:
./experiments/run_smoke_test.sh
bash analysis/verify_claims.sh pre-baked
bash analysis/generate_all.sh pre-baked
bash analysis/generate_all.sh fresh
bash analysis/verify_claims.sh freshSee Claim Verification Modes above for the semantics of pre-baked vs fresh.
Per-RQ experiment wrappers:
./experiments/run_rq1.sh --mode approx
./experiments/run_rq1.sh --mode full
./experiments/run_rq2.sh --mode approx
./experiments/run_rq2.sh --mode full
./experiments/run_rq3.sh
./experiments/run_rq3.sh --frames "quad hexa octa octaquad y6 dodeca-hexa tri singlecopter coaxcopter"
./experiments/run_rq3.sh --skip-gazebo
./experiments/run_rq6.sh --mode approxBy default, the fresh experiment wrappers move raw flight logs into results/fresh/flight-logs/. To save disk, add --raw-logs off.
Use bash analysis/generate_all.sh <pre-baked|fresh> to regenerate all shipped tables and figures for one result tree. All analysis scripts aggregate all matching files under results/<source>/. To run one analysis script by hand:
RQ1 / Table 3
python3 -m analysis.generate_rq1_table3 --source pre-bakedReads results/<source>/rq1/ and writes:
RQ1 / Figure 7
python3 -m analysis.generate_rq1_figure7 --source pre-baked
python3 -m analysis.generate_rq1_figure7 --source pre-baked --use-ulogsDefault input is the shared PX4 attack-flight CSV corpus under results/<source>/flight-logs/px4/csv/. Use --use-ulogs to read the raw shared PX4 .ulg files instead if you separately have them locally. The default shipped artifact uses the extracted CSV corpus only. Writes:
RQ2 / Table 4
python3 -m analysis.generate_rq2_table4 --source pre-bakedReads results/<source>/rq2/ and writes:
RQ3 / Table 5
python3 -m analysis.generate_rq3_table5 --source pre-bakedReads results/<source>/rq3/ and writes:
RQ4
python3 -m analysis.generate_rq4_analysis --source pre-baked
python3 -m analysis.generate_rq4_analysis --source pre-baked --trials 1,2,3Default is the shipped trial set 1,2. Use --trials 1,2,3 only if you explicitly want the extra shipped trial. Reads results/<source>/rq4/ and writes rq4_analysis_<source>*.csv/.png under analysis/csv/ and analysis/figures/.
RQ5 (analysis-only; there is no run_rq5.sh)
python3 -m analysis.generate_rq5_analysis --source pre-baked
python3 -m analysis.generate_rq5_analysis --source pre-baked --use-ulogsRQ5 does not have its own experiment runner; it post-processes the same PX4 attack-flight corpus that RQ1 produces. Default input is the shared PX4 attack-flight CSV corpus under results/<source>/flight-logs/px4/csv/. --use-ulogs refreshes that worker CSV corpus from results/<source>/flight-logs/px4/raw/ first, then reruns the analysis. The default shipped artifact provides the extracted CSV corpus, not the full raw PX4 log set. Writes:
RQ6 / Table 6
python3 -m analysis.generate_rq6_table6 --source pre-bakedReads results/<source>/rq6/real_evaluation/ and writes:
RQ6 / Figure 8
python3 -m analysis.generate_rq6_figure8 --source pre-baked
python3 -m analysis.generate_rq6_figure8 --source pre-baked --bias-trial 3Reads results/<source>/rq6/real_evaluation/. The trajectory panel uses all available real-flight trials; --bias-trial N chooses which trial to show in the bias panel. Writes:
Most of these scripts also accept --results-dir to override the default input tree. RQ4 uses --input-dir instead.
Top-level directories reviewers most often touch:
The shipped artifact uses these pre-baked inputs:
The shared PX4 CSV corpus is used by:
Generated summaries and figures are written to:
All generated filenames are source-tagged, for example:
| Back | FazBrowse Home | New Git URL |