119 Commits
Author SHA1 Message Date
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
Ramon Roche 89c68cd37f ci(build-all): build two targets per job concurrently
Each build job compiled its group one target at a time, and the serial
parts of every build (configure, the NuttX make, linking) left the 4-vCPU
runners about half idle. Two concurrent builds keep them around 80% busy
and cut total build-step time about 24% and runner cost about 17%.
Larger runners and more slots were measured and cost more than they save.

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

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

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-09-28 09:45:09 -07:00
Ramon Roche a8b0e91ebe feat(setup): install macOS Gazebo from a locked conda-forge environment
Homebrew rebuilds and drops the gz bottles whenever homebrew-core bumps
protobuf or abseil, which breaks the macOS Gazebo install until the pins
catch up. conda-forge keeps every package it has published, so
Tools/setup/macos/pixi.toml and its lock install the same gz, protobuf,
abseil, OpenCV and GStreamer binaries until the lock is updated on
purpose. OpenCV is the headless build, and GStreamer brings the good,
bad and ugly plugin sets the gz camera plugin's pipeline uses.

macos.sh installs the environment with pixi and loads it from the venv
activation through a small script, since pixi shell-hook would export
the installing shell's PATH. The build and the gz launch do not depend
on that activation: CMake searches the environment like it pins the
.venv Python, and px4-rc.gzsim sources gz_env.sh before it looks for
gz, which loads the environment when it is not already active and puts
its lib dir ahead of Homebrew's in the dyld fallback path.
conda-forge's gz-transport13 does not pull in cppzmq, so the manifest
lists it.

