48631 Commits

Author SHA1 Message Date
Ramon Roche
d74007dc87 clang-tidy: exclude NuttX-only drivers and emscripten from SITL analysis
These files depend on platform headers (px4_platform/gpio/mcp.hpp,
device::I2C, emscripten/emscripten.h) that are unavailable in the
SITL/clang build, causing clang-tidy to report compiler errors:

- src/lib/drivers/mcp_common (NuttX GPIO)
- src/drivers/gpio (MCP23009, MCP23017)
- src/lib/drivers/smbus (I2C bus driver)
- src/modules/commander/failsafe/emscripten (emscripten SDK)

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-12 21:20:27 -08:00
Ramon Roche
47b3f5f6f9 docker-entrypoint.sh: consolidate startup output into single useful line
Replace the two separate echo lines ("Starting" and "(arch)") with a
single line showing architecture and UTC timestamp:

  [docker-entrypoint.sh] aarch64 | 2026-02-09T15:23:45Z

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-12 21:20:27 -08:00
Ramon Roche
6d8441dc89 docker_run.sh: modernize image and clean up stale CI references
Update the local Docker convenience script to use the unified
px4io/px4-dev image instead of the retired per-toolchain images
(px4-dev-clang, px4-dev-simulation-bionic).

Usage:
  ./Tools/docker_run.sh make px4_sitl_default
  ./Tools/docker_run.sh make tests TESTFILTER=ULogMessages
  PX4_DOCKER_REPO="px4io/px4-dev:custom" ./Tools/docker_run.sh make px4_fmu-v6x_default

Changes:
- Default to px4io/px4-dev:v1.17.0-beta1, remove conditional image
  guessing for clang/tests targets
- Remove stale env passthrough (Travis CI, AWS, Codecov, Coveralls)
- Keep CCACHE_DIR and sanitizer flags (PX4_ASAN/MSAN/TSAN/UBSAN)
- Fix $PWD shadowing by renaming to SCRIPT_DIR
- Use "$@" instead of "$1 $2 $3" for proper argument forwarding

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-12 21:20:27 -08:00
Ramon Roche
f29afe1342 logger: expand ULog unit tests to cover all message types
Rename ULogMessageInfoTest to ULogMessagesTest and add struct-level
coverage for every message type in the ULog spec:

- File header: magic bytes, size, field offsets
- Flag Bits ('B'): size, field offsets, flag masks
- Format ('F'): size, serialization
- Info ('I'): string, int32_t, and float value layouts
- Info Multiple ('M'): string layout, continuation flag, field offsets
- Parameter ('P'): int32_t and float value layouts
- Default Parameter ('Q'): size, type bits, field offsets
- Subscription ('A'): size, field offsets, serialization
- Unsubscription ('R'): size, serialization
- Data ('D'): size, field offset
- Logging ('L'): size, field offsets, serialization
- Logging Tagged ('C'): size, field offsets
- Sync ('S'): size, magic bytes
- Dropout ('O'): size, default msg_size, serialization
- Message header: size, field offsets, ULOG_MSG_HEADER_LEN
- Enum values: all 13 ULogMessageType codes

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-12 21:20:27 -08:00
Ramon Roche
9849d90877 gps: add null check for path in GPS constructor
Guard the strncpy call with a null check to prevent undefined behavior
if the constructor is ever called with a null path pointer.

Fixes clang-analyzer-core.NonNullParamChecker diagnostic.

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-12 21:20:27 -08:00
Ramon Roche
497704f3b9 fw_mode_manager: pass FigureEightPatternPoints by const reference
The 48-byte struct (6 Vector2f) is only read inside initializePattern,
so passing by value creates an unnecessary copy.

Fixes performance-unnecessary-value-param clang-tidy diagnostic.

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-12 21:20:27 -08:00
Ramon Roche
b60aa5dd2b ekf2, fw_mode_manager, fw_rate_control: remove unused using declarations
Remove using-declarations for math::constrain, math::max, and
math::min that are never used — all call sites use the fully-qualified
form (e.g. math::constrain()).

