* fix(simulation): correct apparent wind sign and fixed-wing pitot model in SIH
* fix(simulation): simplify pitot model to always use body-x airspeed
---------
Co-authored-by: 0xDI <0xDI@users.noreply.github.com>
Add SENS_AFBR_ROT as the single source of truth for the AFBR-S50
mounting orientation and drop the -r CLI flag.
The -r flag was already non-functional: the getopt string declared
it without a trailing ':', so the case body called atoi(nullptr).
Removing it is harmless and avoids ambiguity between "user did not
pass -r" and "user explicitly passed -r 25".
The driver now reads orientation from SENS_AFBR_ROT in the
constructor. distance_sensor_s::ROTATION_* is a discontinuous enum
(0-7, 24, 25), and the param schema can't express that natively, so
the driver validates at start and falls back to ROTATION_DOWNWARD_FACING
on out-of-set values.
* fix(drivers/distance_sensor/vl53l1x): added median filtering and hysteresis based quality
* fix(drivers/distance_sensor/vl53l1x): revert back to 100/0 quality
Vendor-specific airframes (Holybro, UVify, ATL, COEX, Bitcraze,
ThunderFly, Applied Aeronautics) are not relevant on the ARK FMU
boards and only consume flash. Add an rc.board_airframes whitelist
to ark_fmu-v6x and ark_fmu-v6s that keeps only the generic
multirotor, fixed-wing, VTOL, and rover frame types.
Flash savings (default variant):
ark_fmu-v6x: 1965708 -> 1957772 B (-7936 B, free 372 -> 8308 B)
ark_fmu-v6s: 1960212 -> 1945748 B (-14464 B, free 8108 -> 22572 B)
Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>
* navigator: check geofence dataman update failures
* navigator: fix geofence import state handling
- Move the import success log after the dataman state write succeeds
- Store the active fence dataman id in the stats entry
- Add error logs before geofence import failure exits
Place firmware .bin files at the SD card root or staging directory
(/fs/microsd/ufw_staging/); on boot the UAVCAN server migrates them
to /fs/microsd/ufw/ and updates FW.db, then flashes any connected
node whose firmware version mismatches.
- Add firmware migration from SD root and staging dir into /fs/microsd/ufw/
- Maintain FW.db flat-file database mapping board IDs to original filenames
- Use cache-aligned DMA-safe read/write buffers (required on STM32H7)
- Add Tools/auterion/remote_update_fmu.sh for SSH-based FMU+canio updates
The current preflight check works by sending individual actuator
commands over mavlink. This can only be done sequentially, so the
surfaces do not move in a coordinated way, instilling little confidence.
To alleviate, this adds a control surface preflight check which causes
the allocator to command torque in the given direction, so the control
surfaces move as they would in flight.
Triggered by `{MAV,VEHICLE}_CMD_ACTUATOR_GROUP_TEST`. Only runs when
pre-armed (control surfaces, tilts) or armed (thrust). Test runs for 0.5
seconds -- for longer duration, send repeatedly from the GS.
Check is rejected in flight and cancelled when nav_state changes.
- Expose overrideCollectiveTilt in ActuatorEffectiveness, empty base, only overridden for Tiltrotor
- Allow giving collective tilt that is used in updateSetpoint in place
of command from tiltrotor_extra_controls
- Needs to be called with do_override = false to clear override
- add comment explaining technical debt
Update safety.md, peripherals/parachute.md, and releases/main.md to document the extended COM_PARACHUTE parameter and the new configurable in-flight failsafe behaviour.
01abe35563 introduced a handler for the
`MAV_CMD_DO_SET_MODE` enum, which directly forwards a vehicle command
into uORB. It did not disable immediate acknowledgement of this command directly in `mavlink_receiver`. This means that the command is always ack'd once with ACCEPTED prior to the ack issued from Commander
The fix is to set `send_ack=false` immediately after dispatching the
command message to uORB in mavlink receiver
* fix(dshot): send motor stop for 3D mode deadzone instead of min throttle
In DShot 3D mode, convert_output_to_3d_scaling() returns DSHOT_DISARM_VALUE
(0) for deadzone inputs. But up_dshot_motor_data_set() adds the MIN_throttle
offset (+48), causing motors to spin at minimum throttle instead of stopping.
Check the result of calculate_output_value() for DSHOT_DISARM_VALUE and send
an explicit motor stop command, bypassing the +48 offset.
* fix(dshot): make 3D deadband inclusive on both ends
Change the 3D deadband check from [L, H) to [L, H] so that setting
DSHOT_3D_DEAD_L equal to DSHOT_3D_DEAD_H (both default to 1000) produces
a single-point deadband at that value, matching the natural reading of
"between L and H" in the param description.
Clarify the DSHOT_3D_DEAD_L/H param descriptions to state the range is
inclusive and note the L=H default behavior.
NuttX builds into the shared submodule trees at
platforms/nuttx/NuttX/{nuttx,apps}, not into per-board build/<target>/.
Its recursive make does not treat PX4 defconfig changes as a reason to
recompile, so switching board configs links stale objects from the
previous config (e.g. kmm_* and stm32_spi4select from a protected/fmu-v5
build into a later flat/ark_fmu-v6x build), and the kernel ELF fails to
link with hundreds of undefined references.
Tools/ci/build_all_runner.sh already handled this in CI by wiping the
submodules between iterations. Bring the same fix to local builds: stamp
the active target in build/.last_target and run git clean -dXfq on both
NuttX submodules when it changes. Same-target rebuilds, which #27324
made cheap, stay unaffected (no-op rebuild remains ~0.14 s).
Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>
A successful I2C::init() attaches to the bus (per-platform: NuttX
i2c_master_s* via px4_i2cbus_initialize, POSIX /dev/i2c-N fd via
::open, QuRT bus fd via _config_i2c_bus). Only the destructor releases
it. The init() implementations on all three platforms unconditionally
re-attached on every call, so any driver that called init() more than
once on the same instance leaked:
- NuttX: kmm_malloc() of a fresh i2c_master_s inst, plus an unbalanced
increment of the per-port refcount in stm32_i2cbus_initialize() (and
the equivalent across other arch ports). The previous inst pointer
was overwritten and the matching uninitialize() never ran, so the
bus refcount could not reach zero on destruct.
- POSIX/QuRT: file descriptor leak (re-open without close).
The pattern that triggers this is "init() retried on failure," used in
keep_running mode and in drivers like INA228 whose RunImpl re-enters
init() whenever a later step (e.g. a register write) failed. Drivers
that init() exactly once from instantiate() were unaffected.
Mirror what SPI::init() (nuttx/SPI.cpp) already does for its bus-bind
step and short-circuit on second-and-later calls. Re-running probe()
and CDev::init() on an already-attached device was also avoided here
because the existing cleanup path on probe failure would tear down the
preserved _dev that earlier callers still depended on.
Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>
PR #27324 swapped find_package(PythonInterp) for find_package(Python3),
whose macOS defaults (FRAMEWORK=FIRST, STRATEGY=VERSION) override
Python3_ROOT_DIR and PATH to resolve the highest-versioned framework
Python. CI then matched Homebrew's 3.14 while pip installed kconfiglib
into the actions/setup-python 3.10 venv, breaking `make px4_sitl`
configure with "No module named menuconfig".
Pin Python3_EXECUTABLE to .venv/bin/python when present (macos.sh
creates the venv but neither it nor CI exports VIRTUAL_ENV), and set
FIND_STRATEGY=LOCATION + FIND_FRAMEWORK=LAST so dev machines and Linux
containers without a venv still pick the interpreter that has the
project's pip dependencies.
* fix(ci): wipe NuttX submodule state between boards in build_all_runner
NuttX .o and lib*.a live in the shared submodule trees under
platforms/nuttx/NuttX/{nuttx,apps}, not in per-board build/<board>/.
NuttX's recursive make doesn't treat PX4's per-board defconfig changes
as a reason to recompile, so consecutive board builds in one workspace
were linking stale objects from an earlier board (e.g. stm32_spi.o from
fmu-v2 linked into fmu-v4pro, which doesn't enable SPI4).
Run git clean -dXf on both NuttX submodules between iterations to drop
gitignored build state. This mirrors what make clean already does for
submodules and preserves the incremental-build wins for single-board
use.
* fix(cmake): isolate kernel mm/libc objects with BINDIR=kbin
mm and libs/libc compile the same sources for both the kernel and user
passes in protected builds. Without separate output dirs the kernel
objects clobber bin/*.o and the user-mode libmm.a/libc.a end up pulling
in kernel-only symbols (nxsem_wait, g_current_regs, nx_read, nx_write,
g_mmheap, ...) at link time. Matches NuttX's own tools/LibTargets.mk.
On boards with a slow startup sequence (e.g. FMU-V6XRT), the health
checks run before load_mon and ekf2 have published their first message,
producing spurious "Preflight Fail" entries in dmesg.
Gate the cpuload and estimator_status checks on
uORB::Subscription::advertised(). While the topic has never been
advertised the publisher has not started yet, so skip the check
silently. Once advertised, missing or stale data is reported as before
so real failures are still caught.
Signed-off-by: SofianElmotiem <sofianelmotiem@gmail.com>
Co-authored-by: Jacob Dahl <dahl.jakejacob@gmail.com>
* fix(cmake): use Python3 module; cache PYTHON_EXECUTABLE properly
The legacy `find_package(PythonInterp 3)` is deprecated (warned with
noisy CMP0148 by cmake 3.27+, currently visible on Ubuntu 24.04 CI
runs).
It also stores its result as PYTHON_EXECUTABLE without a proper CACHE
type, which interacts badly with the Makefile's `cmake-cache-check`.
`cmake -L` skips UNINITIALIZED entries, so the
`-DPYTHON_EXECUTABLE=...` passed by the top-level Makefile is never
matched in the cache and every invocation forces a full reconfigure.
Switch to `find_package(Python3 COMPONENTS Interpreter REQUIRED)`,
then bridge to the legacy `PYTHON_EXECUTABLE` name that the rest of
the codebase still references.
Promote it to a CACHE FILEPATH entry so cmake -L lists it, preserving
any user-supplied value verbatim (find_package(Python3) canonicalises
e.g. bin/python3 to bin/python3.13, defeating a string-based cache
match).
Signed-off-by: Daniel Fanache <dan@rts.ro>
* fix(cmake): promote CONFIG to CACHE STRING for incremental builds
When CONFIG is passed via `-DCONFIG=...` on the cmake command line, it
is stored as an UNINITIALIZED cache entry. `cmake -L` skips
UNINITIALIZED entries by design, so the Makefile's
`cmake-cache-check` (which uses `cmake -L` to diff desired vs cached
options) never finds CONFIG in the output, concludes the cache is
stale, and triggers a full reconfigure on every `make <target>`
invocation.
If a config identifier is given, we force promote it to CACHE
STRING. This preserves the user supplied value as it was, while making
it visible to `cmake -L`, so the cache-check succeeds when nothing has
changed.
Signed-off-by: Daniel Fanache <dan@rts.ro>
* fix(cmake): track default.px4board as a configure dependency
Non-default labels merge `default.px4board` + `{label}.px4board` via
`merge_config.py`, but only the label file was listed as a configure
dependency. Changes to `default.px4board` were silently ignored until
a clean build, which is surprising and easy to debug for hours.
Register `default.px4board` as a CMAKE_CONFIGURE_DEPENDS in the
non-default-label branch so edits trigger reconfigure as expected.
Signed-off-by: Daniel Fanache <dan@rts.ro>
* fix(cmake): correct NuttX apps/library build dependency tracking
Three dependency graph defects in the libapps.a and per NuttX library
custom_commands caused either spurious full rebuilds or stale outputs
on incremental builds.
(1) `builtin_list.h` and `builtin_proto.h` are regenerated by the apps
build from `px4.bdat`/`px4.pdat` on every invocation. They were
included in `nuttx_apps_files`, so on each build we saw them as
changed inputs and re-triggered the apps target perpetually. Exclude
them with a `list(FILTER)`.
(2) libapps.a's custom_command lacked `px4.bdat`/`px4.pdat` as
dependencies, so module additions or renames (which regenerate those
registries) did not propagate to a rebuild of the builtin command
table. Add them to DEPENDS.
(3) NuttX's recursive make does not always notice that
`builtin_list.h` has been regenerated and that `builtin_list.c`
therefore needs recompiling. Touch `builtin_list.c` so NuttX's make
picks up the indirect change.
Additionally, drop the destructive cleanup COMMANDs that ran at the
start of libapps.a and each per-library custom_command (`remove
-f *.a`, `find ... -delete *.o`). These were workarounds for the now
fixed dependency tracking; without them removed, they would also force
unnecessary full rebuilds every time.
Signed-off-by: Daniel Fanache <dan@rts.ro>
---------
Signed-off-by: Daniel Fanache <dan@rts.ro>
Co-authored-by: Ramon Roche <mrpollo@gmail.com>
* fix(ekf2): use variance for yaw observations
* docs(ekf2): fix EKF2_EVA_NOISE unit comment
The parameter is a 1-sigma angle noise in rad (matching the unit
declared in params_external_vision.yaml and the squaring done in
EKF2.cpp), not an angular rate.
Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>
---------
Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>
Co-authored-by: Jacob Dahl <dahl.jakejacob@gmail.com>
Pulls in PX4/PX4-GPSDrivers#211 (astyle fixes: trailing whitespace in
sbf.cpp, missing brace-init space in ubx.h) so PX4-Autopilot's
make check_format passes on astyle 3.x.