Skip to content

Commit

Permalink
Tools: Script to fetch online ArduPilot parameter documentation (if n…
Browse files Browse the repository at this point in the history
…ot cached) and

add it to the specified file or to all *.param and *.parm files in the specified directory.

1. Checks if a local cache of the XML file exists in the target directory or on the directory of the target file:
 - If it does, the script loads the file content.
 - If it doesn't, the script sends a GET request to the URL to fetch the XML data for the requested vehicle type.
2. Parses the XML data and creates a dictionary of parameter documentation.
3. DELETES all comments that start at the beginning of a line
4. Adds the parameter documentation to the target file or to all *.param,*.parm files in the target directory.

Supports AP_Periph, AntennaTracker, ArduCopter, ArduPlane, ArduSub, Blimp, Heli, Rover and SITL vehicle types
Supports both Mission Planner and MAVProxy file formats
Supports sorting the parameters
Has unit tests with 88% coverage

AP_FLAKE8_CLEAN

Author: Amilcar do Carmo Lucas, IAV GmbH
  • Loading branch information
amilcarlucas committed Jan 29, 2024
1 parent e772012 commit d096348
Show file tree
Hide file tree
Showing 3 changed files with 975 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/test_annotate_params.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: test annotate_params_unittest.py

on:
push:
paths:
- 'Tools/scripts/annotate_params.py'
- 'Tools/scripts/annotate_params_unittest.py'

jobs:
build:
runs-on: ubuntu-22.04
container:
image: ardupilot/ardupilot-dev-${{ matrix.toolchain }}:v0.1.3
options: --user 1001
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run tests
run: |
Tools/scripts/annotate_params_unittest.py
Loading

0 comments on commit d096348

Please sign in to comment.