Fixes misc-unused-using-decls clang-tidy diagnostic.

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-12 21:20:27 -08:00
Ramon Roche
5d151c54a4 flight_mode_manager: call direct parent instead of grandparent
FlightTaskManualAcceleration and FlightTaskOrbit both inherit from
FlightTaskManualAltitudeSmoothVel but were calling FlightTask and
FlightTaskManualAltitude respectively, skipping the intermediate
parent's overrides (smoothing velocity init, parameter chain).

Fix the DEFINE_PARAMETERS_CUSTOM_PARENT macro argument and the
activate() call to use FlightTaskManualAltitudeSmoothVel.

Fixes bugprone-parent-virtual-call clang-tidy diagnostic.

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-12 21:20:27 -08:00
Ramon Roche
83a4d648e3 logger: copy null terminator in write_info memcpy
clang-tidy flags the memcpy of vlen bytes as
bugprone-not-null-terminated-result because the destination buffer
region is left unterminated in memory.

Copy vlen + 1 bytes (including the source null terminator) so the
buffer is null-terminated in memory. The ULog msg_size is not
incremented for the extra byte — the null sits in the struct's
key_value_str padding and is never written to the log file, preserving
the ULog wire format which does not include a null terminator for
string values.

The bounds check (vlen < sizeof(msg) - msg_size) guarantees at least
one byte of headroom beyond vlen, so vlen + 1 is always within the
struct.

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-12 21:20:27 -08:00
Ramon Roche
0646fa6c9d logger: add unit test for ULog INFO message serialization
Add a gtest that validates the exact binary layout of INFO and
INFO_MULTIPLE messages against the ULog spec. This exercises the same
packing logic as write_info/write_info_multiple and will catch any
accidental changes to the wire format (e.g. including a null terminator
in msg_size).

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-12 21:20:27 -08:00
Ramon Roche
d9b3e48ec5 CI: improve clang-tidy workflow naming and use standard cache actions
Rename workflow to "Static Analysis" with job name "Clang-Tidy" for
clearer GitHub Checks UI. Use Title Case action-verb step names.
Switch from runs-on/cache to actions/cache since the runs-on Magic
Cache sidecar transparently handles S3 backing.

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-12 21:20:27 -08:00
Ramon Roche
29fefeeada CI: fix ccache key to use branch name instead of merge ref
github.ref_name resolves to '26367/merge' for pull_request events,
causing cache misses. Use github.head_ref (PR source branch) with
fallback to github.ref_name for push events.

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-12 21:20:27 -08:00
Ramon Roche
618a6aa98f CI: add explicit permissions block to clang-tidy workflow
Set minimal permissions (contents: read) as flagged by CodeQL.

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-12 21:20:27 -08:00
Ramon Roche
8a007d38e7 CI: split ccache into restore/save so cache persists on failure
Use separate cache/restore and cache/save steps with if: always()
on the save step, matching the build_all_targets pattern.

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-12 21:20:27 -08:00
Ramon Roche
e831c66ae1 CI: add ccache and S3 caching to clang-tidy workflow
- Switch from addnab/docker-run-action to native container directive
- Use runs-on 16-core runner with S3 cache (extras=s3-cache)
- Add ccache setup matching build_all_targets pattern
- Run clang-tidy with -j16 to leverage all cores

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-12 21:20:27 -08:00
Ramon Roche
021eee0c5c CI: use 16-core runs-on runner for clang-tidy workflow
The free GitHub runner (4 vCPUs) takes ~22 minutes. Switch to a
16-core runs-on runner and bump parallelism to -j16 to reduce
clang-tidy analysis time.

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-12 21:20:27 -08:00
Ramon Roche
385450ca37 CI: pin clang-tidy workflow to px4-dev:v1.17.0-beta1 container
Pin the container image to v1.17.0-beta1 which includes clang-tidy 18
and all required clang dependencies pre-installed. This removes the
need to install clang-tidy via apt on each workflow run.

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-12 21:20:27 -08:00
Ramon Roche
23c9af20da clang-tidy: disable new checks for v18 compatibility
Update .clang-tidy configuration to maintain compatibility with
clang-tidy 18 in the new px4io/px4-dev:v1.17.0-alpha1 container.