The osrf/simulation pin, the protobuf pin and the weekly bot that
refreshed them are removed. The homebrew-core commit moves into
homebrew-pins.txt unchanged.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-09-26 15:12:00 -07:00
Jacob Dahl eff5e1b350 chore(agents): move Claude instructions and skills to AGENTS.md and .agents (#28803)
* chore(agents): move Claude instructions and skills to AGENTS.md and .agents

Claude Code now reads AGENTS.md and .agents/skills, so one client-agnostic copy serves every assistant and the Codex adapters that pointed back into .claude go away. The build skill splits by host: Linux builds natively, macOS needs the container.

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

* chore(agents): expose .agents to Claude Code via imports and symlinks

Claude Code reads AGENTS.md only when no CLAUDE.md or CLAUDE.local.md exists and never reads .agents/, so the skills and instructions were invisible to it. Worktrees move outside the repository, where no tool's recursive search reaches them.

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

* chore(agents): refine build, commit, pr and review-pr skills

Linux builds run in whatever checkout the agent is in. PR bodies now carry the Assisted-by disclosure and an optional Testing section for testing worth reporting. Commits preserve history for reviewers since PRs are squash-merged. Reviews can check the area's history for intentional or in-flight work.

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

* feat(agents): push and refresh the PR description from the commit skill

A commit on a pushed branch otherwise leaves the PR stale until someone remembers to push and re-edit it.

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

* fix(agents): drop trailing blank line in .gitignore

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>
2026-09-22 14:26:39 -06:00
Ramon Roche f7052b281c feat(ros2): add PX4 ROS development containers
Provide a supported Jazzy environment for SIH/Gazebo development and source builds, with pinned tooling and reproducible multi-architecture image publishing. Separate package and container assets from ROS source preparation, and keep checkout workspaces fresh through a Python CLI.

Assisted-by: Copilot:gpt-6-astra
2026-09-10 16:07:58 -07:00
Ramon Roche e3480a1e37 chore(agents): add Codex instructions and skills
Expose PX4 guidance and workflows to Codex while keeping root instructions concise and reusing tracked Claude workflows where possible.

Assisted-by: Copilot:gpt-6-astra
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-09-07 10:51:49 -07:00
Ramon Roche d52fbd9707 fix(ci): remove accidentally committed local settings file
.claude/settings.local.json contains user-specific Claude Code
permissions and should never be in the repo. Remove it and add
a .gitignore entry to prevent it from being committed again.

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-04-10 15:58:34 -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
Ramon Roche e80abe4e29 tools: metadata script leftover 2026-02-10 22:09:19 -08:00
cc492bbf6e [Sponsored by ARK] Encryption (#24489)
* Added the board configs for encryption, I had to disable smbus and px4 io in the arkv6x

* Added the key generator script

* Added the decryptor, logs are needed for it though

* Added the log download and modified the decryptor

* Quick fixes & README

* Additional modifications & cleanup

* Tested upd connection
Adjusted the log downloader to handle multiple entry responses from the FC
Edited README

* Reverted IP address change

* Added pycryptodome to the requirements.txt

* fixes for log download and decryption

* Removed old log decryptors and updated README

* Pointed the ark borads to the dummy key updated the README accordingly

* Adjusted the folders in README, removed new lines

* Extended command line arguments for all possibilities for description

* Added MAV_CMD_REQUEST_AUTOPILOT_CAPABILITIES after heartbeat received to make sure log request is answered in all cases

* Update Tools/log_encryption/README.md

Co-authored-by: Jacob Dahl <37091262+dakejahl@users.noreply.github.com>

* Update Tools/log_encryption/README.md

Co-authored-by: Jacob Dahl <37091262+dakejahl@users.noreply.github.com>

* Update Tools/log_encryption/README.md

Co-authored-by: Jacob Dahl <37091262+dakejahl@users.noreply.github.com>

* Update Tools/log_encryption/README.md

Co-authored-by: Jacob Dahl <37091262+dakejahl@users.noreply.github.com>

* Edited README, changed the serial connection logic and updated logdownload, made decryption a bit easier to understand

* Update Tools/log_encryption/README.md

Co-authored-by: Hamish Willee <hamishwillee@gmail.com>

* Removed new lines

* arkv6x: add individual mags to default.px4board

---------

Co-authored-by: Jacob Dahl <dahl.jakejacob@gmail.com>
Co-authored-by: Alex Klimaj <alex@arkelectron.com>
Co-authored-by: Jacob Dahl <37091262+dakejahl@users.noreply.github.com>
Co-authored-by: Hamish Willee <hamishwillee@gmail.com>
2025-04-02 23:40:45 -08:00
Daniel Agar 1524bd39b5 .gitignore: ignore generate top level log/ folder (colcon) 2023-03-20 11:06:12 -04: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
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
Daniel Agar a7bbcd5b04 delete lib/mixer and mixer_module static mixing 2022-09-09 09:14:09 -04:00
Daniel Agar ca3f6f59f9 dataman: add SYS_DM_BACKEND parameter 2021-12-10 09:10:02 -05:00
AlexKlimaj dddd2c3297 drivers/distance_sensor: New Broadcom AFBR-S50LV85D distance sensor driver
* Basic Broadcom AFBR-S50 driver using vendor API and binary blob https://github.com/Broadcom/AFBR-S50-API
* fix ARK Flow paw3902 rotation
2021-06-15 12:12:24 -04:00
Daniel Agar da1a38b44e parameters: merge generated files ito single static constexpr header
- store parameter type and if volatile separately (saves kilobytes of flash)
 - use Bitset for tracking active and changed parameters
 - use atomic for autosave_enabled flag
 - compile at ${MAX_CUSTOM_OPT_LEVEL} (-O2 on non flash constrained boards)
2021-02-12 08:27:47 -05:00
Daniel Agar 4d7b875ee2 flight_mode_manager: merge with flight_tasks 2021-01-17 15:46:30 +01:00
Daniel Agar d19f18d40b linux boards (ocpoc, bbblue, navio2) replace custom adc drivers with simple px4_arch implementation 2020-01-07 14:04:13 -05:00
Daniel Agar 35073d093f gitignore update for in tree cmake builds 2019-12-31 12:37:22 -05:00
Daniel Agar a20b508d7e gitignore remove core 2019-08-27 08:59:48 -04:00
Julian Kent d70b024ec7 GTest functional tests that include parameters and uORB messaging (#12521)
* Add kdevelop to gitignore

* Add test stubs

* Rename px4_add_gtest to px4_add_unit_gtest

* Add infrastructure to run functional tests

* Add example tests with parameters and uorb messages

* Fix memory issues in destructors in uORB manager and CDev

* Add a more real-world test of the collision prevention
2019-08-09 15:10:09 +02:00
Matthias Grob daa3c733e9 vscode: move vscode specific .gitignore entries to the folder 2019-04-03 14:52:46 -04:00
Daniel Agar 5e6bfe1ad8 vscode updates
* working debugging (one click build and debug)
   * SITL jmavsim
   * SITL gazebo
   * jlink px4_fmu-v{2-5}
 * improved syntax highlighting
   * GNU linker files
   * ROS message files msg/*.msg
   * jinja2 template files
 * fixed intellisense support
2019-03-22 20:55:39 -04:00
Daniel Agar e4967a9502 vscode minor updates
- add cmake language support to recommend extensions
 - jlink debug add stm32f427 svd
 - gitignore updates for vscode
2019-03-17 12:05:26 -04:00
TSC21 4b1053d212 Jenkins: set autobuild and deploy for generating px4_msgs repo ROS msg definitions files 2019-01-28 14:00:21 +01:00
Daniel Agar a5fa3eda30 vscode initial configuration (#10911) 2018-12-04 23:11:36 -05:00
Daniel Agar 459ad7528f python scripts code coverage (#10157) 2018-08-04 18:22:08 -04:00
Daniel Agar bb49ac1933 gitignore remove obsolete 2018-07-15 17:59:07 +02:00
Daniel Agar 45daa8d091 gitignore gdb history 2018-07-15 17:59:07 +02:00
Daniel Agar 136d259876 travis-ci fix coverity scan and px4_metadata (#8156) 2017-10-20 09:20:30 -04:00
Daniel Agar 6f3fe3f3ec travis-ci enable codecov (#8090) 2017-10-09 02:13:43 -04:00
Daniel Agar 48f1e3ed1c uORB generation move to msg/ 2017-09-29 10:13:51 -04:00
Daniel Agar a87b6befbb ignore .vscode IDE directory 2017-09-16 21:29:52 +01:00
Lorenz Meier 9af9475541 RTPS: Ignore example processes 2017-08-13 11:39:00 +02:00
Vicente Monge c85039e413 Fixing rebase conflicts 2017-08-01 22:32:43 +02:00
Beat Küng 674ae5292e markdown module doc script: write how to generate the modules documentation 2017-07-14 11:57:11 +02:00
Daniel Agar 4937449890 move parameter unittest into systemcmds 2017-06-12 12:18:53 -04:00
Daniel Agar 24b26e53b9 cmake organize code coverage handling and base 2017-06-02 19:35:18 -04:00
Daniel Agar e4f55e4526 travis-ci upload cppcheck, scan-build, and coverage to s3 2017-06-02 19:35:18 -04:00
Daniel Agar ac4a706da0 build system fixes and improvements
- deploy px4 metadata using target
 - clang scan-build upload output to s3
 - clang-tidy properly check headers
 - add cppcheck helper
 - force gcc color
2017-06-02 19:35:18 -04:00
Daniel Agar 293eca7d16 Makefile add px4_metadata for airframes and parameters 2017-04-22 21:31:05 -04:00
Daniel Agar 8c9affddc8 travis-ci generate and upload parameters.md 2017-04-07 22:06:23 +02:00
James Goppert a0fff97fd2 Moved deployment logic to python scripts. 2017-01-13 01:11:14 -08:00
Daniel Agar 74231e6656 split tests for SITL ctest 2017-01-02 10:14:41 +01:00
Anton Matosov 3a17c07b1e Implement RC and DL failsafe action handling for multirotors
Move RC and DL failsafe actions handling from navigator to commander (credits to @AndreasAntener)
Separate manual kill switch handling via manual_lockdown to prevent override and release of software lockdown by RC switch

Other changes:
Add failsafe tune
Fix LED blinking for Pixracer
Return back support for rc inputs in simulator but now it is configurable via cmake
2016-12-27 00:38:13 +01:00
David Sidrane 5f82fc70be CI Fixes 2016-12-21 08:34:22 +01:00
Daniel Agar 1941dfca87 add tests code coverage
-closes #5862
2016-12-07 20:17:00 +01:00
Dennis Shtatnov 37641042cc Explicit internal battery resistance params 2016-11-19 14:55:52 +01:00
Anton Matosov 0734db1740 Ignore all CLion related files as they are all generated from cmake 2016-11-15 11:10:22 +01:00