Commit Graph

49610 Commits

Author SHA1 Message Date
Balduin 5bf3625a74 test(tecs): factor out and decrease numerical tolerance 2026-04-24 10:28:55 +02:00
Balduin 78bb707dab test(tecs): improve sim stats collection 2026-04-24 10:06:09 +02:00
Balduin 796c3051de test(tecs): probably tmp: output sim result to csv
- Give a directory in env var TECS_TEST_LOG_DIR
 - For each test a CSV file with column names in first row will be made
2026-04-24 09:37:26 +02:00
Balduin 6f941cffc9 test(tecs): airspeed dip and bump tests to capture airspeed recovery performance 2026-04-24 09:37:22 +02:00
Balduin 2e850a631f test(tecs): fix CI test build by including stubs for work_queue functions 2026-04-24 09:15:12 +02:00
Balduin 2000f8794d test(tecs): fix CI warnings
- correct rounding with lround
 - no underscores in test names
2026-04-24 09:15:06 +02:00
Balduin 1e5569ec83 test(tecs): tighten airspeed tolerance
now that tests all pass we lower it. starts failing between 0.07 and
0.08, which is solidly below the noise floor on real systems

and other small fixes
2026-04-24 09:13:43 +02:00
Balduin 2556b33e07 test(tecs): add closed-loop unit tests for TECSControl
Purpose: define, pinpoint and fix basic internal consistency issues.
TECS should be able to handle this case (zero noise or model mismatch)
almost perfectly.

Some of them fail currently, will come up with fixes afterwards.

The model has 2 states (airspeed, height) and 2 inputs (throttle and
pitch). The dynamics correspond exactly to the model assumed in TECS and
the pitch input applies immediately without any inner dynamics.

This model is simulated at 50Hz, and the test harness allows changing
tecs parameters, and airspeed / altitude setpoints. It also records the
maximum airspeed error over each simulation run.
2026-04-23 17:25:00 +02:00
PX4BuildBot 3ac9b267ca docs: auto-sync metadata [skip ci]
Co-Authored-By: PX4 BuildBot <bot@px4.io>
2026-04-23 13:45:26 +00:00
Balduin f8bb3f00df feat(sensor_airspeed_sim): Implement off, stuck, and wrong airspeed failure
- wrong and off equal to simulator_mavlink implementation
     - but wrong is over timescale of 10s rather than 1s by default to
       make it harder for innovation check to flag (closer to icing)
 - stuck will just keep the last value before injecting the failure