The previous CI container used clang-tidy 6.0 (2018) with ~213 checks.
The new container has clang-tidy 18 (2024) with ~537 checks - adding
~324 new checks that would fail without configuration changes.

This commit disables the new checks to preserve the existing code
quality baseline. The disabled checks can be evaluated and enabled
incrementally in future PRs as the codebase is updated to comply.

New checks disabled (partial list):
- bugprone-assignment-in-if-condition
- bugprone-casting-through-void
- bugprone-multi-level-implicit-pointer-conversion
- cppcoreguidelines-avoid-do-while
- cppcoreguidelines-avoid-goto
- cppcoreguidelines-avoid-non-const-global-variables
- misc-definitions-in-headers
- misc-header-include-cycle
- misc-no-recursion
- modernize-macro-to-enum
- modernize-type-traits
- performance-enum-size
- readability-avoid-nested-conditional-operator
- readability-convert-member-functions-to-static
- readability-redundant-string-init
- readability-simplify-boolean-expr
- (and ~35 more)

See full list in .clang-tidy. Each check is prefixed with '-' to
disable it while keeping WarningsAsErrors: '*' active for enabled
checks.

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-12 21:20:27 -08:00
Ramon Roche
d196d37ef2 clang-tidy: auto-exclude submodules and third-party code
Automatically generate the clang-tidy exclusion list from .gitmodules
so new submodules are excluded without manual intervention.

Changes:
- Makefile: Generate CLANG_TIDY_SUBMODULES from .gitmodules paths
- Makefile: Add CLANG_TIDY_EXCLUDE_EXTRA for manual exclusions:
  - src/systemcmds/tests (test code, looser style allowed)
  - src/examples (educational code, not production)
  - src/modules/gyro_fft/CMSIS_5 (vendored ARM DSP library)
- Delete src/systemcmds/tests/.clang-tidy (stale since 2019)
- Delete src/modules/gyro_fft/CMSIS_5/.clang-tidy (redundant)

Rationale: Submodules and vendored code should be linted in their
upstream repositories, not here. This reduces noise and focuses
clang-tidy on code that PX4 maintainers actually edit.

Contributors adding vendored (non-submodule) third-party code should
add their path to CLANG_TIDY_EXCLUDE_EXTRA in the Makefile.

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-12 21:20:27 -08:00
Ramon Roche
dc4aa749d3 Tools/run-clang-tidy: add -exclude argument for file filtering
Add regex-based file exclusion to the clang-tidy runner script.
This allows excluding paths (submodules, vendored code, tests) from
static analysis without modifying .clang-tidy files in each directory.

The -exclude argument accepts a regex pattern that is matched against
file paths from the compilation database. Matching files are skipped.

Example: -exclude="src/lib/foo|src/modules/bar"

This prepares for the clang-tidy v6 to v18 migration where we need
to exclude external code that we consume but don't maintain.

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-12 21:20:27 -08:00
Ramon Roche
767eb75662 gyro_fft: fix clang build error on Linux arm64
Extend the -Wno-asm-operand-widths workaround to include Linux aarch64
in addition to Apple Silicon. CMSIS DSP contains ARM Cortex-M specific
assembly that clang (but not gcc) warns about on 64-bit ARM platforms.

The assembly code is unused on POSIX builds - only the C fallback
implementations are executed in SITL.

