Commit Graph
2316 Commits
Author SHA1 Message Date
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
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
Andrea BernasconiandHamish Willee db94ca49db feat(failure_injection): add wrong, garbage and drift IMU failures (#29601)
* feat(failure_injection): add wrong, garbage and drift injection for gyro and accel

Corrupt the addressed IMU's samples on all three axes: wrong adds a
constant bias (SYS_FAIL_{G,A}_BIAS), garbage uniform noise within
+-SYS_FAIL_{G,A}_NOISE and drift a bias growing by SYS_FAIL_{G,A}_DRIFT
per second since injection. Applied to both the plain and FIFO driver paths.

* refactor(failure_injection): handle IMU failures in process_imu()

Mirror process_gnss(): resolve the mode once, run the generic Off / Stuck
first and only then apply the Wrong / Garbage / Drift offset, so the Stuck
cache keeps the uncorrupted sample and a later Stuck never replays a
drifted one. Drop the second process() on the integrated FIFO report, which
cached the already-corrupted report. The offset is still computed before
Off so drift_start is reset while the sensor is off.

* docs(failure_injection): align IMU failure docs with code

The Syntax section did not list drift and described garbage as
uninitialised-memory output, while gyro/accel garbage adds bounded noise
to the real measurement. Also match the new parameter descriptions to
the wording of the existing SYS_FAIL_* parameters.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Hamish Willee <hamishwillee@gmail.com>

* fix(failure_injection): add drift RC mode and clarify bias param text

* refactor(drivers): Drop extra comment

* test(mavsdk_tests): add SITL test for IMU failure injection

Fly the SIH quad through gyro and accel bias, noise and drift with the
default SYS_FAIL_{G,A}_* magnitudes and check it holds altitude.

Holding altitude alone also passes when the injection never reaches the
sensor data, so the test also checks that the IMU noise level jumps
while noise is injected and returns once cleared. Bias and drift are
not checked in the data: the rate controller and the estimator react
to them and partly hide them in flight.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Andrea Bernasconi <andrea.bernasconi@auterion.com>

* test(mavsdk_tests): inject IMU failures through MAVSDK 4.2.0

MAVSDK-Python 4.2.0 adds FailureType.DRIFT (mavlink/MAVSDK#3211), so the
IMU failure test no longer needs to send a raw MAV_CMD_INJECT_FAILURE
with its own copies of the unit and type values. Use the tester's
inject_failure() like the motor failure tests, and bump the mavsdk pin
so the new type is available.

Assisted-by: Claude:claude-fable-5-2
Signed-off-by: Andrea Bernasconi <andrea.bernasconi@auterion.com>

---------

Signed-off-by: Hamish Willee <hamishwillee@gmail.com>
Signed-off-by: Andrea Bernasconi <andrea.bernasconi@auterion.com>
Co-authored-by: Hamish Willee <hamishwillee@gmail.com>
2026-11-13 11:24:05 +01:00
Michael Fritsche e8b3274ab0 feat(msg): rename rover throttle setpoint to surface_vehicle_thrust_setpoint (#29777)
* feat(msg): rename rover throttle setpoint to surface_vehicle_*

The throttle setpoint was the last rover topic shared by rovers and boats
without the surface_vehicle_* prefix decided in #29524. Rename
RoverThrottleSetpoint to SurfaceVehicleThrottleSetpoint and the
TYPE_ROVER_THROTTLE_* setpoint types to TYPE_SURFACE_VEHICLE_THROTTLE_*.
The type values are unchanged.

The topic rename breaks ROS 2 users anyway, so also shorten the fields of
the throttle and speed setpoints to x and y: the message name already says
what the value is and [@frame Body] states the frame.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Michael Fritsche <frimi999@gmail.com>

* fix(zenoh): bring surface_vehicle rename to the zenoh dds topics

* fix(concept): rename rover throttle setpoint to surface_vehicle_* in navigation terminology

* fix(tools): update px4-ros2-interface-lib pin

* docs(msg): describe sideways fields as omnidirectional, not mecanum

The surface vehicle messages are shared by rovers and boats, and the lateral
axis applies to any vehicle that can move sideways, not only mecanum rovers.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Michael Fritsche <frimi999@gmail.com>

* docs(ros2): use the surface vehicle setpoint type names of the interface lib

The pinned px4-ros2-interface-lib names the rover setpoint types
SurfaceVehicle*SetpointType. The table and the example reference still used
the old Rover*SetpointType class names, which do not exist in that version.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Michael Fritsche <frimi999@gmail.com>

* feat(msg)!: rename surface vehicle throttle setpoint to thrust setpoint

The setpoint is a normalized force command along the body x and y axes,
which is a thrust, not a throttle. Throttle stays the name for the motor
command the actuator control derives from it.

surface_vehicle_throttle_setpoint is now surface_vehicle_thrust_setpoint
(SurfaceVehicleThrustSetpoint), and SetpointConfig
TYPE_SURFACE_VEHICLE_THROTTLE_* are now TYPE_SURFACE_VEHICLE_THRUST_*
(same values). The px4-ros2-interface-lib pin follows the matching rename
there.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Michael Fritsche <frimi999@gmail.com>

* fix(tools): update px4-ros2-interface-lib pin

* fix(commander): do not enable velocity control for surface vehicle thrust setpoints

The SurfaceVehicleThrust* setpoint types enabled the velocity flag, taken
over from the original interface lib configuration. Nothing in these types
uses velocity, and offboard mode maps the same combinations without it.

The flag kept the rover speed controller running: switching from a
SurfaceVehicleSpeed* to a SurfaceVehicleThrust* type sets the same flags,
so the controllers were not reset and a stale speed setpoint kept
overriding the commanded thrust. It also made external modes that only
command thrust require a local position estimate.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Michael Fritsche <frimi999@gmail.com>

* docs(msg): apply review suggestions for the surface vehicle setpoints

Add long descriptions to the thrust and speed setpoints and the speed
status, name modules instead of C++ classes, and use single spaces before
field comments. Rename the speed status PID integrals from pid_throttle_*
to pid_thrust_*, since the speed controller drives the thrust setpoint.

Update the docs and the rover control structure diagram for the thrust
setpoint and omnidirectional vehicles, note the Rover*SetpointType names of
PX4 v1.17 and v1.18, and add the ROS 2 release note.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Michael Fritsche <frimi999@gmail.com>

---------

Signed-off-by: Michael Fritsche <frimi999@gmail.com>
2026-11-13 10:05:26 +01:00
cb00217286 feat(sih): add optional support for non-flat terrain for MC, FW and VTOL (#29619)
* feat(simulator_sih): add a GeoTIFF terrain elevation model for SITL

SIH only simulates flat ground. This adds the loader for a terrain
elevation model (DEM) in a GeoTIFF file, the base for non-flat terrain
in SITL.

The DEM is read with libtiff and libgeotiff. A DEM in a projected CRS is
resampled once at load time with PROJ onto a WGS84 lat/lon grid, so a
lookup in the simulation loop is a plain bilinear interpolation. It is
built only for px4_sitl and only when the three libraries are found, so
hardware builds and SITL without them are unchanged.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Beniamino Pozzan <beniamino.pozzan@auterion.com>

* feat(simulator_sih): use the terrain DEM for ground contact and the rangefinder

With PX4_SIH_TERRAIN set to a GeoTIFF DEM, SIH in SITL places the vehicle
on the terrain at start, lands it on the terrain, ray-casts the downward
distance sensor against it, and publishes it as the groundtruth
terrain_alt. Outside the DEM the ground stays flat at SIH_LOC_H0.

Terrain is only used for multicopters, VTOLs and fixed-wing; other
vehicle types keep flat ground. The DEM is loaded in task_spawn() so a
bad file fails the start command, and because the SIH task stack is too
small for libtiff and PROJ.

The groundtruth terrain_alt now holds the WGS84 terrain altitude, as the
message documents, instead of the height above the origin.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Beniamino Pozzan <beniamino.pozzan@auterion.com>

* build(setup): install the SIH terrain dependencies with the simulation tools

Install libtiff, libgeotiff and PROJ so SITL builds SIH with terrain
elevation (DEM) support. They are optional: without them SIH builds as
before.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Beniamino Pozzan <beniamino.pozzan@auterion.com>

* docs(sim_sih): document terrain elevation from a GeoTIFF DEM

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Beniamino Pozzan <beniamino.pozzan@auterion.com>

* docs(sim_sih): fix and clarify the terrain elevation section

Address review findings on the new terrain section: list the sample
types the loader actually reads, note that the prebuilt px4 package and
px4io/px4-sitl container are built without terrain support, and say
when SIH_LOC_H0 still sets the start altitude.

Also add a version badge, link GeoTIFF, EPSG and GDAL, mention the
dist_bottom groundtruth field, and correct the GLO-30 coverage.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Hamish Willee <hamishwillee@gmail.com>

* fix: cast to double for MAC builds

Signed-off-by: Beniamino Pozzan <beniamino.pozzan@auterion.com>

* chore: implement TerrainBase interface

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

Signed-off-by: Beniamino Pozzan <beniamino.pozzan@auterion.com>

* chore: improve isolation of terrain logic from sih core

Signed-off-by: Beniamino Pozzan <beniamino.pozzan@auterion.com>

* refactor(simulator_sih): move DEM handling into the terrain classes

SIH should only use the terrain, not manage it. TerrainFlat becomes the
base class, since flat ground is what every terrain model builds on, and
TerrainDem falls back to it until a DEM is loaded. Terrain.hpp picks the
model at compile time, so SIH holds the terrain by value with no #ifdef,
new/delete or pointer handover, and NuttX builds only get the flat model.

Tracking whether the vehicle is inside the DEM, and the matching
warnings and status, move from SIH into TerrainDem.

The DEM is still loaded in task_spawn() because the SIH task stack is too
small for libtiff and PROJ, so the terrain is a static member that the
instance uses directly instead of moving it.

A terrain file with an unsupported vehicle type now fails the start like
a bad file instead of silently using flat ground.

---------

Signed-off-by: Beniamino Pozzan <beniamino.pozzan@auterion.com>
Signed-off-by: Hamish Willee <hamishwillee@gmail.com>
Co-authored-by: Hamish Willee <hamishwillee@gmail.com>
Co-authored-by: Matthias Grob <maetugr@gmail.com>
2026-11-12 16:49:11 +11:00
Alex E 59fa7a4a7d docs(modules): add auto-generated disclaimer to every module reference page (#29673)
Only modules_main.md told readers that the module reference is generated
from source. The per-category pages (modules_driver.md, modules_system.md,
...) and the per-subcategory pages (modules_driver_imu.md, ...) had no such
note, so contributors kept fixing typos directly in docs/en/modules/ and
the next metadata sync silently reverted them (see #29614).

Emit a `::: info` block right under the H1 of every category and
subcategory page. The wording follows the existing disclaimers on the
airframe reference and the uORB message index: it links to the generator
script and names the `make module_documentation` target.

docs/en/modules/*.md are regenerated with the updated generator and run
through Prettier, mirroring what the docs-orchestrator metadata sync does
on main, so the diff is only the new note.

Fixes #29624

Assisted-by: Claude:claude-fable-5-1

Signed-off-by: Alex E <aelejandro9@gmail.com>
2026-11-10 08:51:33 +11: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
Peter van der PerkandAndre Heinemans fec5cf5d14 fix(boards): address MR-NavQ95 review feedback
- USB VALID/CONNECTED set to 0
- TPM: reject OneShot when the clock can't support it, fix W1C status
  and hw channel indexing, scale TPM3 to its correct tick
- Set pad pulls through the iomux
- Calibrate LOOPSPERMSEC on hardware (159856)
- Drop I2C_LATEINIT, the ADC critical section and the FAT DMA pool
- Add validateSPIConfig
- Round the LPIT reload up
- Make imx9 its own CI chip family, with its own group and seeder
- Reject BDShot150 and fall back to plain DShot (also a long-standing
  bug on i.MX RT)

Signed-off-by: Peter van der Perk <peter.vanderperk@nxp.com>
Co-authored-by: Andre Heinemans <andre.heinemans@nxp.com>
2026-11-06 07:32:53 -08:00
Peter van der PerkandAndre Heinemans c393ca3704 tools(module_config): evaluate preprocessor guards in timer_config.cpp
The output-group parser reads timer_config.cpp as text. A board that
guards timer or channel entries with #if defined(CONFIG_...) now gets
those guards evaluated against the board's Kconfig output, passed as
--board-config by the parameter and actuator metadata generators, so
the PWM_MAIN parameters and the actuator metadata match the channels
the firmware actually has.

Co-authored-by: Andre Heinemans <andre.heinemans@nxp.com>
2026-11-06 07:32:53 -08:00
Peter van der PerkandAndre Heinemans 676b485702 feat(platform): add the NXP i.MX9 and i.MX95 NuttX platform layer
Add the PX4 arch layer for the i.MX9 family: ADC, HRT on LPTMR with
LPIT deadlines, TPM io timers, pin interrupts, LPSPI with chip selects
for all eight instances, critmon on the DWT cycle counter, a tone alarm
on a TPM channel, version reporting with the 128-bit ECID read from the
Fuse Status Block as the UUID, the board reset entry point, plus the
i.MX95 chip include set, the chip mapping in px4_impl_os.cmake and the
PX4_SOC_ARCH_ID_IMX95 id. DShot uses the shared NXP FlexIO driver with
the i.MX9 FlexIO base, offsets, IRQ, clock root and pad hooks.

Not implemented yet: reset of the M7 through the System Manager, LED
PWM and PWM input capture.

i.MX9 timer configs name their timers Timer::TPMn and mark DShot
capable ones with initIOTimerDshot(), so teach
output_groups_from_timer_config.py both forms.

Co-authored-by: Andre Heinemans <andre.heinemans@nxp.com>
2026-11-06 07:32:53 -08:00
Peter van der PerkandAndre Heinemans 5dcb5d825e build(nuttx): generate an MCUboot image when the board asks for it
Boards started by MCUboot, such as the i.MX95 flash build, need the
raw objcopy output wrapped in the MCUboot header and TLV trailer before
it boots. Add CONFIG_BOARD_MCUBOOT_IMGTOOL_ARGS, a board option holding
the imgtool sign arguments, and build <config>.signed.bin next to the
plain .bin from the NuttX CMake, the way Zephyr's west sign does. The
plain .bin and everything derived from it stay as they are.

A signing key is passed through BOARD_MCUBOOT_KEY in the environment
at configure time, so private keys stay out of the board files.

imgtool comes from PyPI via Tools/setup/requirements.txt. When it is
missing, CMake warns and skips the signed image instead of failing the
configure.

The .px4 package is only built when the board has a firmware.prototype,
so a board that boots through MCUboot and has no PX4 bootloader needs
no board_id.

Co-authored-by: Andre Heinemans <andre.heinemans@nxp.com>
2026-11-06 07:32:53 -08:00
Beniamino Pozzan c71b6b4ccf style(zenoh): make the module Clang and clang-tidy clean
The module is now part of px4_sitl_default, so the Clang build and
clang-tidy cover it for the first time. Silence -Wmissing-braces for
the zenoh-pico headers it includes, mark the overrides in the ZENOH
module and uORB publisher, and use nullptr and a parenthesized
ZENOH_PUBSUB_COUNT in PX4's own code and the generated factory.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Beniamino Pozzan <beniamino.pozzan@gmail.com>
2026-11-04 15:51:34 +00:00
Beniamino Pozzan af00ee618a feat(packaging): support Zenoh in the SITL containers
The runtime images send DDS to the host on Docker Desktop, but Zenoh
would still dial 127.0.0.1 inside the container. Point it at the host
router the same way, leaving an explicit PX4_ZENOH_LOCATOR untouched.

Install rmw_zenoh_cpp in the ROS images so they can run the Zenoh
router and talk to PX4 over Zenoh without extra setup.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Beniamino Pozzan <beniamino.pozzan@gmail.com>
2026-11-04 15:51:34 +00:00
Beniamino Pozzan 97edba71fd feat(sitl): select uXRCE-DDS or Zenoh at runtime
SITL users who want Zenoh had to build the separate px4_sitl_zenoh
target, so the prebuilt packages and containers could only talk
uXRCE-DDS. Build both clients into the SITL default board (and thereby
SIH) and pick one at startup instead.

PX4_ROS2_MIDDLEWARE=uxrce_dds|zenoh|none selects the middleware and is
stored in ZENOH_ENABLE, so without the variable the persisted parameter
decides; uXRCE-DDS stays the default. rcS keeps only this selection and
sources px4-rc.uxrce_dds or px4-rc.zenoh for the client startup. The
Zenoh one maps ROS_DOMAIN_ID to ZENOH_DOMAIN_ID and applies
PX4_ZENOH_LOCATOR, when set, as the router address.

The container entrypoint follows the uXRCE-DDS start command into its
new file so Docker Desktop keeps routing DDS to the host.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Beniamino Pozzan <beniamino.pozzan@gmail.com>
2026-11-04 15:51:34 +00:00
Michael Fritsche ec454b9a9b feat(msg): rename shared rover topics to surface_vehicle_* (#29524)
Signed-off-by: Michael Fritsche <frimi999@gmail.com>
2026-11-04 15:21:37 +01:00
Jacob Dahlanddanielbuleandra ae7977f868 feat(dshot): log the ESC EEPROM dumps (#28800)
* fix(dshot): retry telemetry init until the motor mask is known

rc.serial issues `dshot telemetry` right after `dshot start`, and the first
Run() usually handles it before the mixer has reported the outputs.
initSettingsHandlers() then latches with an empty motor mask, so no ESC
settings handler is ever created and the EEPROM is never read.

Co-authored-by: danielbuleandra <daniel.buleandra@auterion.com>
Assisted-by: Claude:claude-fable-5-1
Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>

* feat(logger): log the ESC EEPROM dumps

The raw dump is logged through the existing queued esc_eeprom_read topic.
The layout depends on the ESC firmware and its EEPROM revision, so decoding
happens offline in Tools/esc_eeprom_decode.py against the schema the ESC
vendor publishes.

A subscriber that joins after the first publish only sees the newest queued
entry. The logger subscribes on a sweep that can lag a new topic by half a
second while all ESCs answer within milliseconds of each other, so the topic
is advertised when the settings handlers are created, well before the first
request goes out at ESC_INIT_TELEM_DELAY.

Co-authored-by: danielbuleandra <daniel.buleandra@auterion.com>
Assisted-by: Claude:claude-fable-5-1
Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>

* feat(dshot): publish and refresh cached ESC settings

Logs can start after boot or during flight, so cached settings must be published independently of arming. The queue must retain a complete set of ESC dumps for the logger and MAVLink stream.

Keep programming uninterrupted and cached data valid across saves and reconnects. Failed reads remain pending with spaced retries so one unresponsive ESC cannot starve the rest.

Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>
Assisted-by: Codex

* fix(tools): decode repeated ESC dumps across firmware layouts

Logs contain repeated dumps and may mix EEPROM layouts. Collapse unchanged samples, apply the schema's version bounds and disabled values, and keep overlays immutable so one ESC cannot change another's decoding.

Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>
Assisted-by: Codex

* fix(dshot): bound ESC settings read retries

A pending settings read blocks the telemetry round-robin until it completes or times out, and the retry spacing was kept per ESC. With several ESCs that never answer, reads ran back to back, telemetry went stale and the arming check reported every ESC offline.

Space retries across all ESCs, give up on one after three failed reads until it reconnects or is asked for again, and time a read out at 100 ms: AM32 answers within milliseconds of the sixth frame, and anything under the 400 ms arming-check window keeps telemetry fresh.

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

* fix(dshot): keep programming active until the save is sent

The flag was cleared when the save command was queued, so it no longer guarded the save itself. Only the finished() gate in the vehicle command loop kept a CONFIGURE_ACTUATOR from replacing it. Clear the flag when the last save frame goes out so the guard covers the whole sequence.

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

* fix(dshot): send each ESC EEPROM read once per MAVLink link

The once-a-second republish that keeps the dumps in every log also went out on every link with ESC_EEPROM configured, low-bandwidth ones included, one message per ESC per second. timestamp_sample records when a dump was read, so the stream forwards each read once per link and still reaches a link that connects later.

A motor waiting on an EDT retry or out of EDT attempts took the command slot without sending anything, so settings reads never ran while any ESC left EDT unconfirmed. Vehicle commands now wait for an outstanding settings read, which ends within 100 ms, instead of CONFIGURE_ACTUATOR being rejected.

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

* fix(msg): queue one ESC EEPROM dump per esc_status ESC

The republish queues every cached dump at once, so the queue needs one entry per ESC and no more. DSHOT_MAX_MOTORS is capped at CONNECTED_ESC_MAX, and the static_assert in AM32Settings.cpp keeps the two in step.

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

* fix(dshot): mark the settings save explicitly

Programming ended when any finished command carried the value 12, which the address and value frames do whenever they write offset 12 (active brake power) or a value of 12. The write then stopped part way, with the ESC still in programming mode and the next write resuming mid-sequence.

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

* fix(dshot): keep settings requests and writes to configured motors

An all-ESC save requested settings for every motor slot, and the single-ESC request and write paths took any index below the motor limit. Reads only go to motors with a settings handler, so the other bits stayed pending in dshot status forever. A write to an index with no output was never sent, so the command never finished and blocked every later command and the serial telemetry until reboot.

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

* docs(dshot): describe the logged ESC settings and their decoding

The page said the settings are only read at boot and only reach a ground station.

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

* feat(dshot): set the ciclicity to 10s for eeprom logging

---------

Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>
Co-authored-by: danielbuleandra <daniel.buleandra@auterion.com>
2026-11-03 08:14:51 -07:00
Michael Fritsche 2ade646922 fix(CI): update px4-ros2-interface-lib pin (#29581) 2026-11-02 17:03:46 +01:00
Jacob DahlandBalduin 791ba46833 refactor(msg): address CDR fields by offset in the generated serializers (#29546)
The generated ucdr_serialize/ucdr_deserialize functions advanced
buf.iterator and buf.offset after every field. Because the memcpy
through buf.iterator may alias the ucdrBuffer itself, the compiler had
to reload the iterator, store it back and update the offset in memory
for each field: four extra instructions per field, in every topic
forwarded by uxrce_dds_client.

Compute the CDR offset of each field in the generator instead, copy
relative to the position at entry, and advance the buffer once by the
topic size. The wire format and the final buffer state are unchanged; a
host test serializing and deserializing random data for all 259 topics
with the old and new headers gives identical bytes, structs and buffer
positions.

px4_fmu-v6x_default: 1929304 -> 1919176 bytes of text, -10128 B.

Assisted-by: Claude:claude-fable-5-1

Co-authored-by: Balduin <balduin@auterion.com>
2026-10-31 12:12:55 -06: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
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 4bf3a5bd51 fix(params): honor reboot_required: false in the parameter metadata (#29517)
The generator copied the yaml value into the tag, so false became
"@reboot_required False", and the metadata parsers treat any value as
set. QGC prompted for a reboot after changes to 35 parameters that
apply live, among them the gyro filters, log rotation and ADSB squawk.
Emit flag tags only when true. volatile had the same flaw, though no
parameter sets it false yet.

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

Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>
2026-10-29 18:14:22 -06:00
Michael FritscheandHamish Willee d998124a2a feat(rover): add SurfaceVehicleCourseSetpoint for course hold (#29243)
* docs(msg): clarify RoverPositionSetpoint field descriptions

* feat(rover): introduce a course parameter to get rid of the course-hold workaround hack (#29245)

* fix(ros2): update ros2 interface lib pin to include course and target_ned in RoverPositionSetpoint

* style(msg): use single space before comments in RoverPositionSetpoint

The column padding triggers the msg doc generator's multiple-whitespace
note on every field.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Hamish Willee <hamishwillee@gmail.com>

* fix(msg): update RoverPositionSetpoint descriptions

* feat(msg): add SurfaceVehicleCourseSetpoint

* fix(repositories): update px4 ros2 interface lib version

* fix(msg): add comment that yaw in RoverPositionSetpoint msg is currently not used

* fix(msg): rename surface_vehicle_course_setpoint to planar_course_setpoint

* fix(rover): keep the course line while a course setpoint is streamed

A PlanarCourseSetpoint without start_ned re-anchored the line at the
vehicle position on every message. Publishers that stream the setpoint,
the usual pattern over ROS 2, therefore never got cross-track error
corrected: in SITL the rover drifted 3.8 m off course over 54 m. Keep the
current line while the same course is published without a start
position, and only re-anchor when the course changes.

Also document that a NaN course leaves the position controller idle and
that yaw is currently unused, matching RoverPositionSetpoint.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Michael Fritsche <frimi999@gmail.com>

* fix(msg): rename planar_course_setpoint to ugv_usv_course_setpoint

* docs(msg): add documentation for UgvUsvCourseSetpoint

* feat(rover): proper guided course implementation

* fix(rover): rename course setpoint cruising_speed param to speed

* fix(msgs): rename ugv_usv_course_setpoint.msg to surface_vehicle_course_setpoint.msg

* docs(rover): clarify course setpoint wording

Doc review fixes for the course hold docs and message comments:
unclear antecedents, a misplaced modifier, a missing verb, and the
pure pursuit sentence separated from the course setpoint text it no
longer described. The yaw @invalid tag now matches in both messages,
since no controller reads the field.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Hamish Willee <hamishwillee@gmail.com>

* Apply suggestion from @hamishwillee

* docs(rover): fix course tracking formulation for the different rover types

* fix(rover): maintain current speed upon guided course mode entry

* docs(rover): clarify guided course mode documentation.

* fix(rover): handle nav_state_land in rovers

* fix(rovers): polish the used terminology

* docs(rover): switch to list for guided course mode usable commands

---------

Signed-off-by: Hamish Willee <hamishwillee@gmail.com>
Signed-off-by: Michael Fritsche <frimi999@gmail.com>
Co-authored-by: Hamish Willee <hamishwillee@gmail.com>
2026-10-29 11:12:41 -04:00
Jonas Peroliniandjonas a3f811ca69 fix(gazebo-classic): bump submodule for the camera manager build fix (#29452)
The MAVLink update in #29366 added a vfov extension field to
VIDEO_STREAM_STATUS. The camera manager plugin still packed that message
with the old argument count, so the gazebo-classic plugins no longer
built. Pick up the fix from PX4/PX4-SITL_gazebo-classic#1094.

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

Signed-off-by: jonas <jonas.perolini@rigi.tech>
Co-authored-by: jonas <jonas.perolini@rigi.tech>
2026-10-28 20:33:28 +13:00
Ban Siesta (Bot) 787e1d81ee test(mavsdk_tests): bump MAVSDK to 4.1.0 and drop the unsubscribe workaround (#29447)
MAVSDK-Python 4.1.0 keeps the callback trampoline alive until the C
unsubscribe has returned (mavlink/MAVSDK#3165), so the tester no longer
needs to hold retired subscription entries until it is closed. Call the
plugins' unsubscribe_*() directly again.
2026-10-28 02:47:08 +13:00
af006cf1c3 feat(motor_failure_detector): add current-residual detection (#27711)
* feat(motor_failure_detector): add current-residual detection library

Per-motor model-based motor-failure detector for multirotors. Predicts the
expected ESC current from the commanded actuator signal
(I_exp = current_slope_a*u + current_idle_a) and trips on a low-pass-filtered
residual held past a trip band for a persistence time. The command (not measured
rpm) is the fault-independent reference: a dead motor that draws no current while
still commanded produces a large residual, whereas a current-vs-rpm model would
mask a clean stop.

Band and persistence are configurable per residual direction. Undercurrent is the
fault-consistent side -- an open circuit, a shed propeller or a desync makes a
motor draw less than commanded -- while overcurrent covers a winding short,
mechanical jam or demagnetization. They are separate because the benign residual
is far from symmetric: a fast throttle increase draws acceleration current the
static model cannot predict, so overcurrent excursions are large and unbounded,
whereas an undercurrent residual is floored at -I_exp. A single band sized to
reject the overcurrent transients can therefore end up wider than the largest
undercurrent fault a motor can physically produce, which makes a full current
collapse undetectable rather than merely slow. Set undercurrent_threshold_a <= 0
to keep one symmetric band on the residual magnitude.

Built on PX4 primitives rather than hand-rolled equivalents: update() takes a
timestamp (esc_status.timestamp in flight, the log timestamp in replay) and
derives dt internally; the residual filter is a mathlib AlphaFilter; the
persistence debounce is a systemlib::Hysteresis per direction (with a sticky latch
on top, and reset across data gaps so a dropout can't complete a pending trip).

The data-gap threshold (kMaxGap = 0.3 s) is sized above the ~10 Hz arming-check
feed interval and below the 400 ms ESC-offline timeout: a live feed is never
mistaken for a gap (a smaller value equal to the feed interval reset the filter
and debounce on the majority of jittered ticks, so a sustained fault never
survived the persistence window -- offline replay: 0/100 sampling phases latched
vs 100/100 gap-free), while a genuine outage still resets and is handled by the
separate ESC liveness guard.

Includes an 18-case gtest spanning the failure-mode spectrum and edge cases:
healthy-never-trips (incl. high throttle), open-circuit and overcurrent trips,
severe prop-loss undercurrent, the missed ~50% partial loss (documents the
detection floor), the per-direction bands (a tighter undercurrent band catching a
collapse one symmetric band misses, band independence, per-side persistence),
persistence (short spike crosses-threshold-but-recovers), gap reset, the 10 Hz
feed vs. real-gap boundary, dropout-holds, multi-motor, the exclusion gate,
monitor-only, and reset/latch.

* refactor(motor_failure_detector): resolve the undercurrent band at configure time

An unset undercurrent threshold now mirrors the overcurrent band in
configure(), so update() runs the same two bands in every configuration and
no longer carries a second threshold test that reads like a repeat of the
disable gate. A symmetric band is the two-band case with equal bands.

Also name esc_status CONNECTED_ESC_MAX at kMaxMotors so the constant is
findable, use the PX4 time literals for the persistence conversions, and
drop the excluded temporary.

* feat(commander): use current-residual detector for the ESC motor-failure check

Replace the flat, instantaneous current check in EscChecks::checkMotorStatus with
the MotorFailureDetector library (added in the parent PR). Per motor it predicts
the expected ESC current from the commanded thrust
(I_exp = MOTFAIL_C2T*u + MOTFAIL_IDLE) and trips on the low-pass-filtered
residual, with an independent band and hold time per direction: MOTFAIL_UNDER held
for MOTFAIL_UND_TIME below the expectation, MOTFAIL_OVER held for MOTFAIL_OVR_TIME
above it.

Because the two directions need separate bands, the single band and hold time are
renamed to name the direction they act on: MOTFAIL_OFF -> MOTFAIL_OVER and
MOTFAIL_TIME -> MOTFAIL_OVR_TIME, migrated in param_translation.cpp. The old band
applied to both directions, so it carries over to the overcurrent side, and
MOTFAIL_UNDER defaults to 0, which keeps a single symmetric band -- an existing
vehicle behaves as before. MOTFAIL_IDLE also defaults to 0, and the whole check
stays gated by FD_ACT_EN (off by default).

The detector is driven off esc_status.timestamp, so a telemetry stall freezes the
filter instead of integrating stale current; the separate 400 ms ESC telemetry
timeout stays in checkEscOnline(). It is reconfigured from parameters while
disarmed, so a parameter change never resets a latched failure mid-flight. The
motor_failure_mask still feeds failure_detector_status via
FailureDetector::publishStatus, leaving the ControlAllocator reaction path
untouched.

The mask reports the detector's sticky latch alone, not whether the motor is
currently evaluable. That preserves the invariant the previous check spelled out
-- "Only set, never clear mid-air: stopping the motor in response could make it
appear healthy again" -- because handling a failure makes exactly that motor
unevaluable: the control allocator drops it, which publishes a NAN command,
which excludes it from the detector. Re-deriving the mask from the exclusion
state clears it, the allocator restores all motors, and the next check re-trips.
Measured in SIH on a hexarotor with a missing propeller: 83 mask transitions in
nine seconds, with a reversed recovery motor swinging between idle and near-full
reverse at the 10 Hz check rate. An ESC going offline after a real failure
retracts the report the same way. The latch is only ever set on a tick where the
motor was evaluable, so reporting it alone cannot report a motor that was never
judged.

* feat(motor_failure_detector): add offline ulog replay tool

Add a host tool that replays a recorded .ulg through the real MotorFailureDetector
and prints the per-motor trip verdict, for validating and tuning the detector
offline (EKF2-replay style: the real library drives recorded data, not a
re-implementation).

Built on ulog_cpp (PX4's C++ ULog library, added as a git submodule and built for
the posix host target only), so it reads ESC current, motor command and arming
state by field name from the log's own format -- one binary replays logs of any
PX4 message version with no rebuild. The feed mirrors the runtime in escCheck:
evaluated only while armed, at the runtime's 10 Hz cadence, with the per-ESC
current-report startup latch and reset-on-disarm. Config comes from the log's
MOTFAIL_* parameters with a built-in calibration fallback, and --set
MOTFAIL_NAME=value overrides any knob for what-if retuning. Because the runtime's
exact 10 Hz sample phase cannot be reconstructed offline, a single pass over the log
drives several detector instances on staggered grid offsets and reports a per-motor
peak band and trip fraction rather than a single phase's verdict, flagging when the
result is phase-dependent.

batch_replay.sh runs the tool over a folder of logs and summarizes each verdict
(OK / FAIL / SKIP) from its exit code.

Off by default so it never enters the firmware build or CI: it is a posix-only,
EXCLUDE_FROM_ALL host executable gated behind the MFD_REPLAY_TOOL cache option.
Build it with:

    cmake -DMFD_REPLAY_TOOL=ON build/px4_sitl_default
    ninja -C build/px4_sitl_default mfd_replay

* docs(motor_failure_detector): document the current-residual motor-failure check

Add a configuration page for motor failure detection, next to the other
actuator topics, and a developer page for the offline replay tool:

- what the check compares and why the under/overcurrent bands are separate
- the new MOTFAIL_* parameters, including the rename migration
- how to fit the current model and pick the bands from the vehicle's own
  logs with mfd_replay / batch_replay.sh

The "Motor Failure Trigger" section in the failsafe page described the
pre-rename parameters, the unfiltered symmetric comparison and claimed the
failure was non-latching, so it is reduced to a summary of the trigger and
its action, pointing at the new page for the thresholds.

* docs(docs): Subedit for simpler introductions and terminology

* docs(docs): Improve upgrading from v1.18 section

* feat(motor_failure_detector): add current-model fitting tool

mfd_fit derives MOTFAIL_C2T and MOTFAIL_IDLE from recorded logs, so the model
and the thresholds are taken from the same data.

Like mfd_replay it reads ESC current, motor command and arming state through
ulog_cpp by field name, so one binary handles any log version. Each log is a
single streaming pass that accumulates only the sums a least-squares line needs,
so memory does not grow with the log or with the number of logs, and a whole
corpus can be fitted in one invocation.

Alongside the parameters it reports the residual spread the trip bands have to
clear, and each motor's bias against the shared model.

* docs(docs): document motor failure detection tuning and the fitting tool

Follow-up to review of the detection and replay pages:

- fix the link left behind by the Failure Response -> Failure Action rename
- drop the Multicopter badge: the check has no vehicle-type gate, so a VTOL's
  multirotor motors and its forward-flight motor are both checked
- describe the model-fitting step without the statistics jargon
- state that only healthy logs may be used, for the fit and the thresholds
- document mfd_fit, and reduce the release note to a pointer

* feat(motor_failure_detector): report residual extremes and add a band sweep

The replay tool printed the largest residual magnitude, which hid whether an
excursion was above or below the model. Since the two trip bands are chosen per
direction, that left the reader running one band at a time to find out. It now
prints the signed minimum and maximum instead, so each band's headroom is
readable straight from the table.

Add sweep_matrix.sh alongside batch_replay.sh: it sweeps one band against its
hold time over a set of logs and prints how many logs false-trip at each pair,
so the lowest usable band per hold time is the first zero in a row.

Both tools now number motors from 1, matching the "Motor N ..." the vehicle
reports, rather than from 0.

* docs(docs): rework the motor failure calibration walkthrough

Follow a real calibration through both pages and fix what it ran into:

- the replay page's worked example is one vehicle end to end, with every
  number and pasted output taken from that corpus
- the fitting tool, the single-log run and the band sweeps are ordered the way
  the work is actually done, with replaying a whole fleet last
- the sweeps are shown as a matrix of false trips per (hold time, band), and
  the grids are derived from the residual extremes rather than guessed
- commands match the output they produce, and say what they need: mfd_replay
  without --set uses a fallback calibration that belongs to another vehicle
- vehicle_status is optional, not required, for the replay
- drop the repetition: batch_replay.sh, the hover-current ceiling and the
  phase-sensitivity note were each explained two or three times

* fix(motor_failure_detector): separate configure and reset with the appropriate triggers

* refactor(motor_failure_detector): clarify leading edge hysteresis as trigger time compared to "persistence"

* fix(escCheck): encapsulate _motor_failure_direction handling into MotorFailureDetector

* fix(astyle): exclude ulog_cpp submodule form check

* fix(motor_failure_detector_tools): fail log replay when no log is present

* refactor(motor_failure_detector): Improve documentation

* fix(escCheck): check load per ESC not per motor function

This was already done in my original implementation. It supports checking multiple ESCs mapped to the same motor function individually. It's also consistent with other ESC checks that run for every ESC that reports telemetry.

* fix(motor_failure_detector): run update() per motor and consider individual telemetry timestamps

* fix(motor_failure_detector): simplify output interface to getters of actually used results

* fix(motor_failure_detector): inline what doesn't need to be separate

* fix(motor_failure_detector): make the bands independent and drop special cases

- Each trip band is now independent: a threshold <= 0 disables only that band. The undercurrent band no longer copies the overcurrent one.
- Drop the MOTFAIL_OFF/MOTFAIL_TIME parameter migration. The new parameters start at their defaults.
- Treat a non-finite current like a non-finite command (not evaluated, filter and debounce reset). No driver reports NaN current, so the path only existed for its test.
- Compute the residual as max(current, 0) - I_expected. Same as before, but written such that it's obvious: regeneration counts as 0A.
- Drop unnecessary trigger time parameter clamp to >= 0 before converting to unsigned microseconds, metadate already decalres that as out of range.
- Count each ESC sample once by its own timestamp in mfd_fit, like the motor_failure_detector.

* fix(motor_failure_detector): check all still considered online ESC telemetry

* fix(motor_failure_detector): declare all link dependencies

* fix(motor_failure_detector_tools): reuse log reading logic to reduce duplication

* fix(motor_failure_detector): replace reversible flag getting passed into the detector for separate handling

Having a NAN command already handles that.

* test(escChecks): add unit tests for load based failure detection

---------

Co-authored-by: Hamish Willee <hamishwillee@gmail.com>
Co-authored-by: Matthias Grob <maetugr@gmail.com>
Co-authored-by: Andrea Bernasconi <andrea.bernasconi@auterion.com>
2026-10-26 16:45:00 +01: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
Benjamin Cabé 8ace5a6253 fix(bench): reconnect to the board, not to another serial device (#29222)
After a reboot, the bench tests waited for the serial device of the board to come back, and, while it was gone, took the first other device of the same family, such as /dev/cu.usbmodem* on macOS. With a debug probe or another board connected, also a usbmodem device that stays while the board reboots, they connected to it, found no heartbeat, and reported that the board didn't come back. Only the devices of the family that weren't there before the reboot are now taken for the board, for a board that comes back under another name.

Assisted-by: Claude:opus-5.5

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-10-24 06:40:00 -08:00
Julian Oes 2573f54e89 build(ros2): update px4-ros2-interface-lib to bb49ef5 (#29357)
Picks up Auterion/px4-ros2-interface-lib#231, which makes the
integration test helper wait for command acks and retry. Commands
reach PX4 over a best-effort stream, and a lost command made
ModesTest.runModeTests hang until its 120 s timeout once in a while.

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

Signed-off-by: Julian Oes <julian@oes.ch>
2026-10-24 05:48:42 -08:00
Afonso Oliveira e579b6f4ba feat(boards): add AIFoundry Erbium Minion target
Add aifoundry_erbium_default for the Erbium Minion core, which runs on
the ET-platform emulator (erbium_emu) until silicon is available. The
target has no sensor or actuator drivers yet, so it boots the SIH
quadcopter airframe and keeps parameters and dataman in RAM.

The CI image has no RISC-V bare-metal toolchain, so the target is
excluded from the CI build matrix for now, as espressif_esp32 is.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Afonso Oliveira <afonso.oliveira707@gmail.com>
2026-10-23 22:42:28 +02:00
Benjamin Cabé 700452758a build(git): check only the submodules a build needs (#29095)
* build(git): check only the submodules a build needs

Tools/check_submodules.sh fetches every missing submodule, so a build that uses a handful of PX4 libraries still clones NuttX, the simulators and the middleware. Paths given as arguments now limit the check, and the configure step passes PX4_GIT_SUBMODULES when it is set. Builds that do not set it check all submodules as before. A path that is not a submodule, or a submodule the build uses but that is not checked out, stops the configure instead of failing later in the build.

Assisted-by: Claude:opus-5.5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>

* docs(dev_setup): document PX4_GIT_SUBMODULES

The submodule check can be limited to the submodules a build needs. List the variable next to GIT_SUBMODULES_ARE_EVIL, the other way to control the check.

Assisted-by: Claude:opus-5.5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>

* test(git): cover the submodule check limited to given paths

A second top-level submodule gives the tests one to leave out, so they check that paths given to check_submodules.sh limit both the fetch of missing submodules and the report of changed ones, and that a path that is not a submodule fails the check.

Assisted-by: Claude:opus-5.5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>

---------

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-10-23 12:14:57 -08:00
Benjamin Cabé fb29b85b63 fix(bench): download the logs that take longer than 4 s (#29220)
The logs were downloaded with process_ftp_reply() called in slices of 4.2 s, to send heartbeats between them and to detect a stall. pymavlink terminates the session when process_ftp_reply() times out, so any download longer than one slice was aborted at its first byte count, and reported as stalled at 0 bytes after 30 s: a 290 KB log over a serial link at 115200 baud, or a long log over a telemetry radio. The download is now driven in one call bounded by the budget, the idle detection of pymavlink detects a stall, and the heartbeats are sent from the progress callback.

Assisted-by: Claude:opus-5.5
2026-10-14 12:33:19 -06:00
Anil KircalialiandJacob Dahl 58bdfc324f ci(clang-tidy): analyse each source file once (#29019)
* ci(clang-tidy): analyse each source file once

* fix(clang-tidy): print a failure command that still reproduces

The failure line printed -p with the temporary deduplicated database, which is deleted when the script exits, so pasting the command failed to load a compilation database. Print the build's own database instead.

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

* fix(clang-tidy): remove the temporary directories on every exit

The deduplicated database directory and the -fix export directory were only removed on the normal path, so an exception such as an invalid -exclude regex or a missing clang-apply-replacements left them in $TMPDIR. Ctrl-C keeps its explicit removal because it ends with SIGKILL, which skips atexit.

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

---------

Co-authored-by: Jacob Dahl <dahl.jakejacob@gmail.com>
2026-10-11 14:34:07 -06:00
Jacob Dahl e1c28e2755 feat(ci): post the AI review as a verdict and one line per finding
The AI review on #29008 ran to about 900 words for two process gaps and three nits, and its "changes suggested" verdict came from the process gaps alone, so a maintainer could not tell whether the code needed anything. The PR now gets a verdict decided by code findings only and one sentence per posted finding. The evidence, the model's summary, the checklist and nits stay in the job summary, which the review links to.

Assisted-by: Claude:claude-opus-5-5
2026-10-10 13:58:21 +02: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
Jacob Dahl de52c98eff feat(cannode): bootloader update from the app and combined flash image (#28293)
* feat(bl_update): pet the watchdog during erase and program

CAN nodes start the IWDG in the bootloader, and nothing else pets it
while bl_update holds the scheduler lock.

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

* feat(nuttx): emit canbootloader to board extras and build bootloader+app image

canbootloader builds now write extras/<vendor>_<board>_bootloader.bin
like FMU bootloader builds do, which plugs CAN nodes into the existing
ROMFS / rc.board_bootloader_upgrade / jlink wiring. CAN node app builds
with that file also emit <config>_with_bootloader.bin (bootloader padded
to the app's ELF load address, followed by the CRC'd image) so a bare
board is flashed in one SWD step instead of two.

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

* feat(cannode): run rc.board_bootloader_upgrade at startup

The hook was only wired into the FMU rcS, so SYS_BL_UPDATE did nothing
on CAN nodes even with bl_update built in.

* feat(ark): enable bootloader update on CAN nodes

Ships the CAN bootloader in the app ROMFS so a node can rewrite it via
SYS_BL_UPDATE without SWD.

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

* docs(dronecan): bootloader update and combined image for CAN nodes

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

* build(ark): rebuild CAN node bootloaders from current main

The committed binaries predated the F412 chip-selection and linker fixes
and the NuttX 12.12 upgrade, so they no longer matched the source.

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

* feat(uavcannode): update the bootloader as soon as SYS_BL_UPDATE is set

Same approach as AP_Periph. Running the update on the next boot needed
two reboots and reported nothing over CAN: it ran before uavcannode
started, and the boot script printed "done" even when bl_update failed.
The node now flashes while running, skips an identical bootloader, and
the result reaches the flight controller through the existing log
message forwarding. A value left set from before boot is cleared rather
than acted on.

The flash routine moves into a library so uavcannode can call it.

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

* docs(dronecan): note that the combined CAN node image resets parameters

Found on the bench: the padding between bootloader and app covers the
parameter sectors, so every SWD flash of the combined image erases them.

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

* fix(nuttx): limit CAN bootloader extras and combined image to STM32

Every canbootloader build wrote its binary to the board's extras, so a
later nxp_ucans32k146 default or cyphal configure picked it up and failed
in prepend_bootloader.py: the S32K application loads at 0x6000, below
the 0x08000000 base the script and bl_update assume. CI only passed
because the canbootloader was built after both had configured.

Assisted-by: Claude:claude-fable-5-1

* fix(bl_update): pad the image before erasing and warn on every flash failure

The STM32F4 up_progmem_write() returns -EINVAL for an odd byte count,
which was only found out after sector 0 had been erased. An erase or
program failure also leaves the board without a bootloader, but only a
verify failure told the user to retry before rebooting.

Assisted-by: Claude:claude-fable-5-1

* fix(romfs): pack rc.board_bootloader_upgrade only where rcS runs it

CAN nodes with bl_update carried the script in their ROMFS although the
cannode rcS never sources it: uavcannode flashes the bootloader itself.

Assisted-by: Claude:claude-fable-5-1

* refactor(bl_update): move the flash routine to src/lib

The library lived under systemcmds, which is configured after drivers,
so uavcannode could only link it through a forward reference. The
watchdog is now selected by chip because the platform targets do not
exist yet when src/lib is configured.

Assisted-by: Claude:claude-fable-5-1

* docs(dronecan): the CAN bootloader is written to extras on STM32 only

Assisted-by: Claude:claude-fable-5-1
2026-10-06 15:42:33 -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 1ca4506927 feat(ci): show the cost of each AI review on the PR
The review footer now ends with the run's cost, model, number of model
calls and wall time, for example "Cost: $7.42 · Claude Opus 5.5 · 12
model call(s) · 22 min"; a refusal notice shows what was spent before
the refusal. The cost is Claude Code's own estimate at list prices,
which matched a recomputation from token counts on Bedrock. Making the
price visible on every review also discourages casual re-runs.

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 95e2802baf feat(ci): add the AI pull request review tool
Tools/ci/ai_review reviews a PR with Claude Code on Amazon Bedrock and
writes a pr-review artifact for pr-review-poster.py.

- Pipeline: gather (metadata, linked issues, commits, CI status, per-file
  patches, earlier comments), a reviewer pass returning line findings,
  PR-level findings and a contribution checklist, an independent
  validator pass per finding, and code-owned routing: inline only at high
  confidence, otherwise a before-merge list or a collapsed section. No PR
  is skipped for size; generated files are listed but not diffed.
- Trust: the PR is untrusted data. The agent runs --bare --restricted
  with read-only tools. Code it writes to check its math runs only in a
  px4-dev container (no network, no credentials, read-only checkout,
  gVisor in CI), and `harden` blocks the runner's metadata service first.
  Output containing a credential is never written.
- A model refusal produces no review and passes the provider's exact
  reason, category and request ID through.
- Models and per-role defaults live in models.json; models-check verifies
  access before switching.
- Process checks (tests, description, upgrade notes, docs) live in a
  CI-only prompt so the interactive skill stays lean.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-10-02 15:50:14 -07:00
Ramon Roche 5bcf3fc2ac feat(ci): add opt-in summary and supersede modes to the PR review poster
Two optional manifest fields for producers that need them:

- post_without_comments posts the summary as a COMMENT review even when
  there are no inline comments.
- supersede_previous replaces the body of the producer's earlier COMMENT
  review with a superseded note, keeping the old text collapsed, since
  GitHub cannot dismiss COMMENT reviews.

Both default to false, which is the behaviour clang-tidy relies on. Adds
the poster's first unit tests, including ones that pin the defaults.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-10-02 15:50:14 -07:00
PhilandHamish Willee b798249a61 feat(tools): add mavlink_serial_bridge.py reference bridge application (#28782)
* feat(tools): add mavlink_serial_bridge.py reference bridge application

Implements the SERIAL_CONTROL bridge application described in the Bridge Application section of docs/en/uart/serial_passthrough.md: it connects to the vehicle over MAVLink, exposes a virtual serial port (PTY), and translates traffic bidirectionally for any passthrough-capable port (TEL/GPS/ESC bitbang). Existing ESC configuration/flashing tools and GPS/RTK utilities can point at the exposed PTY without native MAVLink support.

Also updates serial_passthrough.md to reference this implementation instead of only describing the pattern in the abstract.

Signed-off-by: Phil-Engljaehringer <philipp.engljahringer@auterion.com>

* fix: add send_serial_control function

* docs: document mavlink_serial_bridge.py usage and limits

Explain what the bridge supports and how to run it safely: the example
connection string only listened on loopback, and --setup reboots the
flight controller with motor outputs disabled without saying so.

Restore the DShot ESC Serial Passthrough section, which was commented
out until a bridge existed, and update the v1.18 and main release notes
so v1.18 users know the bridge on main works with their firmware.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Hamish Willee <hamishwillee@gmail.com>

* fix: removed duplicated port-map

* fix: send_serial_control adjust padding

* fix: set target_system and target_component only once

* fix: implemented changes requested by alex

* fix: implemented changes requested by hamish

* fix: avoid indefinite loop waiting for heartbeat

* fix: no chunking in send function needed

* fix: add lock and avoid trailing 0x00 sent on shutdown

* docs: explained SWITCH <device_id> feature in docs

---------

Signed-off-by: Phil-Engljaehringer <philipp.engljahringer@auterion.com>
Signed-off-by: Hamish Willee <hamishwillee@gmail.com>
Co-authored-by: Hamish Willee <hamishwillee@gmail.com>
2026-10-02 10:37:42 +02: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
0462e3a31e fix(gz_bridge): use the corrected Gazebo magnetometer frame and units (#28877)
* fix(gz_bridge): use the corrected Gazebo magnetometer frame and units

The Gazebo magnetometer system defaults to a legacy mode: it computes the
field in NED, places it into the ENU world frame without converting, and
reports gauss. The bridge swapped body axes to compensate, but no body-axis
swap undoes a mirrored world-frame field at every attitude. At the default
world location this left the heading about 6 deg off on the ground.

gz-sim 8.6 added use_units_gauss and use_earth_frame_ned (gz-sim#2460).
Turn both off in server.config, so the field is in tesla and physically
correct in the sensor's FLU frame, and convert it like the IMU: FLU -> FRD,
tesla -> gauss.

Other ways of starting gz (standalone mode, gz-sim < 8.6, worlds with their
own systems) still deliver the legacy output. Detect it from the field
magnitude, keep the previous mapping for it and warn once.

Needs the x500 (and other) model magnetometer noise in tesla, see
PX4-gazebo-models.

* docs(gz_bridge): describe the legacy magnetometer frame accurately

NED components on ENU axes is a 180 degree rotation about the horizontal
axis between north and east, not a mirror.

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

* build(simulation): bump gz models for magnetometer noise in tesla

The gz_bridge server.config now runs the Magnetometer system in tesla, so
the models need their noise in tesla too, otherwise it is 1 gauss and PX4
refuses to arm. Also pulls in the advanced_plane parachute plugin and the
default world elevation fix.

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

---------

Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>
Co-authored-by: matteo <197973584+megavedl@users.noreply.github.com>
Co-authored-by: Jacob Dahl <dahl.jakejacob@gmail.com>
2026-09-30 16:45:43 -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
Daniel Buleandră 5f28bf9a86 feat(nsh via dronecan): Implement nsh via dronecan (#28403)
Queue unwritten stdin instead of dropping it when a request is larger
than the pipe can take at once, and drain the queue without blocking
the CAN work queue. Only stdin needs to stay nonblocking (it's written
from that work queue); stdout reads stay blocking, gated on FIONREAD,
like the mavlink shell already does.

Report a shell session that has exited as an explicit error instead of
silently swallowing EPIPE and returning empty output. Surface that
error in the Python client as well.

Flush the queued stdin on idle polls too, not just when new input
arrives, since an idle poll is all the client sends while the user
isn't typing. Only redirect fd 0/1 for the child once both stdio
backups succeeded, so a dup() failure can't leave the node's own
stdin/stdout pointing into the shell pipes. Distinguish EAGAIN (retry
later) from EPIPE (never will succeed) when flushing queued stdin, so
a dead shell doesn't hold the queue forever refusing new input.

Only compile the shell sources when CONFIG_UAVCANNODE_COMMAND_SHELL is
enabled, matching how every other optional uavcannode feature is
gated, instead of pulling nshlib into every board's image. Detect a
dead shell task with nxsched_get_tcb(), the same lookup top/cpuload.cpp
use, instead of a POSIX-only helper with no NuttX implementation. Fix
GetNodeInfo name decoding in the client to tolerate non-UTF-8 bytes
instead of crashing the scan.
Signed-off-by: danielbuleandra <daniel.buleandra@auterion.com>
2026-09-30 10:34:19 +02: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 89549434e8 ci(usb-ids): add a checker for board USB IDs against the Dronecode registry
Boards that ship the Dronecode USB vendor ID 0x3643 must use a product
ID allocated in the Dronecode/usb-ids registry, and nothing in the tree
enforces that. A board reusing another board's PID, or picking an
unallocated one, becomes ambiguous to host tools that identify boards
by VID/PID.

The contract is the registry mapping: a defconfig under
boards/<vendor>/<board>/ using VID 0x3643 must use a registered PID
whose px4_board is exactly <vendor>/<board>. The USB vendor string is
deliberately not checked, since the registry does not govern it. Boards
on other vendor IDs are ignored.

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 b8d4f0b637 fix(bench): pin the autopilot component instead of the first heartbeat
Some boards heartbeat from more than one component on the same sysid. An
FMUv6X-RT on v1.17 sends HEARTBEAT from compid 1 (PX4) and from compid 236
with autopilot=MAV_AUTOPILOT_INVALID. connect() accepted the first
heartbeat from anyone and left target_component at pymavlink's default of
0, so param and mission requests went out as broadcast, the other
component could answer, and param_stress mixed its PARAM_VALUE stream
(index, count, values) into the autopilot's download.

connect() now waits for a heartbeat whose autopilot is not
MAV_AUTOPILOT_INVALID and pins target_system/target_component to its
source. pymavlink only latches target_system once and never sets the
component, so the pin holds for the life of the connection. The
wait_heartbeat() helper shares that filter and, once pinned, only counts
the pinned component; wait_reconnect() goes through connect() and gets
the same behavior after a reboot.

PARAM_VALUE replies in px4bench.params, param_stress and link_forwarding
are filtered to the pinned component, and flight_mission uses the pinned
component for MAVFTP and the armed/disarmed heartbeat checks instead of a
hardcoded 1.

Diagnosed by @farhangnaderi in #27852.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-09-28 11:47:52 -07:00
Ramon Roche f0f4612928 fix(bench): explain used-param semantics in the param_exists failure
The 1.17 run in #27840 read 'SDLOG_UTC_OFFSET not found in downloaded
set' as the parameter not existing on that release. It does exist there;
the download itself was the anomaly (19 params total, where a booted
board reports hundreds, since the autopilot lists used params only).
Name the downloaded count and that semantics in the failure so the next
tiny param set is diagnosed as a degraded session, not a missing param.

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-09-28 11:47:52 -07:00
Ramon Roche 5dc6742bfa fix(bench): require pymavlink >= 2.4.42 for the mavftp module
log_transfer crashed with a raw ImportError on setups whose pymavlink
predates the mavftp module (#27840). mavftp first shipped in pymavlink
2.4.42, so raise the floor in pyproject.toml, Tools/setup/requirements.txt
and the README, and guard the import in px4bench.ftp so an old install
reports a clear upgrade hint instead of a traceback. Both mavftp
consumers now import it through the guard.

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-09-28 11:47:52 -07:00