2026-04-23 15:37:55 +02:00
Balduin 4b34cb8834 refactor(sensor_airspeed_sim): remove previous airspeed failure implementation 2026-04-23 15:37:55 +02:00
PX4BuildBot 46142b34e3 docs: auto-sync metadata [skip ci]
Co-Authored-By: PX4 BuildBot <bot@px4.io>
2026-04-23 04:23:41 +00:00
Gennaro Guidone 1281dbd8ff docs(safety): add altitude loss detection failsafe documentation (#27104) 2026-04-23 14:16:32 +10:00
PX4BuildBot 022f0119c0 docs: auto-sync metadata [skip ci]
Co-Authored-By: PX4 BuildBot <bot@px4.io>
2026-04-23 01:57:52 +00:00
Jacob Dahl c459caaa2a docs(peripherals): add On-Screen Display (OSD) page (#27134) 2026-04-23 11:50:09 +10:00
Eric Katzfey fdd00fbd31 feat(boards/modalai/voxl2): Add timeout to voxl-reset-slpi command in service file and update package dependencies as needed 2026-04-22 17:37:23 -07:00
PX4BuildBot c89404ca61 docs: auto-sync metadata [skip ci]
Co-Authored-By: PX4 BuildBot <bot@px4.io>
2026-04-22 22:38:10 +00:00
Julian Oes 7b23a2e405 fix(boards): auterion fmu-v6x zenoh free flash for logger rework
The logger rework grows text slightly, pushing the already
flash-constrained zenoh variant over budget. Drop a handful of
optional features to recover the needed headroom:

- osd_msp_osd (MSP OSD, niche)
- actuator_test (bench diagnostic)
- fw_autotune_attitude_control / mc_autotune_attitude_control
  (tuning can be done on a default build)
2026-04-23 10:30:14 +12:00
Julian Oes 2df92cc331 feat(boards): airbrainh743 tune logger for 128 MB W25N flash
Replace the old SDLOG_DIRS_MAX=3 + larger-buffer override with the
new rotation-based tuning: SDLOG_MAX_SIZE=40 caps each log file at
40 MB so a handful of recent logs fit, and SDLOG_ROTATE=95 lets logs
fill up to 95% of the 128 MB volume.

Also set COM_ARM_SDCARD=0 (no SD on this board) and
SYS_DM_BACKEND=1 so missions are stored in RAM.
2026-04-23 10:30:14 +12:00
Julian Oes be39ec49e5 feat(boards): kakuteh7v2 tune logger for 128 MB W25N flash
Replace the old SDLOG_DIRS_MAX=3 + larger-buffer override with the
new rotation-based tuning: SDLOG_MAX_SIZE=40 caps each log file at
40 MB so a handful of recent logs fit, and SDLOG_ROTATE=95 lets logs
fill up to 95% of the 128 MB volume.

Drop the BOARD_SMALL_FLASH_LOGGING define from board_config.h; the
logger no longer keys off a per-board compile flag.
2026-04-23 10:30:14 +12:00
Julian Oes fa601fa5c1 feat(boards): kakuteh7mini add W25N NAND flash support with littlefs
The kakuteh7mini ships with a W25N01GV (1Gbit/128MB) SPI NAND flash on
SPI1, but the board init was treating SPI1 as an MMC/SD slot and the
W25N driver was not enabled. Enable the chip and use it for logging:

- spi.cpp: register the device as SPIDEV_FLASH(0) instead of SPIDEV_MMCSD(0)
- init.c: initialize the W25N MTD driver, register /dev/mtd0, mount
  littlefs at /fs/flash with autoformat, and print the flash geometry
  on boot for verification.
- nuttx defconfig: enable CONFIG_MTD_W25N, CONFIG_FS_LITTLEFS,
  SPI1 DMA + DMAMUX1, drop the unused RAMTRON config.
- board_dma_map.h: define DMAMAP_SPI1_RX/TX for the SPI1 DMA channels.
- default.px4board: set CONFIG_BOARD_ROOT_PATH to /fs/flash.
- rc.board_defaults: drop the SDLOG_BACKEND=0 override that was
  disabling logging entirely, drop COM_ARM_SDCARD (no SD card), and
  tune SDLOG_MAX_SIZE=40 / SDLOG_ROTATE=95 to keep a few recent logs
  in the 128 MB flash.
2026-04-23 10:30:14 +12:00
Julian Oes 174a6aab6f feat(mklittlefs): add command to format littlefs filesystems
Add an NSH command to format a device with littlefs, analogous to
mkfatfs for FAT filesystems. The command unmounts the mount point,
then remounts with forceformat to format and mount in one step.

Enable the command on boards that use littlefs as primary storage
(airbrainh743 and kakuteh7v2), and document it in the airbrainh743
flight controller page as a recovery procedure for a corrupted
flash filesystem.

Usage: mklittlefs /dev/mtd0 /fs/flash
2026-04-23 10:30:14 +12:00
Julian Oes f9fdda1a29 feat(logger): rework log rotation and cleanup
Make the logger practical on small flash storage (e.g. 128 MB W25N
NAND) while keeping the existing SD-card behaviour sensible.

- Move cleanup from boot to log start so logs can be downloaded via
  MAVLink FTP before deletion.
- Delete individual .ulg files (oldest first) instead of whole
  directories, prioritising the naming scheme not currently in use
  (session dirs vs date dirs).
- Add SDLOG_MAX_SIZE (new, default 1024 MB): maximum size of a single
  log file. When reached, the log rotates to a new file. The value is
  also reserved as headroom in the cleanup threshold.
- Add SDLOG_ROTATE (new, default 90): maximum disk usage percentage.
  Cleanup guarantees (100 - SDLOG_ROTATE)% free at all times, even
  during writing of a new log file. 0 disables space-based cleanup,
  100 allows filling the disk.
- Repurpose SDLOG_DIRS_MAX as an orthogonal directory-count cap
  (default 0 = disabled). Useful for capping log usage by count
  independent of disk size, e.g. in SITL.
- Drop the implicit ~300 MB free-space floor that used to fire even
  with SDLOG_DIRS_MAX=0; space is now governed entirely by
  SDLOG_ROTATE + SDLOG_MAX_SIZE.
- Split pure parsing helpers into util_parse.{h,cpp} and add unit
  tests (loggerUtilTest.cpp).
- Simplify get_log_time to rely on clock_gettime (set by the GPS
  driver); safer string handling in directory parsing.
- Reset _total_written in LogFileBuffer::reset() so callers reading
  get_total_written() between stop and start don't see stale counts.

Sponsored by CubePilot.
2026-04-23 10:30:14 +12:00
radodim 381149fb01 build(simulation): depend on gz-harmonic for SITL deb (#27178)
Build all targets / Scan for Board Targets (push) Has been cancelled
Checks / Gate Checks [check_format] (push) Has been cancelled
Checks / Gate Checks [check_newlines] (push) Has been cancelled
Checks / Gate Checks [module_documentation] (push) Has been cancelled
Checks / Gate Checks [shellcheck_all] (push) Has been cancelled
Checks / Gate Checks [validate_module_configs] (push) Has been cancelled
Checks / Unit Tests (push) Has been cancelled
Static Analysis / Clang-Tidy (push) Has been cancelled
MacOS build / build (push) Has been cancelled
Ubuntu environment build / Build and Test (ubuntu:22.04) (push) Has been cancelled
Ubuntu environment build / Build and Test (ubuntu:24.04) (push) Has been cancelled
Container build / Set Tags and Variables (push) Has been cancelled
Failsafe Simulator Build / build (failsafe_web) (push) Has been cancelled
FLASH usage analysis / Analyzing px4_fmu-v5x (push) Has been cancelled
FLASH usage analysis / Analyzing px4_fmu-v6x (push) Has been cancelled
ITCM check / Checking nxp_mr-tropic (push) Has been cancelled
ITCM check / Checking nxp_tropic-community (push) Has been cancelled
ITCM check / Checking px4_fmu-v5x (push) Has been cancelled
ITCM check / Checking px4_fmu-v6xrt (push) Has been cancelled
MAVROS Tests / MAVROS Mission (push) Has been cancelled
MAVROS Tests / MAVROS Offboard (push) Has been cancelled
Python CI Checks / build (push) Has been cancelled
ROS Integration Tests / build (push) Has been cancelled
ROS Translation Node Tests / Build and test [humble] (push) Has been cancelled
ROS Translation Node Tests / Build and test [jazzy] (push) Has been cancelled
SITL Tests / Testing PX4 iris (push) Has been cancelled
Build all targets / Seed [${{ matrix.chip_family }}] (push) Has been cancelled
Build all targets / Build [${{ matrix.runner }}][${{ matrix.group }}] (push) Has been cancelled
Build all targets / Upload Artifacts (push) Has been cancelled
Container build / Build Container (amd64) (push) Has been cancelled
Container build / Build Container (arm64) (push) Has been cancelled
Container build / Deploy To Registry (push) Has been cancelled
FLASH usage analysis / Publish Results (push) Has been cancelled
Handle stale issues and PRs / stale (push) Has been cancelled
Fuzzing / Fuzzing (push) Has been cancelled
* build(simulation): depend on gz-harmonic meta-package for SITL deb

* build(simulation): refresh apt lists before installing px4-gazebo .deb
2026-04-22 11:42:30 -07:00
Ramon Roche 540218857a ci(clang-tidy): drop 'file not found' diagnostics from PR review
These fire when clang-tidy analyzes a header whose including TU is not
in the active compile_commands.json (e.g. board-specific NuttX headers
against the SITL clang build), producing spurious line-anchored review
comments on every new-board PR. Real missing includes are caught by the
build_all_targets matrix, which fails the build loudly. Filter the
class of finding at the producer so it never reaches the poster.

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-04-22 10:25:26 -07:00
Ramon Roche 947a456036 ci(dev_container): drop branch push trigger on release branches
Pushes to stable/beta/release/** only move when a release is cut, and
that release was already built by the matching v* tag push moments
earlier. The subsequent branch push reruns the arm64+amd64 matrix
(~8 min) to produce the identical image digest. Registry push is
already gated on refs/tags/, so the second run is pure waste.

Drop those branches from on.push; keep main (regular development
pushes) and the v* tag trigger (the authoritative release trigger).
workflow_dispatch remains available for manual rebuilds.

Fixes #27170

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-04-22 10:01:33 -07:00
Ramon Roche 1df16f39a8 ci(compile_ubuntu): only run on push to main
compile_ubuntu.yml is a PR-focused Ubuntu container smoke check. On
stable, beta, and release/** branches it duplicates build_all_targets.yml,
which already covers those branches with the full board matrix and the
S3 uploads. Drop stable, beta, and release/** from the push branch list
so it matches the trigger pattern used by compile_macos.yml, checks.yml,
and clang-tidy.yml.

Fixes #27171

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-04-22 10:01:07 -07:00
PX4BuildBot 1642b85611 docs: auto-sync metadata [skip ci]
Co-Authored-By: PX4 BuildBot <bot@px4.io>
2026-04-22 06:26:46 +00:00
Ramon Roche 3efdbe9fd3 docs(sim_sih): link Hawkeye visualizer, add stub page (#27159)
* docs(sim_sih): link Hawkeye visualizer, add stub page

Replaces jMAVSim display-only mode references in the SIH page with Hawkeye,
which is purpose-built for this role and actively maintained. The 3D
visualization section now covers the hawkeye command, the port alignment
with SIH (UDP 19410), and links out to the full Hawkeye documentation.

Adds a short sim_hawkeye/index.md stub covering what Hawkeye is, install
on macOS and Linux, and basic SIH usage. Everything else (multi-vehicle,
ULog replay, HUD modes, CLI reference) lives at px4.github.io/Hawkeye
and is linked from the stub, so PX4 docs don't carry the maintenance
burden of two parallel sources.

Also updates the port reference table: UDP 19410 is now labeled
"Hawkeye visualizer" instead of "jMAVSim display-only", and adds the
page to SUMMARY.md nested under SIH Simulation.

* docs(update): subedit

---------

Co-authored-by: Hamish Willee <hamishwillee@gmail.com>
2026-04-22 16:19:56 +10:00
PX4BuildBot 6c15aadbb1 docs: auto-sync metadata [skip ci]
Co-Authored-By: PX4 BuildBot <bot@px4.io>
2026-04-22 05:58:46 +00:00
Beniamino Pozzan 238840a64d docs(ros2): update docs for Zenoh, ROS 2 and msgs sync (#26761) 2026-04-22 15:50:51 +10:00
PX4BuildBot 3775aa8e65 docs: auto-sync metadata [skip ci]
Co-Authored-By: PX4 BuildBot <bot@px4.io>
2026-04-22 00:30:58 +00:00
Julian Oes 0d91b428d6 fix(ekf2): break unbounded recursion
fuseDirectStateMeasurement() ends with a call to constrainStateVariances(),
which iterates every state and, for any whose variance has grown past its
limit, calls fuseDirectStateMeasurement() again to apply a corrective
fuse. That inner call then runs its own constrainStateVariances(),
repeating the loop.

Call chain:

  fuseDirectStateMeasurement                      ekf_helper.cpp:1030
   `- constrainStateVariances                     ekf_helper.cpp:1085
       `- constrainStateVar                       covariance.cpp:290
           `- fuseDirectStateMeasurement          covariance.cpp:302
               `- constrainStateVariances              (recursion)
                   `- ...

Under normal operation the P(i,i) > max branch is rarely taken and the
recursion stays shallow, however, while doing unrelated overnight testing
we saw a hard-fault with TCB corruption, presumably due to a stack overflow.

The trace pointed to fuseDirectStateMeasurement where Claude detected
the recursive call.

This fix breaks the recursion by gating the constrainStateVariances()
call on a new parameter, defaulting to true for existing callers.
constrainStateVar() passes false when it re-enters the fuse from the
constraint path, capping the worst-case recursion depth at 2.
2026-04-21 17:23:34 -07:00
Ramon Roche dcedef6168 build(sim): resolve SITL runtime deps via .deb Depends
The px4-gazebo .deb already declares OpenCV and gstreamer core library
deps via dpkg-shlibdeps, but Dockerfile.gazebo uses dpkg -x which
bypasses resolution. Switch to apt install ./px4-gazebo_*.deb so Depends
are resolved automatically.

Add the 5 gstreamer plugin packages (plugins-base/good/bad/ugly/libav)
to CPACK_DEBIAN_PACKAGE_DEPENDS since they're loaded at runtime via
gst_element_factory_make() and cannot be detected by shlibdeps.

Apply the same apt-install pattern to Dockerfile.sih so both images
build consistently.

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-04-21 15:37:48 -07:00
PX4BuildBot f0eeda5a9e docs: auto-sync metadata [skip ci]
Co-Authored-By: PX4 BuildBot <bot@px4.io>
2026-04-21 21:43:18 +00:00
Vuk-SFL f7f9557eac fix(zenoh): Zenoh various minor fixes and improvements regarding failed setup (#27147)
* fix(zenoh) : zenoh_subscirber / zenoh_publisher: print() method checks if key expression exists before printing

* fix(zenoh) : added cleanupSession method, called when setup steps fail and when module is closing
2026-04-21 13:35:00 -08:00
abhijithcv 0571bccda3 fix(imxrt): update arch defaults to match v6x 2026-04-21 22:26:04 +02:00
PX4BuildBot b1246bd724 docs: auto-sync metadata [skip ci]
Co-Authored-By: PX4 BuildBot <bot@px4.io>
2026-04-21 14:57:45 +00:00
Peter van der Perk 7164d9c104 build(msg): idlc disable unsused features and enable ccache
We only need the idlc tool from cyclonedds thus try disable all
unused features as possible. To speed up compilation we disable
lto and enable ccache.
2026-04-21 07:49:05 -07:00
PX4BuildBot 14529d6af3 docs: auto-sync metadata [skip ci]
Co-Authored-By: PX4 BuildBot <bot@px4.io>
2026-04-21 08:50:19 +00:00
gguidone d8d3bee738 docs(update): fix Remote ID failsafe trigger description 2026-04-21 10:42:57 +02:00
Hamish Willee c55267107a docs(update) - subedit 2026-04-21 10:42:57 +02:00
gguidone 4fee468f3f docs: add Remote ID in-flight failsafe documentation
Update safety.md, remote_id.md, and releases/main.md to document the extended COM_ARM_ODID parameter  and the new in-flight failsafe behaviour that will be introduced in PX4 v1.18.
2026-04-21 10:42:57 +02:00
gguidone 6e980423e5 feat(commander): add Remote ID in-flight failsafe
Extend COM_ARM_ODID into a unified arming + in-flight failsafe parameter (0 = Disabled, 1 = Warning, 2 = Return, 3 = Land, 4 = Terminate)

Values >= 2 block arming and trigger the configured action if Remote ID
is lost while airborne.
2026-04-21 10:42:57 +02:00
PX4BuildBot fa5381ab90 docs: auto-sync metadata [skip ci]
Co-Authored-By: PX4 BuildBot <bot@px4.io>
2026-04-21 07:17:25 +00:00
bresch ca1fdb24af fix(fw rate ctrl): override reset_integral when in acro mode 2026-04-21 09:09:41 +02:00
PX4BuildBot 3d19221188 docs: auto-sync metadata [skip ci]
Co-Authored-By: PX4 BuildBot <bot@px4.io>
2026-04-21 05:21:22 +00:00
Jacob Dahl 68083e6ba8 test(pid): add regression test for derivative-on-measurement sign (#27153)
PIDTest never exercised the D path with a non-zero gain, which let the
sign error fixed in #27140 slip through. Add a D-only test that asserts
the output opposes a known feedback ramp.

Fails on main, passes with #27140.
2026-04-20 21:07:47 -08:00
Nathaniel-hl 1a689214cd fix(navigator): fix navigator_mission_item origin field assignment (#27146)
* fix:use _gps_pos.timestamp for validity check in geofence_breach_check

navigator: use _gps_pos.timestamp for validity check in geofence_breach_check
Co-Authored-By: Drone-Lab <151698793+drone-lab@users.noreply.github.com>

* Revert "fix:use _gps_pos.timestamp for validity check in geofence_breach_check"

This reverts commit aa9f557536.

* fix(navigator): fix navigator_mission_item origin field assignment

Co-Authored-By: Drone-Lab <151698793+drone-lab@users.noreply.github.com>

---------

Co-authored-by: Drone-Lab <151698793+drone-lab@users.noreply.github.com>
2026-04-20 21:07:16 -08:00
Eurus bf1e6ec208 ekf2: fix external heading accuracy-to-variance conversion for yaw reset (#27143)
Co-authored-by: AkaiEurus <1826983968@qq.com>
2026-04-20 21:06:15 -08:00