Commit Graph
587 Commits
Author SHA1 Message Date
glaziermag 3c592f59d2 ci(fuzzing): move to px4-dev v1.18.0 and install libclang-rt-18-dev (#29749) 2026-11-24 11:46:15 -08:00
Ramon Roche 467514c7af ci(px4_msgs): drop the release branch dispatch to the interface library
The dispatch to px4-ros2-interface-lib needs an account with write
access to that repository, and the one time it fired, for release/1.18,
it was refused. The library will pick up new PX4 release branches with
a daily check of its own instead, which needs no access from our side.

What is left of the workflow only creates the px4_msgs branch, so rename
it to say that, and describe both paths in the release process.

Assisted-by: Claude:claude-fable-5-2
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-11-23 20:04:26 -08:00
Ramon Roche fb6829085a ci(px4_msgs): create the release branch when PX4 creates one
The px4_msgs sync only runs when msg/ or srv/ change, so a new PX4
release branch gets no px4_msgs branch until the first message change
lands on it. For release/1.18 the branch was pushed by hand.

Let sync_to_px4_msgs.yml be called with a branch name, and call it from
the workflow that already runs when a release branch is created. The
dispatch to px4-ros2-interface-lib now waits for it, so the px4_msgs
branch exists by the time the library creates its own.

The dispatch goes through gh api instead of curl -s -f, which hid the
HTTP status when the request was refused for release/1.18.

Assisted-by: Claude:claude-fable-5-2
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-11-23 20:04:26 -08:00
Ramon Roche fdbc999ed8 ci(px4_msgs): fix the stable tag sync and set the package version
v1.18.0 was the first stable tag this workflow ran on, and it failed with
"PX4 branch release/1.18 not found". The check looked for a local
refs/heads/release/1.18, but actions/checkout only creates remote-tracking
refs for branches it does not check out, so on a tag push that ref never
exists. The push further down would have failed too: it still put the
token in the clone URL, which stopped working for sync_to_px4_msgs.yml in
October.

Move the logic into Tools/ci/px4_msgs_tag.sh so it can be run outside of
Actions. The script fetches the PX4 tag and px4_msgs into a scratch
directory instead of relying on the refs of the checkout, so it no longer
needs the PX4 release branch at all, and it authenticates through gh's
credential helper like the sync workflow does.

Two things behave differently:

- The definitions are compared against the PX4 tag instead of the tip of
  the PX4 release branch, and a file missing from px4_msgs now fails the
  check. git diff did not report those because they were untracked.
- The package.xml version in px4_msgs is set to the release version
  before tagging. release/1.18 still says 1.17.0, and a package built
  from the tag takes its version from that file.

Assisted-by: Claude:claude-fable-5-2
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-11-23 20:04:26 -08:00
Ramon Roche 170dfbbfe8 build(px4io): build IO firmware from source, drop committed binaries
Boards with a px4io took the IO firmware from a binary committed under
boards/<vendor>/io-v2/extras/. It had to be regenerated by hand with
"make px4io_update" whenever px4iofirmware, lib/rc, the IO board or
NuttX changed, and a CI job failed until it was.

Build it from source instead. A target with CONFIG_BOARD_IO set now
builds that IO target as part of its own build and puts the result in
its ROMFS. NuttX builds inside its source tree, so the IO build gets its
own copy of the NuttX sources in build/px4io/<BOARD_IO>/, shared by
every target built in the checkout. The IO build runs on every build of
the embedding target, so an IO source change reaches the ROMFS without
a clean.

PX4_NUTTX_TREE_DIR points a NuttX build at such a copy, and the
hardcoded platforms/nuttx/NuttX/{nuttx,apps} paths now go through
NUTTX_DIR and NUTTX_APPS_DIR.

Remove the two committed binaries, the px4io_update and check_px4io
make targets, and the CI job that compared them.

Assisted-by: Claude:claude-fable-5-2
2026-11-23 14:49:27 -08:00
Ramon Roche 53baa28a50 ci(build_all): stop publishing CI-only builds
build_all published every target it built, including variants that
exist for compile coverage, analysis or testing and that nobody should
flash: flash-analysis, allyes, performance-test, bench, lto, the
secureboot and cryptotest builds signed with the test keys kept in the
tree, a unit test configuration and the NuttX debug build of fmu-v5.

List them in build_all_config.yml with the reason for each, and publish
nothing from them. They are still built. A test fails when an entry no
longer matches a target in the tree.

Also stop publishing files nothing consumes:
- the .px4 of the px4io firmware, where the raw .bin is published
- component metadata of targets without MAVLink, which is the only way
  a ground station learns where to fetch it
- the second copy of all_events.json.xz under <target>/events/, a path
  the firmware does not advertise
- toc.elf, an intermediate link product

Assisted-by: Claude:claude-fable-5-2
2026-11-23 14:17:49 -08:00
Ramon Roche 1b51227375 ci(build_all): port artifact packaging to Python
package_build_artifacts.sh decides what build_all publishes to S3,
GitHub Releases and pull request artifacts. It has grown a special case
per kind of target, and it is the only build_all tool without a test.

Port it to Python as is. The published files do not change: both
versions produce identical paths and contents from the same build
trees.

Assisted-by: Claude:claude-fable-5-2
2026-11-23 14:17:49 -08:00
Ramon Roche 0fa84e1891 ci(flash_analysis): analyse only px4_io-v2
cubepilot_io-v2 is carried by the three Cube boards only, and is built
from the same px4iofirmware, lib/rc and NuttX sources as px4_io-v2, so
a change to any of those already shows on the px4_io-v2 row. A change
to the cubepilot IO board configuration alone is not reported.

Assisted-by: Claude:claude-fable-5-2
2026-11-23 14:16:20 -08:00
Ramon Roche e915bdfcac ci(flash_analysis): track the px4io firmware
The px4io firmware is flashed to the IO coprocessor by every FMU that
carries one, and the IO has 8 KB of RAM, yet a pull request shows
nothing about what it does to that image.

Analyse px4_io-v2 and cubepilot_io-v2 next to the FMU targets, so the
comment reports their flash and static RAM. Both are analysed as they
ship, not as a flash-analysis variant.

The IO image holds no commit hash, so the same sources always build the
same bytes. firmware_size.py can now compare the image itself
(--reproducible-image), and the comment says whether a pull request
changes what gets flashed to the IO, also when no size moves.

Assisted-by: Claude:claude-fable-5-2
2026-11-23 14:16:20 -08:00
Ramon Roche a155fb32ea ci(build_all): publish raw px4io firmware
build_all already builds the px4io targets and publishes their .px4,
.elf and SBOM, but not the raw .bin. The .bin is the image the FMU
carries in its ROMFS and flashes to the IO coprocessor with
"px4io update", so it is the one worth having next to the other
firmware.

Copy it into the build artifacts so it is synced to S3 with everything
else, and attach it to the GitHub Release on tags.

Assisted-by: Claude:claude-fable-5-2
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-11-23 12:00:37 -08:00
YoungjuKim ae449ad8aa fix(ci): upload main firmware to S3 again when no seeder runs
Since the seed stage became conditional (#28278), it is skipped on every
push where all chip family caches are already warm, which is almost
every push to main. The artifacts job had no status function in its
condition, so GitHub applied an implicit success(), which is false when
any upstream job was skipped. Since then Upload Artifacts has only run
on main when a seeder happened to run (once, on 2026-11-06, when the
imx9 cache was cold).

Version tags cut from main are affected the same way.
filter_cold_seeders.py probes the main cache scope for every ref, so
such a tag skips the seeders and loses both the S3 upload and the draft
GitHub Release, which is a step of the same job.

Check the build result explicitly, as the deploy job in
dev_container.yml already does.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: YoungjuKim <fjvbn2003@gmail.com>
2026-11-23 09:58:40 -08:00
Nuno Marques 288b114841 feat(uxrce_dds_client): bridge out-of-tree uORB messages over uXRCE-DDS (#29782)
* feat(uxrce_dds_client): bridge the topics of out-of-tree messages

Out-of-tree uORB messages build into PX4 like any other, but the
bridge reads only dds_topics.yaml, so bridging one means editing that
file and carrying the change through every PX4 update.

When $EXTERNAL_MODULES_LOCATION/msg/dds_topics.yaml exists, the build
passes it to the generator after dds_topics.yaml, and the generator
appends each file's lists to those before it. A topic declared twice
in the same list stops the build, since it would be bridged twice.
A single file, as Zenoh's build passes, yields its lists unchanged.

Assisted-by: Claude-Code:claude-opus-5-5

* test(uxrce_dds_client): test the topic generator in the Python checks

The generator runs only inside a firmware build, so a change that
breaks joining topic files, or the check for repeated topics, would
first show up as a broken build. The tests run it on its own: a second
file appends its topics to each list, lists split across files give
the same header as one file, files without topics add nothing, and a
repeated topic stops it. The Python checks job installs empy for the
generator, in the range PX4's requirements.txt gives.

Assisted-by: Claude-Code:claude-opus-5-5

* feat(scripts): copy out-of-tree messages into px4_msgs

ROS 2 needs every bridged message in px4_msgs, and copy_to_ros_ws.sh
copies only PX4's own. An optional second argument, the external
modules location, adds the messages of its msg directory, if it has
any. A message with the name of a PX4 message would replace PX4's
definition in px4_msgs, so the script refuses it before copying
anything.

A test in the Python checks runs the script on throwaway workspaces:
PX4's messages alone, a location's messages added, a location without
messages, and the refusals of a PX4 message name and of a location
without a msg directory.

Assisted-by: Claude-Code:claude-opus-5-5

* docs(uxrce_dds): document bridging out-of-tree messages

The uXRCE-DDS page covers dds_topics.yaml but not the topics of
out-of-tree messages. Describe their topics file and the copy into
px4_msgs there, and point to it from the External Modules page.

Assisted-by: Claude-Code:claude-opus-5-5
2026-11-22 09:04:15 +00:00
Julian Oes 1239c24f99 ci(px4io): reject per-board IO binaries and keep check_px4io read-only
A board that still carries its own px4io binary in extras/ collided with
the one added via CONFIG_BOARD_IO and failed CMake generate with a
duplicate custom rule error. Several open board PRs add one, so fail
configure with a message naming the file to delete instead.

check_px4io copied the build output over the committed binaries, which
leaves changed binaries behind when run with a different toolchain. Compare
with cmp instead. The CI job now only runs check_px4io, which already
builds both IO boards, instead of building them twice.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Julian Oes <julian@oes.ch>
2026-11-20 12:08:09 +13:00
Julian Oes aa34d65fcb ci(px4io): fail the IO firmware check instead of only warning
A passing job with a warning annotation is easy to miss, which defeats the
purpose of the check. Fail the job so stale IO firmware gets regenerated in
the PR that changes its dependencies.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Julian Oes <julian@oes.ch>
2026-11-20 12:08:09 +13:00
Julian Oes a88edf1abe ci(px4io): keep one IO firmware binary per IO board and check it in CI
The px4io firmware was committed as a copy in the extras of each of the 30
boards using it. "make px4io_update" only knew about 15 of them, so the
copies drifted into 5 different versions, and none had been regenerated
since 2024-03 despite changes to px4iofirmware, lib/rc and NuttX.

Keep a single binary per IO board in boards/<vendor>/<io board>/extras and
let the ROMFS pick it via the existing CONFIG_BOARD_IO option, which every
board with the px4io driver already sets (cubepilot boards override it).
This also replaces the outdated per-board copies on boards that were
missed by "make px4io_update".

The IO build is reproducible with a fixed toolchain (verified across
checkout paths and container vs host with the same GCC), so CI can rebuild
it and compare. "make check_px4io" does that, and a new CI job turns a
mismatch into a warning.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Julian Oes <julian@oes.ch>
2026-11-20 12:08:09 +13:00
Ramon Roche f1b15087f0 ci(commit_checks): post title and description comments on fork PRs
A fork PR gets a read-only token under pull_request, so the PR title and
PR description comments were skipped for forks. A fork contributor with
a bad title got a red check and the reason only in the job summary that
#29816 added as a workaround.

Run the workflow on pull_request_target, like the labeler, so the token
can post the comments on fork PRs too. The jobs only read the title, the
body and the base branch from the event and run Tools/ci from the base
branch, never code from the PR. Group the concurrency by PR number,
because github.ref is the base branch under this trigger and PRs against
the same branch would cancel each other. Drop the fork-only job summary,
which the comment replaces.

Assisted-by: Claude:claude-fable-5-2
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-11-16 10:39:20 -08:00
Ramon Roche 40fee1673f ci(commit_checks): accept a backport tag in release branch PR titles
Backport PRs are titled "[BACKPORT 1.18] fix(mavlink): ...". The PR title
check anchors on the conventional commit type, so it fails all of them
even though the header after the tag is valid. Replaying the check over
the 210 PRs opened against release/1.16, release/1.17 and release/1.18,
62 fail only because of the tag.

Skip a leading backport tag before validating the header. The header
after the tag still has to be a conventional commit. The tag is accepted
only on PRs that target a release/* branch, so a backport opened against
main by mistake fails with a comment that says so. The title suggested
in the failure comment keeps the tag.

Assisted-by: Claude:claude-fable-5-2
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-11-16 10:33:46 -08:00
Ramon Roche a85c5014fc ci(checks): delete each unit test build tree after its run
The Unit Tests job builds five SITL test trees in sequence and keeps all
of them on disk until the job ends, which filled the default RunsOn volume
and was papered over with volume=60gb in #29374. Nothing reads a tree after
its own make target returns, so remove each one as soon as its tests pass
and drop the volume override.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-11-16 05:47:41 -08:00
Balduin 4742fdbb2e ci(commit_checks): explain PR title failure when no comment is posted (#29816)
* ci(commit_checks): render the PR title report in the job summary for forks

On PRs from forks, CI cannot post comments directly. When the PR title 
does not satisfy conventional commits, a CI error refers to a PR comment 
that did not exist. 

Fix: Output the content of the comment in case of fork PRs
 - In the action summary, properly rendered like the real comment
 - In the job log, as plain text

---------

Signed-off-by: Balduin <balduin@auterion.com>
2026-11-16 14:45:17 +01:00
440179383a feat(SIH): Added optical flow sensor continues on #28270 (#29676)
* feat(sih): model the distance sensor range limits, quality and noise

The simulated distance sensor reported a noise free reading with no signal
quality, and saturated only against the upper range limit. Readings below the
minimum range were passed through unchanged, which is not what a range finder
does.

Report the raw saturated value with a zero quality outside of the measurement
range, derate the quality over the last 20% of the range, and add configurable
Gaussian noise (SIH_DISTSNSR_NOI). The quality is decided on the true distance
so that a measurement sitting at a range limit does not flicker in and out of
validity.

The sensor is now enabled with SIH_DISTSNSR_EN instead of by an out of band
value of the override parameter, and the ground distance computation moves into
a helper.

* feat(sih): add optical flow simulation

Simulate a downward facing optical flow sensor in SIH so that flow aided
navigation can be exercised without a rendered camera image. The flow rate is
the sum of the body rates and of the ground relative velocity scaled by the
distance to the ground, integrated over one publication interval and published
on sensor_optical_flow with configurable rate (SIH_OF_RATE) and noise
(SIH_OF_NOISE).

The sensor reports the integrated flow only: the flow module completes the
sample with the vehicle gyro and the downward facing distance sensor, which
therefore has to be enabled as well. Quality drops to zero above
SIH_OF_H_MAX or when the flow rate exceeds what the sensor can correlate.

The topic is advertised before the simulated clock starts, because the sensors
module brings up its flow pipeline on the first appearance of the topic, and
publishing during startup deadlocks the lockstep clock this thread advances.

Add the quadx_flow and standard_vtol_flow models with matching airframes:
SYS_AUTOSTART 10046 flies the multicopter on flow only with no GNSS, 10047
fuses the flow next to GNSS on a VTOL.

* prune configs

Signed-off-by: RomanBapst <bapstroman@gmail.com>

* more config cleanup

Signed-off-by: RomanBapst <bapstroman@gmail.com>

* added EKF2_HGT_REF to vtol flow config

Signed-off-by: RomanBapst <bapstroman@gmail.com>

* feat(simulation): added tests for optical flow for both quadx and stanard vtol
modes and enable them in CI

- for the test we monitor error on ground truth position and velocity

Signed-off-by: RomanBapst <bapstroman@gmail.com>

* feat(docs): document addition of optical flow in SIH

Signed-off-by: RomanBapst <bapstroman@gmail.com>

* fix(mavsdk_tests): unsubscribe flow ground truth comparison on destruction

The ground truth comparison callbacks capture `this` and touch members of
AutopilotTesterFlow. If a REQUIRE fails between start and stop, the tester
is destroyed during unwinding while the subscriptions are still active,
so a callback could run on the destroyed mutex and sample buffers.

Make stop idempotent and call it from the destructor, and stop any running
comparison before starting a new one.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: RomanBapst <bapstroman@gmail.com>

* tests for python

* fix(mavsdk_tests): start the VTOL flow loiter already on its radius

The loiter was centered on the vehicle's position right after the
transition, so it started at the center and had to fly straight out to the commanded
radius before the lateral guidance curved onto the track.

Assisted-by: Claude:claude-sonnet-5

* fix(mavsdk_tests): resend the flow test EKF origin until it is taken

The SITL startup script starts ekf2 after MAVLink. When MAVSDK connected
first, the single SET_GPS_GLOBAL_ORIGIN was published before ekf2 existed
and MAVSDK's RUN_PREARM_CHECKS followed it. Ekf2 then subscribed, saw
only the newest vehicle command and never got an origin. The Coverage
build starts slowly enough to hit this every time.

Assisted-by: Claude:claude-opus-5-5

* ci(sitl_tests): run the VTOL flow test without coverage

As a Coverage job it built with coverage on every PR and uploaded the
sitl-vtol flag from PRs, which replaced main's carried-forward VTOL
coverage with the flow-only flight. The quadx_flow entry also sat
between the Coverage comment and the standard_vtol entry it describes.

Assisted-by: Claude:claude-opus-5-5

* fix(mavsdk_tests): sum the flow test heading sweep with its sign

Adding up the absolute heading changes counted yaw oscillation toward the
360 degrees, so the wait could end before a full orbit was flown.

Assisted-by: Claude:claude-opus-5-5

* refactor(airframes): keep only the non-default params in the SIH flow airframes

SIH_OF_H_MAX, SIH_DISTSNSR_EN and EKF2_OF_CTRL were set to their defaults
and SENS_EN_GPSSIM is already set by the quadx base airframe. The quadx
forced EKF2_RNG_CTRL to 2 while the VTOL used the conditional default for
no stated reason, so both now use the default.

Assisted-by: Claude:claude-opus-5-5

* docs(sim_sih): mark the SIH flow airframes as new in PX4 v2.0

release/1.18 has branched, so these airframes first ship in v2.0, not
v1.17.

Assisted-by: Claude:claude-opus-5-5

---------

Signed-off-by: RomanBapst <bapstroman@gmail.com>
Co-authored-by: RomanBapst <bapstroman@gmail.com>
Co-authored-by: Jacob Dahl <dahl.jakejacob@gmail.com>
2026-11-09 11:13:16 -07:00
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
Beniamino Pozzan bf59c29e8b ci(ros2): bump px4-dev-ros2 image tags to latest main
Bump tags to the ones built from
9941e2f769
so that rmw-zenoh-cpp is available

Signed-off-by: Beniamino Pozzan <beniamino.pozzan@gmail.com>
2026-11-05 12:39:06 -08:00
Ahmet Burak Tektas 860481d8a1 docs(instructions): require an upgrade path for removed parameters (#29637)
A released parameter removed without a translation loses its stored value
on upgrade, and nothing in review flags it. EKF2_AGP_*, SENS_IMU_TEMP* and
FD_ACT_* went this way, and their translations and upgrade notes came in
later PRs. Add the rule to the parameter guidelines, which the AI review
loads for src/**.

Assisted-by: Claude:claude-opus-5-5

Signed-off-by: A.Burak Tektas <15087318+Abtektas@users.noreply.github.com>
2026-11-05 10:00:30 -07:00
Beniamino Pozzan f6851870b9 ci(ros): run the ROS integration tests over Zenoh too
Split the job into a uXRCE-DDS and a Zenoh leg so a change that breaks
either middleware fails CI. The Zenoh leg runs the mode tests from
config-sih-zenoh.json. The pinned px4-dev-ros2 image predates
rmw_zenoh_cpp, so that leg installs it until the image is refreshed.

The matrix renames the job's checks to build (uxrce_dds) and
build (zenoh).

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Beniamino Pozzan <beniamino.pozzan@gmail.com>
2026-11-04 15:51:34 +00:00
Ramon Roche d02e110e97 ci(px4_msgs): pass the push token through gh's credential helper
Since the runner image rotation on 2026-10-20 every sync has failed to
push to PX4/px4_msgs with "could not read Username for
'https://github.com'". The token was never rejected: the image carries
libcurl 7.81.0-1ubuntu1.30, whose CVE-2026-94266 fix strips credentials
from CURLINFO_EFFECTIVE_URL, and git 2.55 compares that against the URL
it requested, reports a redirect that never happened and re-derives its
credentials from the stripped URL. A token embedded as the URL username
is therefore dropped before the push.

Clone px4_msgs without credentials and let gh's credential helper supply
the token from GH_TOKEN. This is the interface git and GitHub provide for
this, it survives the libcurl change on both the current and the previous
image, and it keeps the token out of argv and .git/config on the runner.

Reproduced with the runner's exact git 2.55.0 PPA build against the
patched jammy libcurl: the URL form fails identically, the credential
helper path sends the credentials.

Assisted-by: Claude:claude-mythos-5-1
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-10-30 10:11:27 -07:00
Ramon Roche d6cd502f2d ci(macos): stop pinning Homebrew to older commits
The macOS job checked out Homebrew 7.0.6 and a 2026-09-18 package index
on a runner image whose packages a newer Homebrew had installed. The
image refreshed on 2026-10-29 with openssl@4 as the linked default, and
the pinned Homebrew deadlocked on its own openssl@4 lock while linking
the pinned openssl@3 for ccache, so ccache never installed and every
run since failed. Homebrew fixed the nested lock in 7.0.10, but any pin
older than the image repeats the problem at the next refresh.

The pins were added to keep Gazebo on bottles built against one
protobuf. Gazebo now comes from the conda-forge lock in macos/pixi.toml,
so install from the Homebrew and index the image ships, with auto-update
off so the index stays the one its packages came from. macos.sh goes
back to plain brew tap and cask installs, which is what it already does
on developer machines.

Assisted-by: Claude:claude-mythos-5-1
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-10-30 09:13:13 -07:00
Michael Fritsche f94f879184 ci(px4_msgs): fail the sync when the push to px4_msgs fails (#29520)
Signed-off-by: Michael Fritsche <frimi999@gmail.com>
2026-10-30 11:39:07 +01:00
Jonas Peroliniandjonas d4d6430319 ci(checks): run the navigator tests without the mission cache (#29501)
Assisted-by: Claude:claude-opus-5-5

Co-authored-by: jonas <jonas.perolini@rigi.tech>
2026-10-30 09:50:26 +01:00
Jacob Dahl 8c79159516 docs(instructions): add parameter description guidelines (#29502)
Descriptions compile into the xz-compressed parameter metadata in ROMFS, so verbose or inconsistently worded descriptions cost flash. Agents writing or reviewing parameters, including the CI AI review, load this file for src/**, so new parameters get written and reviewed to the same rules.

Assisted-by: Claude:claude-opus-5-5
2026-10-29 11:07:43 -06:00
Julian Oes ddc63c57e8 ci(workflows): set token permissions on every workflow (#29489)
Eleven workflows had no top-level permissions block, so any job without
its own ran with the repository's default token permissions. Set the
least each one needs: read-only contents for the build, test and
Crowdin upload workflows, which only check out code and use their own
tokens for anything else; issues, pull requests and the Actions cache
for the stale bot. Workflows whose jobs already set permissions get a
read-only default for any job added later.

This clears the actions/missing-workflow-permissions code scanning
alerts.

Assisted-by: Claude:claude-opus-5-5

Signed-off-by: Julian Oes <julian@oes.ch>
2026-10-30 04:47:05 +13:00
Julian Oes 1c7a07a411 test(mavsdk_tests): rewrite the integration tests in Python (#29332)
* build(mavsdk_tests): stop building the C++ integration tests

The integration tests are moving to the native MAVSDK Python package, so
the C++ test binary and its pinned libmavsdk-dev package are no longer
needed. The C++ sources stay in the tree as a reference until all tests
are ported.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Julian Oes <julian@oes.ch>

* test(mavsdk_tests): run the integration tests with MAVSDK Python

The MAVSDK pip package is now a native binding of the C++ library, so
the tests can be written in Python without a C++ build or a matching
libmavsdk-dev package, and the version is pinned in requirements.txt.

The existing runner keeps starting PX4 for each case; only the test
executable changes to pytest. Cases are pytest node IDs and the Catch2
tags become pytest markers.

The tester is a port of the C++ AutopilotTester core. Checks done in
telemetry callbacks are collected and fail the test at teardown, since
MAVSDK Python swallows exceptions raised in callbacks.

The first ported test is takeoff and hold position.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Julian Oes <julian@oes.ch>

* test(mavsdk_tests): port the multicopter tests to Python

Ports missions, offboard, manual flight, failsafes, failure injection,
RTL with rally points and geofence avoidance, home yaw and parameter FTP.
The tester gains the raw mission, manual control, failure, FTP and
MavlinkDirect helpers these need, plus an RTL subclass for rally points
and the geofence breach monitor.

The failsafe tests are parametrized over the height source instead of
being duplicated.

The parameter FTP download test now waits for the baro GNSS calibration
before comparing, since the offset it writes could otherwise change
between the PARAM_VALUE and the FTP download.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Julian Oes <julian@oes.ch>

* test(mavsdk_tests): port the VTOL and control allocation tests to Python

Ports the VTOL missions, the VTOL return tests, figure eight, loiter
reposition, airspeed failure, the SIH XVert transition and the
gazebo-classic control allocation tests.

The loiter and figure-eight testers are merged into one loiter tester
that sends its commands as COMMAND_INT through MavlinkDirect. NaN fields
are sent as JSON null, since NaN is not valid JSON and MAVSDK reads null
as NaN.

Timeouts that were host time in C++ (approaches, figure eight) are now
sim time with values that fit the speed factors used in CI.

The gazebo runner can now take the world from the config, since pytest
node IDs no longer carry "(name.world)".

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Julian Oes <julian@oes.ch>

* test(mavsdk_tests): settle the hover before injecting motor failures

The altitude and speed waits both pass while the vehicle is still
slowing down at the top of the climb, so the altitude reference for the
failure was taken mid-climb. At 30x speed the following overshoot was
just over the 1 m tolerance.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Julian Oes <julian@oes.ch>

* test(mavsdk_tests): port the follow-me tests to Python

The C++ follow-me tests were never built: they were disabled pending a
MAVSDK change that has long since been merged, and the RC adjustment
test did not even compile. They now run with the other multicopter
tests.

Running them for the first time showed a few test bugs: target
locations were sent before follow-me was active, manual control was
dropped after 20 s, and the angle check ignored the rate limit from
FLW_TGT_MAX_VEL. The RC checks now measure the change from right before
each stick input.

The follow distance adjusts at about 40% of the nominal speed, since
PX4 only grows the setpoint while the drone is within 1 m of it. The
test accepts that for now.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Julian Oes <julian@oes.ch>

* test(mavsdk_tests): remove the C++ integration tests

All tests now run with MAVSDK Python, so the C++ tests, the tester
classes and the bundled Catch2 are no longer needed.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Julian Oes <julian@oes.ch>

* build(setup): install the integration test requirements

The MAVSDK and pytest pins move to Tools/setup/test-requirements.txt,
which the setup scripts and the dev container now install, so the
integration tests work after the normal environment setup. The mavsdk
pin allows 4.0.x patch releases only.

The file lives in Tools/setup because that is the dev container's build
context. Container builds that stage only requirements.txt skip it.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Julian Oes <julian@oes.ch>

* docs(test_and_ci): describe the Python MAVSDK integration tests

Covers the setup, running test cases by pytest ID, running a test
against a PX4 instance started by hand, and writing tests with the
testers and fixtures. Drops the Catch2 notes and the outdated list of
test cases.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Julian Oes <julian@oes.ch>

* refactor(packaging): port the SIH container mission test to MAVSDK v4

Since v4, the mavsdk package is the native binding with a different API,
so the script failed to import with the version the setup scripts now
install. It now uses the synchronous API.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Julian Oes <julian@oes.ch>

* test(mavsdk_tests): work around MAVSDK-Python unsubscribe crash

Up to MAVSDK-Python 4.0.6, unsubscribe_*() releases the callback
trampoline before the C unsubscribe returns, so a callback that is
running or waiting for the GIL can jump into freed memory. This crashed
the hex test in CI. Keep the subscription entries until the tester is
closed, until the pin includes the fix.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Julian Oes <julian@oes.ch>

* test(mavsdk_tests): retry the param FTP comparison until values settle

Waiting for CAL_BARO0_OFF to change does not work everywhere: at the
CI home location the baro already matches GNSS and the calibration
writes an offset of 0. Instead, compare the PARAM_VALUE and FTP
downloads and retry a few times while parameters still settle.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Julian Oes <julian@oes.ch>

* test(mavsdk_tests): port the vision target tests to Python

Port the precision landing tests from #29265: the pad is simulated with
TARGET_RELATIVE and TARGET_ABSOLUTE sent through MavlinkDirect, and the
estimate is checked from LANDING_TARGET.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Julian Oes <julian@oes.ch>

* test(mavsdk_tests): fail when a filter or case selects nothing

A config filter that matched no test, for example because of a typo,
ran zero cases and passed. Also, --case used fnmatch, which reads the
brackets of parametrized test IDs as a character class, so such a test
could not be selected by its ID. Treat brackets literally and fail when
nothing is selected.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Julian Oes <julian@oes.ch>

* test(mavsdk_tests): check the COMMAND_ACK of sent commands

Commands sent through MavlinkDirect were sent once and the ACK was
ignored, so a dropped or denied command only showed up later as an
unrelated timeout. Retry until acked like MAVSDK does, and check the
result.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Julian Oes <julian@oes.ch>

* test(mavsdk_tests): check the condition once more on poll timeout

Also make the comment of check_rtl_approaches say that it can't fail.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Julian Oes <julian@oes.ch>

* test(mavsdk_tests): disable baro auto-calibration in the param FTP test

Port #29359 to the Python test: the baro GNSS calibration can save a
new CAL_BARO0_OFF between the PARAM_VALUE and FTP downloads. Disable it
instead of retrying the comparison.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Julian Oes <julian@oes.ch>

---------

Signed-off-by: Julian Oes <julian@oes.ch>
2026-10-26 08:50:51 -06:00
jonas 8bf63ef1c1 ci(checks): give the unit tests job a 60 GB disk
The Unit Tests job builds four SITL test trees on the default 40 GB
RunsOn disk, and the runner image already uses 18 GiB of it. Since
the RunsOn image update on 2026-10-19, main ends the job with about
40 MB free, and any PR that adds a test runs out of space in the
last build (tests_neural).

Assisted-by: Claude:claude-opus-5-5
2026-10-21 11:50:36 -07:00
Julian Oes 85679e231d ci(sitl): run MAVSDK tests with ASan, TSan and UBSan (#29329)
The test runner now fails a test case on any sanitizer report, so run
three of the four SITL test jobs with a sanitizer build to catch memory
errors, data races and undefined behaviour in CI. They replace the plain
RelWithDebInfo builds to avoid adding more CI jobs. standard_vtol stays
unchanged as it provides the coverage build on main.

Assisted-by: Claude:claude-opus-5-5

Signed-off-by: Julian Oes <julian@oes.ch>
2026-10-20 10:21:00 +13:00
Jacob Dahl a4697ed08e ci(clang-tidy): stop false positives in the inline review comments (#29013)
* ci(clang-tidy): stop false positives in the inline review comments

Of the 828 inline comments the clang-tidy job posted on 98 PRs since May, only 328 were unique: COMMENT reviews can't be dismissed, so every push posted every finding again. Most of the rest were artifacts of how the diff step runs:

- It parses against the test build dir, which is only configured, so the uORB, events and parameter headers don't exist and every TU stops at a missing include. clang-tidy then reports on the half-parsed AST: events::send<T>(...) as a chained comparison, sizeof on uORB arrays as sizeof of a pointer.
- It parses every changed .h on its own as C++, including board configs, NuttX headers and headers shared with C. The gating run never lints .h.
- .clang-tidy disabled macro-parentheses, incorrect-roundings and misplaced-widening-cast under their old misc- names, which clang-tidy 18 no longer knows, so all three were on.

Generate the test dir's headers, skip .h and board/NuttX files, drop clang-diagnostic-error (the build jobs report real compile errors), skip findings already posted on the PR, and disable four checks that only produced noise: googletest underscore names, virtual-class-destructor on gtest fixtures and singletons, suspicious-call-argument, and not-null-terminated-result on binary packet buffers.

Assisted-by: Claude:claude-opus-5-5

* ci(clang-tidy): keep the gating checks and skip the fuzztest header

.clang-tidy also configures the gating run, which enabled incorrect-roundings, macro-parentheses and virtual-class-destructor on purpose, with code fixes. Drop the stale misc- names instead of renaming them, and turn virtual-class-destructor, suspicious-call-argument and not-null-terminated-result off for the inline comments only.

Header generation also built fuzztest's json_grammar.h, which pulls in abseil and the antlr4 runtime: 336 ninja edges and 39 s in CI instead of 22 edges and 4 s.

Match already-posted comments on the line too, so a second finding with the same message elsewhere in a file is still posted. Drop only headers under boards/ and platforms/nuttx/, so SITL's own board sources are still linted.

Assisted-by: Claude:claude-opus-5-5
2026-10-06 19:52:54 -06:00
Ramon Roche a9a86dad76 feat(ci): show the AI review among the PR's checks
Comment-triggered runs belong to main, so GitHub never lists them in the
PR's checks and the only sign of a running review is a reaction on the
comment. Set an informational "AI PR Review" commit status on the PR
head, linking to the run: pending when the gate accepts, then success or
error. A run cancelled by a newer review of the same commit leaves the
newer run's status alone.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-10-02 19:38:09 -07:00
Ramon Roche 87f6f9e9d8 fix(ci): let the AI review react to the triggering comment
The gate and finish jobs had issues: write, but a comment on a pull
request is a pull request comment for permissions, so adding the 👀, 🚀
and 😕 reactions failed with HTTP 403 (seen on the first run, PR #28982).
Grant pull-requests: write instead. The review itself was unaffected:
reactions are best effort.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-10-02 16:33:32 -07:00
Ramon Roche f92f17dbc8 feat(ci): add the AI PR review workflow
pr-ai-review.yml runs the review when someone with write access comments
`!ai-review` on a PR (optionally with model= and effort=), or on manual
dispatch. A gate job checks the commenter's repository permission through
the API. The review job assumes an OIDC role that only this workflow on
main can use, and pr-review-poster.yml posts the result as a COMMENT
review, accepting this workflow's issue_comment and workflow_dispatch
runs; its pull_request path is unchanged. python_checks.yml runs the new
tests, mypy and flake8.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-10-02 15:50:14 -07:00
Jacob Dahl 42ce28a986 ci(labeler): apply at most one scope label per PR (#28965)
actions/labeler adds every scope whose globs match any changed file, so a PR touching a test, a param file and a board config collects a pile of scope labels (2.6 per PR on average over the last 300, up to 20) and nobody reads them. A scope label is only useful when it names the core of the PR.

The title's conventional-commit scope already states that core, so the scope label now comes from it, resolved to an area of the tree; the diff decides only when the title names nothing. Each file belongs to one scope, and labels this workflow added earlier are removed when they stop matching. scope:testing, scope:uorb, scope:middleware and scope:logging are no longer applied.

Assisted-by: Claude:claude-opus-5-5
2026-10-01 20:42:03 -06:00
Ramon Roche b287561f8c ci(build_all): run on pull requests only when build inputs change
Build all targets ran on every pull request except docs-only ones, so a
PR touching only MAINTAINERS.md, another workflow, test/ or the macOS
setup still built every board. Pull requests now skip it unless a
changed file can affect a firmware build. Build inputs that live under
otherwise ignored directories (this workflow, its ccache actions and
runner config, the Tools/ci scripts it runs and the SBOM generator
inputs) are re-included. Pushes to main, stable, beta, release branches
and tags are unchanged.

Replayed against the 435 PRs of the last 30 days, this skips the 39
that could not affect any target (79 runs, ~24.6k job-minutes) and no
others.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-10-01 15:10:32 -07:00
Saibernard b492664e41 fix(mc_nn_control): correct errors and add the first unit tests (#28433)
* fix(mc_nn_control): use single precision sqrt and correct two parameter/comment errors

Three small corrections in the neural network controller, none of which
change the commanded thrust for a valid configuration:

- RescaleActions() called sqrt() rather than sqrtf(), promoting to double
  in a loop that runs once per angular velocity sample. On an FPU without
  double precision that is a software routine, four times per cycle, in
  the path whose execution time the module exists to measure.

- MC_NN_THRST_COEF declared a minimum of 0.0, but the value is used as a
  divisor in RescaleActions(). Zero is therefore an in-range setting that
  makes the motor scaling non-finite. Raise the minimum off zero.

- The comment above PopulateInputTensor() gives the observation order as
  [pos_err(3), lin_vel(3), att(6), ang_vel(3)], but the code below it,
  NeuralControl.msg and the module usage text all use
  [pos_err(3), att(6), lin_vel(3), ang_vel(3)]. Attitude and linear
  velocity are transposed in the comment only.

Assisted-by: Claude:claude-fable-5
Signed-off-by: Saibernard Yogendran <bernie97@seas.upenn.edu>

* refactor(mc_nn_control): extract the action rescaling into a testable header

The mapping from network action to motor command lived inside a private
member operating on the TFLM output tensor, so it could not be unit
tested. Move the per element math into a dependency free header
function. Behaviour is unchanged.

Assisted-by: Claude:claude-fable-5
Signed-off-by: Saibernard Yogendran <bernie97@seas.upenn.edu>

* fix(mc_nn_control): keep motor commands between idle and full scale

The action to motor command mapping ran past both ends of the motor. On
the shipped defaults action -1 mapped to -0.0077, which the motor output
treats as a stopped motor while the other three keep thrusting, and every
action above 0.61 mapped past full scale. With a minimum rpm above a ninth
of the maximum the last stage also ran backwards for the first few
thousandths of the range. All three come from normalizing the rpm against
limits the thrust coefficient does not reach. Reported in #28417.

Bound the normalized rpm between the limits, so a thrust below what the
minimum rpm gives idles the motor and one above the maximum runs it at
full scale, and write the thrust curve compensation as a x^2 + (1 - a) x
so idle is exactly 0 and full scale exactly 1. The curve inside the
limits is unchanged.

Validate the three parameters at start and on every parameter update:
finite, the coefficient above zero, the minimum at least zero and below
the maximum, and a part of the action range wider than float resolution
reaching the motor, so rounding cannot pass a window with no action
inside it. Raw parameter writes are not bounded by the metadata, so this
is checked in code. The mapping only ever uses a set that passed. An invalid set is
reported as an error event, repeated while it stands, and the arming
check for the mode is refused until it is corrected, so the commander
neither arms into the mode nor keeps flying it. The mapping keeps the
last valid set meanwhile, so the write itself never steps the motors. A
valid set that covers less than the whole action range is reported as a
warning naming what it does cover, when it changes and again when the
mode is entered.

The arming check reply was not zero initialized, which left two mode
requirement fields to whatever was on the stack. Also from #28417: the
loop performance counter was left open on the two early returns after
inference, and actuator_motors.timestamp_sample was never set.

Assisted-by: Claude:claude-fable-5
Signed-off-by: Saibernard Yogendran <bernie97@seas.upenn.edu>

* test(mc_nn_control): add the module's first unit tests

The action to motor command mapping had no tests. These assert the
properties it has to keep rather than any particular output value:
actions beyond the boundary clamp, every command stays between 0 and 1,
the lowest action idles the motor and the highest runs it at full scale,
the mapping never decreases and rises inside the achievable range,
actions outside that range sit on the bounds, the output stays finite
for every normal action and across the documented parameter ranges, a
non finite action gives no command, and invalid limits are rejected.

Every threshold comes from the mapping's own achievable range, and each
property is checked for the shipped defaults, a smaller motor, and a
motor whose limits cover the whole action range, so a change to the
defaults only fails them when a property is broken.

Assisted-by: Claude:claude-fable-5
Signed-off-by: Saibernard Yogendran <bernie97@seas.upenn.edu>

* ci(tests): run the mc_nn_control unit tests in the neural configuration

make tests builds px4_sitl_test, which does not enable MC_NN_CONTROL, so
the unit tests the module registers were never built or run upstream. The
only configuration that enables the module is px4_sitl_neural.

Add a tests_neural target that builds that configuration with testing on
and runs the module's tests, the same shape as tests_daa_crosstrack and
tests_vtest_moving, and run it from the Unit Tests job.

Assisted-by: Claude:claude-fable-5-1
Signed-off-by: Saibernard Yogendran <bernie97@seas.upenn.edu>

---------

Signed-off-by: Saibernard Yogendran <bernie97@seas.upenn.edu>
2026-09-30 15:26:44 -06:00
Jacob Dahl 1ec22c2703 docs(agents): add parameter ownership and translation guidelines (#28937)
Moving logic between modules invites three mistakes, all made while
reworking the GNSS pipeline: the consumer keeps reading the moved
parameters, gets a duplicate parameter, or gets a hardcoded constant for
what was a separate, tunable concept. Translations also get written for
renames that never shipped in a release.

Assisted-by: Claude:claude-opus-5-5
2026-09-30 14:56:33 -06:00
Jacob Dahl d5223850dd docs(contributing): discourage force-pushing during review (#28931)
* docs(contributing): discourage force-pushing during review

A force-push after review has begun erases the commits a reviewer has read, so they cannot see what changed since. The guidance told contributors to squash and reword instead, which contradicts the commit and pr agent skills. PRs are typically squash-merged, so branch history does not need cleaning up before merge.

Assisted-by: Claude:claude-fable-5-1
Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>

* ci(workflows): remove commit message check

PRs are squash-merged under the PR title, which is still checked. Flagging the individual commits pushed contributors to rewrite history mid-review.

Assisted-by: Claude:claude-fable-5-1
Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>

---------

Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>
2026-09-30 11:04:19 -06:00
Ramon Roche 39f8b7bbfd ci(build_all): keep build artifacts for 1 day
Every build_all_targets run uploads about 1.3 GB of firmware, and
without retention-days it took the 90-day repository default. At
1,200-1,500 runs a month that held roughly 10 TB of Actions storage,
about $2k/month gross. PR artifacts only exist so authors can download
a build to test, and on pushes and tags the artifacts job copies them
to S3 and the GitHub Release in the same run.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-09-29 12:56:15 -07:00
Ramon Roche 47ce39d468 ci(macos): run on pull requests only when macOS setup changes; add weekly run
macOS runners cost roughly 10x Linux per minute, and this workflow was
about $1.8k/month gross running on every pull request. Pull requests now
run it only when they touch the macOS setup scripts, Homebrew pins, pixi
environment, Python requirements or the workflow itself. Pushes to main
still run it on every non-docs change, and a weekly scheduled run catches
upstream Homebrew/conda-forge drift. Non-PR runs save the ccache so pull
requests keep restoring from a fresh entry.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-09-29 12:47:45 -07:00
Ramon Roche ec2687abc3 ci(usb-ids): check board USB IDs on PRs that change them
The workflow triggers on pull requests that touch a board defconfig or
the USB ID tooling, and checks only the defconfigs the PR adds or
modifies. The file list comes from diffing the checked-out PR merge
commit against its base parent, so no API call or token is needed. A PR that changes the tooling itself is checked against every
board, so a checker change is proven on the real tree and not only by
its unit tests. A test keeps the tooling list and the workflow paths
filter in sync.

A manual run checks every board. There is no push or scheduled run: the
registry repo checks its own changes against PX4 main, and board
changes reach main only through PRs.

The mypy and flake8 step for the checker and runner lives in
python_checks.yml with the other Python tooling checks.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-09-28 14:44:48 -07:00
Ramon Roche 14cf29bb31 fix(build): check submodules once per configure, never reset changes
Every px4_add_git_submodule call ran check_submodules.sh twice, at
configure and build time, and with CI=true force-updated each submodule
every time, a 2017 workaround for an interactive prompt that is gone.
VS Code and CLion force-updated too, resetting submodule changes under
development.

The check now runs once per configure. A missing submodule is fetched;
one at another commit is kept as it is, with a warning locally and an
error in CI.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-09-28 11:50:38 -07:00
Ramon Roche 9a17deda06 ci(clang-tidy): prepare the clang build dirs in sequence
`make -j clang-ci` configured px4_sitl_default-clang and
px4_sitl_default-clang-test at the same time, and both configures fetch
the same submodules. About 1 in 200 Static Analysis runs failed with
`index.lock: File exists` or a half-cloned libevents.

The workflow now runs the configure-only test dir first, which fetches
the submodules, then builds the clang dir, which finds them present.
clang-ci had no other user, so it is removed.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-09-28 10:55:25 -07:00
Ramon Roche 89c68cd37f ci(build-all): build two targets per job concurrently
Each build job compiled its group one target at a time, and the serial
parts of every build (configure, the NuttX make, linking) left the 4-vCPU
runners about half idle. Two concurrent builds keep them around 80% busy
and cut total build-step time about 24% and runner cost about 17%.
Larger runners and more slots were measured and cost more than they save.

build_all_runner.py replaces build_all_runner.sh. NuttX compiles inside
its source tree, so each extra slot is a git worktree under .build_slots/.
All submodules are fetched once before building, each slot clones them
locally from the checkout, and builds run with GIT_SUBMODULES_ARE_EVIL=1
so CMake's per-configure submodule check does not sync and update them
concurrently on the shared .git/config. Targets that write the same
build/ directory (<board>_deb with <board>_default, the metadata targets
with px4_sitl_default) always share a slot, and the runner refuses a plan
that would split them. Every target is built even after a failure. Build
output streams with a [seconds|slot target] prefix, each target prints its
memory usage or, on failure, the excerpt from the first error, and a Build
Logs step prints each target's full log as one collapsed group. Slot build
directories are moved into build/, so packaging is unchanged.

The matrix now carries targets as a list plus a slot count from
build_all_config.yml; the comma-joined string existed only because
workflow expressions could not pass an array to a shell command, which
join() now does. The scan job runs new tests for the generated matrix and
the slot assignment.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-09-28 09:45:09 -07:00
Ramon Roche 939b420488 ci(codecov): upload unit test coverage (#28869)
* ci(codecov): upload unit test coverage and limit SITL coverage to main

Coverage on main came from a single standard_vtol SITL flight, unit tests
were never uploaded, and the Coverage build never hit ccache because
ccache 4.9.1 (Ubuntu 24.04) rejects -fprofile-update=atomic. The flag only
keeps hit counts exact under thread races; line coverage is unaffected and
lcov already ignores the resulting negative counts.

Unit tests now build with coverage and upload as the unittests flag on
every PR and push to main. standard_vtol builds as Coverage on main only
and uploads as sitl-vtol, carried forward on PRs. codecov.yml sets the
default branch, informational project/patch statuses and ignores.
Per-build-type ccache keys stop the Coverage and RelWithDebInfo jobs from
overwriting each other's cache.

Fixes #28862

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Ramon Roche <mrpollo@gmail.com>

* ci(codecov): run unit test coverage as its own job

The Coverage build shifts EKF replay float output, so running it in the
Unit Tests job made the change indication step auto-commit new baselines
to the PR branch. Unit Tests goes back to the plain build and a separate
job produces the unittests upload. disable_search keeps the Codecov
uploader to the lcov report instead of running gcov over the build tree.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Ramon Roche <mrpollo@gmail.com>

---------

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-09-26 19:11:53 -07:00
Ramon Roche bf9b1610ca fix(ros2): pin BuildKit for larger dev container SBOMs
Publishing px4-dev-ros2-gazebo fails because its SPDX attestation exceeds
BuildKit 0.32's 40 MiB limit. Pin the builder to v0.33.0 (80 MiB), matching
the fix already applied to build_deb_package.yml in 61907962c9.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-09-26 18:51:08 -07:00