* 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>
* feat(commander): disarm if a motor is not spinning right after arming
During the spool-up window, while landed and before takeoff is detected,
a motor that is commanded to run but never reports RPM, or reports the
motor-stuck fault, raises a new failsafe flag. The failsafe then disarms,
like the existing ESC arming and battery spool-up failures. Motors with
a NaN command are ignored.
The check runs only for rotary-wing vehicles, since it assumes the
minimum output spins the motors. It is enabled by COM_ARM_CHK_ESCS and
needs per-motor RPM telemetry. It adds no parameters; timing is a
fraction of COM_SPOOLUP_TIME: nothing is evaluated up to 50%, and the
decision is made at 80%.
Assisted-by: Claude:claude-sonnet-5-5
Signed-off-by: Beniamino Pozzan <beniamino.pozzan@auterion.com>
* feat(sih): add motor stuck failure injection
`failure motor stuck -i N` models a stuck rotor with a healthy ESC: the
motor is still commanded but produces no thrust, and the ESC stays
online reporting zero RPM. The failure detector and control allocator
are not informed, unlike `motor off` and `motor wrong`.
The failure injection catalogue now accepts STUCK for the motor unit,
and SIH zeroes the thrust of the addressed motors, which also zeroes
their reported RPM. Other environments accept the command but do not
apply it, as documented in the failure injection table.
Assisted-by: Claude:claude-sonnet-5-5
Signed-off-by: Beniamino Pozzan <beniamino.pozzan@auterion.com>
* feat(sih): publish esc status for standard VTOL pusher
add case in motor_inded_from_actuator for StandardVTOL
Signed-off-by: Beniamino Pozzan <beniamino.pozzan@auterion.com>
* chore(params): increase COM_SPOOLUP_TIME default value to 2 seconds
This is to ensure that the motor has enough time to try to start
and the stuck-detection logic does not return false negative
when an attemp of spin is marked as healty motor
Signed-off-by: Beniamino Pozzan <beniamino.pozzan@auterion.com>
---------
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>
The Gazebo bridge publishes vehicle_visual_odometry from the model's
odometry topic without consulting the failure state, so `failure vio`
had no effect on Gazebo (the support table listed it as `—`).
Route the odometry sample through the shared failure_injection::process()
so `off` suppresses the publication and `stuck` replays the last good
sample with fresh timestamps, matching how the bridge already handles
GPS. Allow `stuck` for VIO in the manager's capability table so the
command is not rejected before it reaches the bridge.
Add a functional test for the odometry callback (stuck, off, isolation
from a GPS failure, recovery) and pin VIO's capabilities in the
FailureTable catalogue test. Update the failure injection docs.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Abel Mendoza <abelxmendoza@gmail.com>
* 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>
The jMAVSim pages become redirects to SIH, examples and HITL options
move to SIH, Gazebo or Gazebo Classic, and SIH on hardware gets Hawkeye
as its 3D display-only view through a MAVLink bridge to its UDP port.
The release notes flag the removal in the upgrade guide.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
* feat(failure-injection): implement motor failure injection with soft and hard modes
* feat(failure-injection): update motor failure injection descriptions and behaviors for annunciated and un-annunciated modes
* feat(failure-injection): update motor failure injection terminology to detected and undetected modes
* feat(failure-injection): refine motor failure injection handling for detected and undetected modes
* fix(boards): remove FailureInjector::update() from itcm_functions
FailureInjector was replaced by the shared failure_injection library, so
the symbol no longer exists and the ITCM check fails on the boards that
still list it. Its successor failure_injection::Config::update() is an
inline no-op unless MODULES_FAILURE_INJECTION_MANAGER is enabled, which
none of these boards do, so there is no replacement symbol to map.
Assisted-by: Claude:claude-opus-5
Signed-off-by: Claudio-Chies <61051109+Claudio-Chies@users.noreply.github.com>
---------
Signed-off-by: Claudio-Chies <61051109+Claudio-Chies@users.noreply.github.com>
Co-authored-by: Claudio Chies <chiesc@chies.com>
* fix(gz_bridge): support GPS failure injection
Modern Gazebo publishes sensor_gps directly from GZBridge, bypassing the shared failure-injection processing. Route each NavSat sample through process_gnss using the actual uORB publication instance so off, stuck, wrong, and recovery work for the addressed receiver.
Add functional regression coverage for the real GZBridge NavSat callback and sensor_gps publication path, plus recovery coverage for the shared GNSS processor.
Fixes#22296
Assisted-by: Codex:gpt-5
Signed-off-by: Saibernard Yogendran <bernie97@seas.upenn.edu>
* docs: gps failure injection is available on Gazebo
The gz_bridge now applies the shared GNSS failure state to the
simulator's NavSat data, so the table entry and the SIM_GZ_EN_GPS
workaround note are out of date.
Assisted-by: Claude:claude-fable-5
Signed-off-by: Saibernard Yogendran <bernie97@seas.upenn.edu>
---------
Signed-off-by: Saibernard Yogendran <bernie97@seas.upenn.edu>
* feat(failure_injection): add ADS-B traffic-avoidance failure injection
Wire up FAILURE_UNIT_SYSTEM_TRAFFIC_AVOIDANCE (107) for the MAVLink-based
traffic avoidance path:
- OFF suppresses and STUCK freezes the incoming transponder_report, applied
both at the MAVLink ADS-B ingestion (handle_message_adsb_vehicle) and at
the navigator consumer (check_traffic), so it works for real ADS-B over
MAVLink, simulated ADS-B and the fake_traffic command.
- OFF additionally marks the ADS-B/FLARM heartbeat unhealthy so the traffic
avoidance system health check fails, using a message-less process()
overload.
- Add the unit to the capability catalogue (OK/OFF/STUCK), the failure
console command, the RC-switch unit selector and the docs.
The matching MAVLink FAILURE_UNIT enum entry lives in the mavlink submodule
(common.xml) and is handled by a separate PR; the uORB mirrors in
VehicleCommand.msg and FailureInjection.msg are included here.
* feat(failure_injection): enhance battery failure injection with severity levels
* feat(failure_injection): improve battery failure handling with dynamic threshold parameters
* refactor(failure_injection): remove traffic avoidance example from documentation
* docs(docs): subedit
* feat(failure_injection): add variance setting for distance sensor and integrate rangefinder in simulator
* feat(docs): add failure injection to release notes
* docs(docs): Add sim_mavlink back to heading
* fix(failure_injection): update default battery failure injection severity to Emergency
* docs(docs): get away from footnotes
* feat(failure_injection): enhance battery failure injection handling and update traffic unit support
* feat(failure_injection): add traffic avoidance handling tests and configurations
* [AUTO COMMIT] update EKF change indication
See .github/workflows/checks.yml for more details
* Apply suggestion from @hamishwillee
* feat(failure_injection): update failure types and handling for traffic avoidance and ESC telemetry
* fix(typo)
* [AUTO COMMIT] update EKF change indication
See .github/workflows/checks.yml for more details
* fix(docs): clarify notes on GPS and airspeed handling in failure injection documentation
---------
Co-authored-by: Claudio Chies <chiesc@chies.com>
Co-authored-by: Hamish Willee <hamishwillee@gmail.com>
* feat(failure_injection): integrate failure injection support across sensor drivers
* feat(failure_injection): enhance failure injection with RC switch support and instance bitmasking
feat(failure_injection): add disabled failure injection manager and system command support for v5x and v6x boards
* feat(failure_injection): add battery failure injection
Add a value-mutating apply-site for FAILURE_UNIT_SYSTEM_BATTERY. On an
injected OFF the outgoing battery_status is reported as a depleted pack
(zero remaining, emergency warning) so the low-battery failsafe triggers.
The apply-site lives in the shared Battery library, covering the analog
ADC, INA power monitors, ESC battery and SITL in one place, plus the
UAVCAN battery driver which publishes battery_status directly. The
previous SITL-only hack in BatterySimulator is removed in favour of this
shared path so simulation and hardware behave identically.
* fix(failure_injection): change parameter types from int32 to enum
* refactor(failure_injection): disable failure injection manager and system commands across multiple boards
* feat(failure_injection): enhance failure injection with timestamp handling and message-less support
* refactor(failure_injection): simplify has_timestamp_sample implementation and remove unused includes
* refactor(failure_injection):move conditional compilation into helper libary
* refactor(failure_injection): update CMakeLists to include failure_injection dependency across multiple drivers
---------
Co-authored-by: Claudio Chies <chiesc@chies.com>
* failure_injection: improve previously vague motor faulure
Reading it again I decided adding the sentance in 4d2170c13e is not clear enough.
* docs/safety: add a motor failure detection paragraph
The functionality is in my eyes pretty basic but so far completely undocumented so I went through the code and added a paragraph based on questions I received.
* Subedit
* Apply suggestion from @hamishwillee
---------
Co-authored-by: Hamish Willee <hamishwillee@gmail.com>
* Add vitepress tree
* Update existing workflows so they dont trigger on changes in the docs path
* Add nojekyll, package.json, LICENCE etc
* Add crowdin docs upload/download scripts
* Add docs flaw checker workflows
* Used docs prefix for docs workflows
* Crowdin obvious fixes
* ci: docs move to self hosted runner
runs on a beefy server for faster builds
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
* ci: don't run build action for docs or ci changes
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
* ci: update runners
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
* Add docs/en
* Add docs assets and scripts
* Fix up editlinks to point to PX4 sources
* Download just the translations that are supported
* Add translation sources for zh, uk, ko
* Update latest tranlsation and uorb graphs
* update vitepress to latest
---------
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
Co-authored-by: Ramon Roche <mrpollo@gmail.com>