The array access
_airspeed_validator[valid_airspeed_index - 1]
is only valid if valid_airspeed_index > 0. After an airspeed failure, we
have valid_airspeed_index = -1 (see AirspeedSource enum definition) and
are thus accessing array element -2. This is UB and pollutes the log
(and potentially other modules) with garbage values.
Fix: Like already done for other fields, we initialise the values with
NaN and only populate (using the array access) when the airspeed source
is a real sensor, and thus valid.
Replace dimensionally wrong max(pos/vel_var, orientation_var) floor
with physically correct additive variance from the cross-product
δp = δθ × p (and δv = δθ × v). The old code compared rad² directly
to m² or (m/s)², ignoring lever arm / speed.
Also include EV position (guarded by yaw_align) in
isNorthEastAidingActive() so that mag fusion doesn't spuriously
clear yaw_align when it stops during EV-only flight.
Supersedes #25703
* feat(astyle): add make format_changed for diff only style fixes
`make format` is pretty slow because it always considers the entire
source tree. For developing on top of a clean state, considering only
files that differ from HEAD should be sufficient.
* docs(astyle): document new format_changed target
Homebrew 4.5 (April 2026) stopped auto-tapping cross-tap
dependencies declared in formulae, as a security + performance
change. The px4-dev meta-formula pulled in packages from
osx-cross/arm, PX4/px4, and discoteq/discoteq, so 'brew install
px4-dev' now aborts before any real work unless every tap has been
added explicitly. On macos-latest CI runners the chain broke at the
first unreachable dep (discoteq/discoteq/flock) and subsequent make
steps failed with 'ccache: command not found'.
Since Tools/setup/macos.sh is the canonical install path and already
tapped osx-cross/arm and PX4/px4 before calling brew install, the
simplest fix is to inline the package list and call brew install
directly. The px4-dev meta-formula will be kept upstream as a
deprecated no-op so older copies of macos.sh on long-lived branches
and cached Docker images keep working.
The inlined package list is the same set px4-dev depended on, minus
the dead-weight flock dependency that hadn't been invoked in the PX4
build since the NuttX 9.1.x era. See the accompanying PX4/homebrew-px4
PR for formula changes.
Docs updated to match: docs/en/dev_setup/dev_env_mac.md no longer
names the px4-dev formula, describes the package list directly.
Verified locally on macOS ARM64:
- ./Tools/setup/macos.sh runs to completion with both taps and all 13
packages resolving correctly
- make distclean && make px4_fmu-v6x_default builds successfully
(1250/1250 ninja steps, 1930096 B FLASH used)
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
After a soft reset with a non-zero bank selected, _last_register_bank
is default-initialized to 0 but the hardware state is unknown. Register
reads then skip the bank select (cached value matches) and read from
the wrong bank, so probe fails and the device stays stuck until a power
cycle.
Force bank 0 at the start of each probe retry so the first transfer
synchronizes the cached bank with hardware. Drop the post-fail bank
inspection — it's no longer reachable.
Applies to all multi-bank Invensense drivers: IIM42652, IIM42653,
ICM42688P, ICM42605, ICM40609D, ICM20948 (main and I2C passthrough),
ICM20649. ICM45686 and ICM42670P have a single bank and are unaffected.
Takes over PR #25894 from @spiderkeys.
Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>
Mention PWM, OneShot, DShot, and Bidirectional DShot in the long
description so users can discover the parameter by searching for
keywords like "bidirectional" or "dshot" in QGC.
* feat(drivers): add ST LSM6DSV16X IMU driver
Add a new SPI driver for the ST LSM6DSV16X 6-axis IMU with FIFO-based
accel, gyro, and temperature acquisition.
The driver supports continuous FIFO mode with tagged sample parsing,
DRDY interrupt triggering via FIFO threshold, and dynamic watermark
configuration based on the selected sample rate. It also falls back to
scheduled polling when a GPIO interrupt is not available.
To improve robustness, the driver periodically validates critical
register settings and limits FIFO draining per cycle.
Tested on Pixhawk6C with ground testing and flight validation.
* feat(boards/px4_fmu-v6c): add LSM6DSV16X support for Pixhawk6C
Enable the ST LSM6DSV16X as an alternative probe-based IMU on
Pixhawk6C.
The sensor is configured on SPI1 with chip-select PC13 and shares the
same CS and DRDY lines as the ICM42688P across all supported hardware
revisions. Board startup first probes the ICM42688P and then the
LSM6DSV16X, so only the IMU populated on a given board is started.
This change enables the LSM6DSV16X driver in the board configuration,
registers the device type in `spi.cpp`, and adds board sensor probing
for the new IMU.
Use rotation `-R 26` (`ROTATION_PITCH_180_YAW_90`) to match the sensor
orientation on the Pixhawk6C PCB.
* fix(drivers/lsm6dsv): address review comments
- add missing #include <cstddef> for size_t
- check FIFO status transfer() return value
- fix FIFO word count to sample period conversion (DIFF_FIFO reports
words, not sample periods; each sample period is 2 words)
- fix drv_sensor.h macro alignment (spaces to tab)
* drv_sensor: move LSM6DSV devtype into IMU range
* fmu-v6c: use quiet LSM6DSV fallback probe
* fix(uxrce_dds_client): fix session reconnection after agent restart
When the Micro XRCE-DDS Agent is restarted (e.g. via systemd or
Docker), the PX4 client stays "Running, disconnected" forever and
never re-establishes the session. Three bugs prevented reconnection:
1. session.on_pong_flag was never reset after being checked. Once set
to 1 by the first successful pong, it stayed 1 forever, causing
checkConnectivity() to believe pings were still succeeding even
after the agent was gone. Fixed by resetting to 0 after reading.
2. _subs->reset() was never called during session teardown. Stale
uORB file descriptors from the previous session persisted across
reconnection attempts, causing the new session's publishers to
malfunction. Fixed by calling _subs->reset() in deleteSession().
3. _connected was not explicitly reset in deleteSession(). While the
outer loop checked this flag, explicitly clearing it ensures clean
state for the next reconnection attempt.
Closes#26022
Signed-off-by: Pavel Guzenfeld <pavelgu@gmail.com>
* fix(uxrce_dds_client): clear fds[].events in reset() for reconnection
Without clearing events, init() skips orb_subscribe() on reconnect
because the POLLIN guard (fds[idx].events == 0) is never true again.
This causes all fds to remain at -1, px4_poll() returns 0, TX rate
stays zero, and the client enters a disconnect/reconnect loop.
Reported-by: sansha (tested on Pixhawk 6X with serial transport)
* ci: re-trigger SITL tests (flaky offboard test)
* docs(uxrce_dds_client): explain why reset() clears fds[].events
---------
Signed-off-by: Pavel Guzenfeld <pavelgu@gmail.com>