This fixes clang-tidy CI failing on arm64 runners.

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-12 21:20:27 -08:00
Marco Hauswirth
c29630f6ae adjust clang-tidy checks and workflow 2026-02-12 21:20:27 -08:00
cuav-chen2
c511e72d4f cuav_nora: 5V power overcurrent detection pin default to pull-up 2026-02-12 19:57:37 -08:00
PX4BuildBot
a235b5c87f docs: auto-sync metadata [skip ci]
Co-Authored-By: PX4 BuildBot <bot@px4.io>
2026-02-13 03:30:17 +00:00
Matthias Grob
87163c1578
uavcan esc: initializers cosmetics (#26470) 2026-02-12 18:22:19 -09:00
PX4BuildBot
841fccf6b9 docs: auto-sync metadata [skip ci]
Co-Authored-By: PX4 BuildBot <bot@px4.io>
2026-02-13 02:35:53 +00:00
Ramon Roche
8a3e227dc0 docs: address review feedback on build docs
- Update "Failed to import Python packages" section to reference
  gz_x500 instead of jmavsim, and point to Tools/setup/requirements.txt
  instead of listing individual packages
- Fix :::info admonition spacing in Ubuntu dev env docs

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-12 18:28:49 -08:00
Hamish Willee
ad0b6bdc6b Subedit 2026-02-12 18:28:49 -08:00
Ramon Roche
aecd1461d7 docs: document px4-dev as the recommended container
The new px4-dev container replaces the old per-distro container
hierarchy from PX4/PX4-containers. It is:

- Multi-architecture (linux/amd64 + linux/arm64)
- Based on Ubuntu 24.04
- Built from the in-tree Dockerfile via GitHub Actions
- Published to both ghcr.io and Docker Hub
- Tagged with PX4 versions (e.g. px4-dev:v1.16.0)

Mark the legacy per-distro containers (px4-dev-nuttx-jammy,
px4-dev-ros2-humble, etc.) as deprecated, note that px4-sim
is planned for simulation workflows.

Update all examples to use px4-dev instead of legacy containers.

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-12 18:28:49 -08:00
Ramon Roche
8017baa6e6 docs: remove outdated Ubuntu/Gazebo Classic references
docker.md:
- Update container hierarchy from focal to jammy
- Replace ROS Noetic/Foxy references with ROS 2 Humble
- Update docker run example to use humble container
- Update SITL example from gazebo-classic to gz_x500
- Update VM tested version from Ubuntu 14.04 to 22.04

vscode.md:
- Remove "Ubuntu 18.04" from inotify troubleshooting header
  (this issue is not Ubuntu-version-specific)

dev_env_linux_centos.md:
- Update GCC warning to reference current Ubuntu LTS toolchain
  instead of old Focal Docker file

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-12 18:28:49 -08:00
Ramon Roche
103a61450e docs: update Ubuntu dev env to reflect supported LTS versions
- Replace "older version" collapsible with info block stating
  supported versions: Ubuntu 24.04 (primary) and 22.04
- Remove Gazebo Classic references (Ubuntu 22.04 section, install step)
- Note that GCC version comes from Ubuntu package manager
- Clarify that GCC version depends on Ubuntu release

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-12 18:28:49 -08:00
Ramon Roche
df242827d2 docs: remove outdated Ubuntu/GCC references from build instructions
- Remove Ubuntu 18.04 troubleshooting sections (compile errors,
  VSCode inotify) — Ubuntu 18.04 is no longer supported
- Remove Gazebo Classic SITL dropdown from first build section
- Update FMUv2 flash warning to reference gcc-arm-none-eabi from
  current Ubuntu LTS instead of vague "CI/docker" reference
- Update flash overflow guidance to point at Ubuntu LTS toolchain
- Simplify "too many open files" error example (remove old GCC 7.2.1
  path from 2017)

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-12 18:28:49 -08:00
Ramon Roche
d9996742be setup: drop Ubuntu 18.04/20.04 support from ubuntu.sh
Remove Gazebo Classic installation branches for Ubuntu 18.04 and 20.04.
The script now only supports Ubuntu 22.04 and 24.04 with Gazebo Harmonic.

Supported Ubuntu LTS versions going forward:
- Ubuntu 24.04 (primary, used in CI and release builds)
- Ubuntu 22.04 (secondary, still supported)

When Ubuntu 26.04 LTS releases we will bump to 26.04/24.04.

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-12 18:28:49 -08:00
PX4BuildBot
f518f87d0f docs: auto-sync metadata [skip ci]
Co-Authored-By: PX4 BuildBot <bot@px4.io>
2026-02-12 22:05:22 +00:00
Aaron1356
6a123298e5
[Documentation] Small Doc Update to params for GRF lidars (#26445)
* small Doc Update to params for GRF lidars
2026-02-13 08:57:48 +11:00
Ramon Roche
a38b10c9d0
docs: modernize README (#26458)
* docs: modernize README with hero logo, vehicle icons, and fixed links

Add PX4 and Dronecode SVG logos to the repo, replace broken external
Dronecode logo URL, fix SITL badge branch from master to main, and
restructure the README with centered branding, airframe icon row,
quick-start section, and consolidated documentation links.
2026-02-13 08:55:29 +11:00
Ramon Roche
d641cc3986 ci: init libfc-sensor-api submodule before building stub
The libfc-sensor-api submodule was not being initialized in CI,
causing the stub library build to fail silently. Use the existing
check_submodules.sh mechanism to ensure the submodule is fetched
before attempting to build, and add RESULT_VARIABLE checks so
cmake configuration and build failures are caught early.

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-12 12:00:25 -08:00
Ramon Roche
731d754a15 ci: enable VOXL2 CI builds with private Docker container
Remove modalai_voxl2 and qurt from CI exclusion lists and add
container overrides to use the private ghcr.io/px4/px4-dev-voxl2
image which contains the Qualcomm Hexagon SDK.

- Add voxl2 build group with x64 runner for cross-compilation
- Add GHCR credentials to workflow for private container pull
- Add packages:read permission to workflow
- Auto-build libfc_sensor.so stub during cmake configure
- Handle missing .px4/.elf gracefully in artifact packaging

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-12 12:00:25 -08:00
alexcekay
7edf21414e manifest: reserve ID for Skynode-N 2026-02-12 18:28:41 +01:00
PX4BuildBot
ec278758ed docs: auto-sync metadata [skip ci]
Co-Authored-By: PX4 BuildBot <bot@px4.io>
2026-02-12 05:57:26 +00:00
Hamish Willee
53a14d10cd
docs: Rover flashing update (#26409) 2026-02-12 16:39:11 +11:00
PX4BuildBot
d6c4dd22da docs: auto-sync metadata [skip ci]
Co-Authored-By: PX4 BuildBot <bot@px4.io>
2026-02-12 05:32:38 +00:00
fakerror
4117912506
docs: clarify rover MAVLink offboard support (#26411)
* docs: clarify rover MAVLink offboard support

* Apply suggestion from @hamishwillee

---------

Co-authored-by: Hamish Willee <hamishwillee@gmail.com>
2026-02-12 16:25:12 +11:00
Julian Oes
e239c017d1 Revert "CI: add ccache to macOS"
This reverts commit f751974b41c2e0d4c4e7074bc895e0d2068f5e7f.
2026-02-11 19:14:07 -08:00
PX4BuildBot
5f0e3f600f docs: auto-sync metadata [skip ci]
Co-Authored-By: PX4 BuildBot <bot@px4.io>
2026-02-12 02:06:31 +00:00
Ramon Roche
61da2505fe docs: address review feedback on release process
- Add step to replace "main (planned for:" badges with release version
  when preparing release notes (hamishwillee suggestion)
- Define explicit exit criteria for alpha phase: test cards pass,
  regressions fixed/triaged, documentation complete
- Differentiate beta testing from alpha: beta is community-driven
  validation on extended hardware, not a repeat of alpha test cards
- Define explicit exit criteria for beta->RC transition
- Fix index.md formatting

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-11 17:53:56 -08:00
Ramon Roche
27d831fbcd docs: add companion repo branching to release process
Include px4_msgs and px4-ros2-interface-lib in the release branch
creation steps.

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-11 17:53:56 -08:00
Ramon Roche
71fbc63d67 docs: clarify release cycle, documentation workflow, and gate criteria
- Add approximate 6-month release cycle target
- Move release notes preparation before branching, based on main.md
- Add success criteria for alpha and beta phase transitions

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-11 17:53:56 -08:00
Ramon Roche
a6d50d02bc docs: address review feedback on release process documentation
- Move maintainer link to end of index.md in an info block
- Fix link path to use relative ../releases/ prefix
- Clarify tag stages apply to release branches
- Improve Dronecode Test Team formatting with proper link

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-11 17:53:56 -08:00
Ramon Roche
c56bc4208d docs: document release process
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-11 17:53:56 -08:00