540 Commits

Author SHA1 Message Date
Ramon Roche
1cf7d75525 fix(ci): lint test files on PRs without breaking push-to-main
The pr-review-poster was flagging `gtest/gtest.h file not found` on any
PR that added or modified a test file, because clang-tidy-diff-18.py
ran against files that weren't in the compilation database. PR #27004
and PR #26233 both hit this. The root cause is that test TUs only
enter compile_commands.json when BUILD_TESTING is ON, which the
historical clang-tidy build does not enable.

This PR fixes both halves of the problem:

1. Add a second make target `px4_sitl_default-clang-test` that configures
   a separate build dir with -DCMAKE_TESTING=ON. Test TUs land in its
   compile_commands.json with resolved gtest/fuzztest include paths.

2. Add an umbrella `clang-ci` target that depends on both
   `px4_sitl_default-clang` and `px4_sitl_default-clang-test` so the PR
   job prepares both build dirs with one make invocation.

3. On PR events the workflow uses `make clang-ci`, installs
   libclang-rt-18-dev (needed so fuzztest's FUZZTEST_FUZZING_MODE flags
   do not fail the abseil try_compile with a misleading "pthreads not
   found" error), and routes the clang-tidy-diff producer at the
   test-enabled build dir.

4. Push-to-main is left entirely alone: same single build dir, same
   `make px4_sitl_default-clang`, same `make clang-tidy`. Test files
   are not in that DB so run-clang-tidy.py keeps ignoring them exactly
   as before. This preserves green main while ~189 pre-existing
   clang-tidy issues in test files remain untouched; fixing those is
   out of scope for this change.

5. Replace the fragile `:!*/test/*` pathspec filter (which missed flat
   `*Test.cpp` files in module roots) with
   `Tools/ci/clang-tidy-diff-filter.py`, which reads the compilation
   database and drops any changed source file that is not a TU.
   Headers always pass through. Production code that happens to use
   test-like names (src/systemcmds/actuator_test, src/drivers/test_ppm,
   etc.) stays analyzed because those are real px4_add_module targets.

Verified in the ghcr.io/px4/px4-dev:v1.17.0-rc2 container and on the
real CI runner:
- cmake configure with CMAKE_TESTING=ON succeeds after installing
  libclang-rt-18-dev (Found Threads: TRUE)
- compile_commands.json grows from 1333 to 1521 TUs
- Modifying HysteresisTest.cpp with a new `const char *p = NULL`
  correctly flags hicpp-use-nullptr and
  clang-diagnostic-unused-variable on the new line, while pre-existing
  issues on other lines of the same file stay suppressed by
  clang-tidy-diff-18.py's line filter ("Suppressed ... 1 due to line
  filter")
- No gtest/gtest.h false positives
- Push-to-main path unchanged, still green

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-04-11 10:03:51 -06:00
Onur Özkan
8d4a5cc76c
build(make): support Python venv (#26852)
* use venv python executable if active

Signed-off-by: Onur Özkan <work@onurozkan.dev>

* untrack .venv

Signed-off-by: Onur Özkan <work@onurozkan.dev>

---------

Signed-off-by: Onur Özkan <work@onurozkan.dev>
2026-03-23 16:44:40 -08:00
Jacob Dahl
e8739d0f96 refactor(parameters): remove legacy params.c build infrastructure
All parameters are now defined in YAML module configuration files.
Remove the cmake infrastructure that discovered and processed
legacy params.c files:
- Remove GLOB_RECURSE for *params.c/*parameters.c
- Remove .c file scanning from DISABLE_PARAMS_MODULE_SCOPING
- Remove module_list from px_process_params.py --src-path
- Remove PX4_MODULE_PATHS usage (no longer needed for param scanning)
2026-03-19 23:46:16 -08:00
Eric Katzfey
7258ddca29 fix(boards/modalai/voxl2): fix Debian packaging build and dependencies
Correct SLPI build directory path, CPack architecture variable name,
and package dependency list. Add modalai_voxl2_deb Makefile dependency
and unified build-pkg.sh script.
2026-03-18 08:51:27 -07:00
Ramon Roche
adb2df5ca7 feat(boards/modalai/voxl2): add Debian packaging framework
Add a scalable .deb packaging framework for VOXL2, built on the
existing cmake/package.cmake CPack infrastructure. The framework
handles multi-processor boards by having the POSIX (_default) build
own the .deb and pull in the companion SLPI build's artifacts.

Board-specific files:
- cmake/package.cmake: CPack variable overrides (name, deps, version)
- cmake/install.cmake: install() rules for all .deb contents
- debian/postinst: px4-* symlinks, DSP signature, directory setup
- debian/prerm: service stop, symlink cleanup
- debian/voxl-px4.service: systemd unit (after sscrpcd)

Infrastructure changes:
- cmake/package.cmake: hook for board-specific CPack overrides
- platforms/posix/CMakeLists.txt: hook for board install.cmake
- Makefile: %_deb pattern rule (build _default, then cpack -G DEB)
- CI: auto-discover _deb targets, collect .deb artifacts, upload
  to GitHub Releases

Future boards: add cmake/package.cmake + cmake/install.cmake and
CI discovers it automatically. No new file formats or tools needed.

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-03-18 08:51:27 -07:00
Ramon Roche
ef18ab735a build(boards/modalai/voxl2): chain SLPI build as prerequisite of default target
Add Makefile rules so that both `make modalai_voxl2` and
`make modalai_voxl2_default` build the SLPI DSP firmware first.
Add companion_targets file listing modalai_voxl2_slpi so CI knows
to exclude it from independent build groups.

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-03-18 08:51:27 -07:00
CUAV Chen
25cfb4f790
boards: Add CUAV X25-SUPER board 2026-02-27 12:39:32 -08:00
Jacob Dahl
d5ddc9135d
clang-tidy: fix issues (#26498) 2026-02-17 14:09:43 -09:00
Ramon Roche
fd4b958790
ci: add geninfo negative error ignore to tests_coverage (#26506) 2026-02-16 20:04:18 -09:00
Ramon Roche
be3e1fb2ef fix(build): restore smbus/smbus_sbs for Linux board targets
The previous commit (6b8fd11) gated smbus and smbus_sbs behind
PX4_PLATFORM=="nuttx" to prevent clang-tidy errors on SITL, but these
libraries depend on device::I2C which has a POSIX implementation
(posix/I2C.cpp). Linux boards like bluerobotics_navigator (armhf) and
emlid_navio2 (aarch64) enable CONFIG_DRIVERS_BATT_SMBUS, which depends
on drivers__smbus — causing CMake to fail with "non-existent target".

Move smbus and smbus_sbs back to unconditional add_subdirectory() so
they are available on all platforms. Keep mcp_common gated behind NuttX
since it includes px4_platform/gpio/mcp.hpp (NuttX-only GPIO headers).

Re-add src/lib/drivers/smbus to the Makefile clang-tidy exclude list
since the SITL compilation database lacks the I2C platform headers
needed for analysis.

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-12 21:20:27 -08:00
Ramon Roche
82850cb149 clang-tidy: exclude emscripten Unity build path from analysis
The failsafe_test target uses CMake Unity Builds (UNITY_BUILD ON),
which merges emscripten.cpp, failsafe.cpp, and framework.cpp into a
single generated file at:
  build/.../failsafe_test.dir/Unity/unity_0_cxx.cxx

The run-clang-tidy.py exclude regex operates on compile_commands.json
paths, which reference this generated unity file — not the original
source path. The previous exclude (src/modules/commander/failsafe/
emscripten) only matched the source path and missed the unity file,
causing clang-diagnostic-error: 'emscripten/emscripten.h' not found.

Add failsafe_test\.dir to the exclude regex to catch the unity build
path in addition to the source path.

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-12 21:20:27 -08:00
Ramon Roche
3d457528d2 clang-tidy: gate NuttX-only driver libs by platform instead of exclude list
The clang-tidy CI target builds against the SITL (px4_sitl_default-clang)
compilation database. Three libraries in src/lib/drivers/ were
unconditionally added via add_subdirectory(), causing them to appear in
compile_commands.json despite requiring NuttX-only headers:

- mcp_common: includes px4_platform/gpio/mcp.hpp (NuttX platform GPIO)
- smbus: extends device::I2C which resolves to the NuttX I2C driver
- smbus_sbs: includes smbus/SMBus.hpp, same I2C dependency chain

When clang-tidy analyzed these files it failed on clang-diagnostic-error
(fatal: header not found) since the platform headers don't exist in SITL.

The previous commit worked around this by adding the paths to
CLANG_TIDY_EXCLUDE_EXTRA in the Makefile, but the proper fix is to prevent
these libraries from entering the compilation database at all.

Gate mcp_common, smbus, and smbus_sbs behind
if(PX4_PLATFORM STREQUAL "nuttx") in src/lib/drivers/CMakeLists.txt.
This follows the established pattern already used by the device/ library
in the same directory, which conditionally includes NuttX-specific sources
(CDev.cpp, I2C.cpp, SPI.cpp) while compiling posix stubs for SITL.

The other libraries in the directory (accelerometer, gyroscope, led,
magnetometer, rangefinder) are pure abstractions over uORB topics and
internal utilities with no platform-specific hardware dependencies, so
they compile fine on all platforms without any gating.

Remove the now-unnecessary mcp_common and smbus paths from
CLANG_TIDY_EXCLUDE_EXTRA, keeping only the emscripten failsafe exclusion
(requires the emscripten SDK, not a platform build issue).

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-12 21:20:27 -08:00
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
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
239a7bc4f1 tools: build target for uorb message ref docs
metadata_msg_docs.sh — generate and sync uORB message reference documentation

Usage:
  Tools/ci/metadata_msg_docs.sh [--test-only] [--debug]

Options:
  --test-only   Run make target and comparison; exit 1 if diffs found, without copying files
  --debug       Show full make output and debug info for file comparisons

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-10 22:09:19 -08:00
Hubert
8cb1c31f46
boards: add new board micoair743-lite (#25777)
Authored-by: Minderring <1701213518@sz.edu.pku.cn>
Manufacturer supported board.
2025-11-04 11:16:38 -05:00
Alexander Lerach
e8fbc30cf6 boards: add auterion v6x target 2025-10-14 19:14:41 +02:00
Peter van der Perk
44ff6d9c62 zenoh: exclude src/modules/zenoh/dds_topics.yaml from yaml check 2025-08-22 08:22:59 +02:00
cuav-liu1
e07598d838 boards: add cuav fmu-v6x 2025-08-08 23:35:03 -04:00
Liu1
8462ead986
boards: add new cuav x25-evo (#25176) 2025-08-07 21:54:33 -04:00
jobs
79bfc07c13
boards: add new NarinFC-H7 2025-08-07 20:39:46 -04:00
Jacob Dahl
9e811136a2
ci: clang-tidy: fix attempt (#25328) 2025-07-31 10:35:38 -07:00
Beat Küng
7594a270f7 tests: remove previous fuzz testing
We now use https://github.com/google/fuzztest (see previous commits).
And the test was also failing to build
(https://github.com/PX4/PX4-Autopilot/actions/workflows/cflite_batch.yml)

This reverts these commits:
- 9eda5b373c1f16ffec585a0e27d55682d5726c0e
- 2cbc99397681ad9b67f69703c5dd65eaea26c154
- be0a5b4b3272fac13716436c06ff435d157965b4
2025-07-11 10:39:28 +02:00
Ramon Roche
f01e589010 make: lcov ignore mismatch errors
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2025-07-07 10:25:40 +02:00
Ramon Roche
6deac08b42
docs: remove old doxygen builds (#24743)
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2025-07-02 14:51:18 -07:00
Hamish Willee
d1ff1a4c1d
Docs: uorb graph gen for 5x and 6x (#24856)
Co-authored-by: PX4BuildBot <bot@pixhawk.org>
2025-05-16 08:44:37 +10:00
Matthias Grob
ed9111ec49 Remove obstacle avoidance test with Gazebo classic and ROS 1 2025-02-18 14:33:16 +01:00
Silvan
1f2dba68d2 remove avoidance library and logic
Signed-off-by: Silvan <silvan@auterion.com>
2025-02-18 14:33:16 +01:00
Minderring
8d4663ed5a boards: add micoair743-v2 config files to PX4-Autopilot 2024-12-23 21:56:54 -05:00
Hubert
2ce390a780
boards: new micoair h743-aio board
Co-authored-by: Minderring <1701213518@sz.edu.pku.cn>
2024-11-15 15:30:09 -05:00
Alex Klimaj
4d1c65d722
boards: new ARK FPV FC (#23830)
* add new payload power switch (RC_MAP_PAY_SW)
2024-10-30 11:35:35 -04:00
Liu1
b2c8f0539e
boards: add new cuav 7-nano 2024-09-25 11:47:35 -04:00
Hubert
67ee4817ae Makefile add micoair h743 bootloader 2024-09-06 11:14:30 -04:00
Beniamino Pozzan
98eae3cd4c fix: make help on Ubuntu 22.04
Ubuntu 22.04 uses make 4.3 which broke the current `make help` target
Reference:
https://stackoverflow.com/a/26339924

Signed-off-by: Beniamino Pozzan <beniamino.pozzan@gmail.com>
2024-08-19 11:19:31 -04:00
Alexis Guijarro
c8501cc1d0
boards: Support for 3DR Control Zero H7 OEM Rev G board 2024-08-14 19:52:42 -04:00
mirusu400
5121358e87
Makefile: Fix error message when cannot find target board
not $(MAKE) help|list_config_targets, we should use $(MAKE) list_config_targets
for the desired results.
2024-08-13 21:34:39 -04:00
Matthias Grob
fe3cd4b0cb Add check for missing or duplicate newlines at the end of files 2024-07-19 14:33:36 +02:00
Julian Oes
7137780654 Makefile: add missing bootloader targets
Quite a few were missing, and everything on one line was hard to diff.
2024-06-07 13:16:17 +12:00
Daniel Agar
0dbd7b9176 Jenkins compile remove obsolete target nxp_fmurt1062-v1_default 2023-11-22 11:16:22 -05:00
Beat Küng
fd0a311f3c Makefile: exclude submodules for 'make validate_module_configs' 2023-11-03 11:09:57 -04:00
Beniamino Pozzan
9e5420bbbd microdds_client: rename to uxrce_dds_client
| | old version | new version (second proposal) |
|-|-|-|
| module name | `microdds_client` | **`uxrce_dds_client`** |
| strings / comments about the module | non consistent | **UXRCE-DDS Client** |
| menuconfig option | `MODULES_MICRODDS_CLIENT` | **`MODULES_UXRCE_DDS_CLIENT`** |
| module parameters group name | `Micro XRCE-DDS` | **UXRCE-DDS Client** |
| module parameters name prefix | `XRCE_DDS_` | `UXRCE_DDS_` |
| module class name | `MicroddsClient` | **`UxrceddsClient`** |
|`init.d/rcS` whenever the module is mentioned | `microdds` | **`uxrce_dds`** |
| main doc page name | XRCE-DDS (PX4-FastDDS Bridge) | **uXRCE-DDS (PX4-micro XRCE-DDS Bridge)**|
| environment variable to have custom namespace in simulation | PX4_MICRODDS_NS | **PX4_UXRCE_DDS_NS** |

Signed-off-by: Beniamino Pozzan <beniamino.pozzan@phd.unipd.it>
2023-05-03 11:51:53 -07:00
SalimTerryLi
a46ef72fff Makefile: validate_module_configs skips src/lib/events/libevents/* 2023-04-25 07:51:25 +02:00
Daniel Agar
6991ac014c
rename 'gazebo' simulation to 'gazebo-classic' (#20936)
- use `gazebo-classic` everywhere consistently referring to the original Gazebo (eg version 9,10,11)
   - additional `gazebo_*` helper targets added for compatibility, but warn about deprecation and tell you the new target naming
 - use `gz` everywhere when referring to Gazebo (aka Ignition Gazebo or new Gazebo)
2023-01-15 11:36:12 -05:00
Daniel Agar
635daeed8a NuttX push jlink-nuttx into cmake and enable CONFIG_DEBUG_TCBINFO by default 2023-01-12 09:05:26 -05:00
Daniel Agar
0204a55354 Makefile: add all_olddefconfig and all_px4_savedefconfig helpers for updating all boards 2022-12-29 12:50:37 -05:00
Peter van der Perk
f16286f3eb Add jlink-nuttx build command for gdb helper for multi-task debugging 2022-11-28 06:29:18 -05:00
Beniamino Pozzan
7786437a19 Makefile: remove update_ros2_bridge make commands
as Tools/update_px4_ros2_bridge.sh as been deleted
update_ros2_bridge, update_px4_ros_com and update_px4_msgs
are no more needed

Signed-off-by: Beniamino Pozzan <beniamino.pozzan@phd.unipd.it>
2022-10-20 17:43:16 -04:00
Daniel Agar
cea185268e
msg ROS2 compatibility, microdds_client improvements (timesync, reduced code size, added topics, etc), fastrtps purge
- update all msgs to be directly compatible with ROS2
 - microdds_client improvements
   - timesync
   - reduced code size
   - add to most default builds if we can afford it
   - lots of other little changes
 - purge fastrtps (I tried to save this multiple times, but kept hitting roadblocks)
2022-10-19 19:36:47 -04:00
Beat Küng
a04230faa1 commander: add failsafe state machine with webassembly simulation
to run the simulation:
install sdk: https://emscripten.org/docs/getting_started/downloads.html
make run_failsafe_web_server
open http://0.0.0.0:8000/

Co-authored-by: Konrad <konrad@auterion.com>
2022-10-11 22:31:20 -04:00
Alex Klimaj
0ce76679b7
boards: add new ARKV6X (#20191) 2022-09-15 13:13:49 -04:00