Files
PX4-Autopilot/.github/workflows/python_checks.yml
T
Ahmet Burak Tektas 06036f2163 feat(tools): add a script to convert v1.17 parameter files for v1.18 (#29363)
* feat(tools): add a script to convert v1.17 parameter files for v1.18

param_translation.cpp converts renamed parameters only when PX4 upgrades
the parameters stored on the vehicle. QGroundControl loads a .params
file parameter by parameter, so values saved under old names are
ignored, and RC*_REV saved as -1.000000 load as 0 into the now integer
parameters. The script applies the same conversions to the file.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: A.Burak Tektas <15087318+Abtektas@users.noreply.github.com>

* fix(tools): keep the v1.18 heater sensor default in converted files

A v1.17 vehicle does not store SENS_TEMP_ID at its default of 0, so the
upgrade never converts it and HEATER1_SENS_ID keeps its v1.18 default,
the board's sensor or auto-select. The script wrote -1 instead, which
disables the heater on boards that v1.18 heats by default.

Also list EKF2_REQ_PDOP, which v1.18 raises to 4 on fixed-wing, log
integer values without an exponent, end a copied line that has no
newline before the parameters follow it, and say what the translation
test catches.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: A.Burak Tektas <15087318+Abtektas@users.noreply.github.com>

* docs(releases): link the v1.17 parameter file script in 1.18 notes

Item 13 tells users to check a parameter file saved on v1.17 by hand.
Point them to Tools/migrate_param_file.py, which converts such a file.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: A.Burak Tektas <15087318+Abtektas@users.noreply.github.com>

* fix(tools): convert the v1.17 auxiliary global position parameters

param_translation.cpp moves EKF2_AGP_CTRL, _MODE, _DELAY, _NOISE and
_GATE to the first source set, EKF2_AGP0_*, and sets EKF2_AGP0_ID to 1
when EKF2_AGP_CTRL is set. The script listed them as removed, so a
converted file came out with aux global position fusion disabled.

Convert them the same way. QGroundControl lists EKF2_AGP0_* only once
EKF2_AGP0_ID is set and the vehicle reboots, so the script and item 13
of the 1.18 notes say to load the file again after a reboot.
EKF2_AGP_NOISE at 0.9 is listed as a v1.17 default (1.0 in v1.18).

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: A.Burak Tektas <15087318+Abtektas@users.noreply.github.com>

* fix(tools): replace the v1.17 RoboClaw output defaults

The RoboClaw outputs moved from 0 to 256 with stop at 128 to 0 to 254
with stop at 127. A saved file holds the v1.17 defaults, and the script
kept them: RBCLW_DIS 128 drives the motors forward at speed 1 while
disarmed, and RBCLW_MAX 256 is above the v1.18 maximum of 254.

At their v1.17 defaults RBCLW_DIS, _MIN and _MAX now get the v1.18
default, as after an upgrade of the parameters stored on the vehicle,
since the firmware does not store defaults. Other RBCLW_DIS, _MIN, _MAX
and _FAIL values are kept and listed for a check.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: A.Burak Tektas <15087318+Abtektas@users.noreply.github.com>

* fix(tools): drop the reload after a reboot for EKF2_AGP0_*

QGroundControl sends the rows of a .params file that the vehicle does not
list as new parameters, since the file holds their types, and PX4
accepts PARAM_SET for any parameter in its table. So EKF2_AGP0_* are set
on the first load, and the note to load the file again after a reboot
is wrong. Only a Mission Planner file, which has no types, cannot send
them.

Remove the note from the script and from item 13 of the 1.18 notes.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: A.Burak Tektas <15087318+Abtektas@users.noreply.github.com>

* fix(tools): list the X25-EVO core heater and other components

- CORE_IMU_TEMP, _FF, _I, _P and CORE_TEMP_ID of the CUAV X25-EVO core
  heater are gone in v1.18 without a translation, the board now uses
  HEATER2_*. They passed through unlisted; list them as removed with
  the HEATER2_* parameter to set.
- rc.boat_defaults still sets NAV_ACC_RAD 2, so the note that v1.18 uses
  10 applies to multicopters only.
- A vehicle with MAV_COMP_ID other than 1 saves its parameters under
  that component, so the script converted nothing and said nothing.
  Warn when the file has no parameters of component 1.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: A.Burak Tektas <15087318+Abtektas@users.noreply.github.com>

* fix(tools): list board defaults changed on Skynode and i.MX RT

A saved v1.17 file holds the v1.17 board defaults, and v1.18 changed
some of them:
- On Skynode the fmu-v5x defaults set EKF2_MULTI_IMU 0 and
  SENS_IMU_MODE 1, since it is too loaded for the three EKF instances of
  the STM32F7 defaults (3 and 0).
- The i.MX RT defaults match fmu-v6x: EKF2_MULTI_IMU 3, SENS_IMU_MODE 0,
  IMU_GYRO_FFT_EN 1 and UAVCAN_ENABLE 2, where v1.17 used 0, 1, 0 and 0.

List these values as v1.17 defaults with the boards they apply to. One
parameter can change differently on each set of boards.

Airframes 4016, 4020 and 24001 still set NAV_ACC_RAD 2 in v1.18, so name
them in the multicopter note.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: A.Burak Tektas <15087318+Abtektas@users.noreply.github.com>

---------

Signed-off-by: A.Burak Tektas <15087318+Abtektas@users.noreply.github.com>
2026-11-06 10:44:27 -07:00

69 lines
2.0 KiB
YAML

name: Python CI Checks
on:
push:
branches:
- 'main'
paths-ignore:
- 'docs/**'
pull_request:
branches:
- '**'
paths-ignore:
- 'docs/**'
permissions:
contents: read
jobs:
build:
runs-on: [runs-on,runner=1cpu-linux-x64,image=ubuntu24-full-x64,"run-id=${{ github.run_id }}"]
steps:
- uses: runs-on/action@v2
- uses: actions/checkout@v6
with:
fetch-depth: 1
- name: Setup Python
uses: actions/setup-python@v6
with:
python-version: "3.10"
- name: Install tools
run: |
pip install mypy types-requests types-PyYAML flake8 pyyaml
pip install -r Tools/setup/test-requirements.txt
- name: Check MAVSDK test scripts with mypy
run: mypy --strict test/mavsdk_tests/*.py
- name: Check MAVSDK test scripts with flake8
run: flake8 --config test/mavsdk_tests/.flake8 test/mavsdk_tests/*.py
- name: Check USB ID tooling with mypy and flake8
working-directory: Tools/ci
run: |
mypy --strict check_usb_ids.py usb_ids_runner.py test_check_usb_ids.py test_usb_ids_runner.py
flake8 check_usb_ids.py usb_ids_runner.py test_check_usb_ids.py test_usb_ids_runner.py
- name: Check AI review tooling and the PR review poster
working-directory: Tools/ci
run: |
mypy --strict -p ai_review
flake8 ai_review test_pr_review_poster.py
python3 -m unittest discover -s ai_review -t . -v
python3 -m unittest -v test_pr_review_poster
- name: Check ROS workspace tooling
run: |
flake8 Tools/ros2/*.py
python3 -m unittest discover -s Tools/ros2 -p 'test_*.py'
- name: Test submodule check
run: python3 -m unittest discover -s Tools -p 'test_check_submodules.py' -v
- name: Check parameter file migration
run: |
flake8 Tools/migrate_param_file.py Tools/test_migrate_param_file.py
python3 -m unittest discover -s Tools -p 'test_migrate_param_file.py' -v