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

# Conflicts:
#	.github/workflows/test_unit_tests.yml
  • Loading branch information
amilcarlucas authored and tridge committed Feb 21, 2024
1 parent feff639 commit b6b4c97
Show file tree
Hide file tree
Showing 3 changed files with 961 additions and 6 deletions.
18 changes: 12 additions & 6 deletions .github/workflows/test_unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -147,16 +147,22 @@ jobs:
fi
PATH="/github/home/.local/bin:$PATH"
Tools/scripts/build_ci.sh
- name: Unittest extract_param_defaults
env:
PYTHONPATH: "${{ github.workspace }}/Tools/scripts:${{ github.workspace }}/modules/mavlink/pymavlink"
shell: 'script -q -e -c "bash {0}"'
if: matrix.config == 'unit-tests'
run: |
if [[ ${{ matrix.config }} == "unit-tests" ]]; then
Tools/autotest/unittest/extract_param_defaults_unittest.py
else
echo ${{matrix.config}} does not have pymavlink
fi
Tools/autotest/unittest/extract_param_defaults_unittest.py
- name: Unittest annotate_params
env:
PYTHONPATH: "${{ github.workspace }}/Tools/scripts"
if: matrix.config == 'unit-tests'
run: |
python -m pip install --upgrade pip
pip install requests mock
Tools/autotest/unittest/annotate_params_unittest.py
- name: Archive buildlog artifacts
uses: actions/upload-artifact@v3
Expand Down
Loading

0 comments on commit b6b4c97

Please sign in to comment.