18412 Commits

Author SHA1 Message Date
Jacob Dahl
b2fc5993cc
range_finder_consistency_check: fix consistency check timeout units (#26497)
* range_finder_consistency_check: fix consistency check timeout units

* explicit float

* format
2026-02-17 14:10:04 -09:00
Jacob Dahl
d5ddc9135d
clang-tidy: fix issues (#26498) 2026-02-17 14:09:43 -09:00
Silvan Fuhrer
11007dc893
FW auto launch: Add option to lock selected surfaces before/during launch (#25799)
* FWModeManager: add option to set flag for disabling actuators during launch

Signed-off-by: Silvan <silvan@auterion.com>

* Allocation: add option to each control surface to be locked for launch

Signed-off-by: Silvan <silvan@auterion.com>

* FW rate control: reset integral while control surfaces are locked

Signed-off-by: Silvan <silvan@auterion.com>

---------

Signed-off-by: Silvan <silvan@auterion.com>
Co-authored-by: mahima-yoga <mahima@auterion.com>
2026-02-17 09:26:38 +01:00
Claudio Chies
e52ce5c43b
UAVCAN: Configurable LED Light Control with Flexible Addressing (#26253)
* feat: implement UAVCAN LED control for individual light control and assignment

* uavcan led: nit-picks from review

* uavcan led: reduce maximum number of lights

to avoid unused parameters

* uavcan led: simplify anticolision on check

* uavcan led: correctly map 8-bit RGB to rgb565

* Trim param name character arrays to 17

16 characters + \0 termination

* uavcan led: final nit-picks

---------

Co-authored-by: Matthias Grob <maetugr@gmail.com>
2026-02-16 18:39:48 +01:00
nlsxp
302d0601bf
Smoothen external flight mode GotoControl to Mission transitions (#26254) 2026-02-13 14:06:47 +01:00
Ramon Roche
f29afe1342 logger: expand ULog unit tests to cover all message types
Rename ULogMessageInfoTest to ULogMessagesTest and add struct-level
coverage for every message type in the ULog spec:

- File header: magic bytes, size, field offsets
- Flag Bits ('B'): size, field offsets, flag masks
- Format ('F'): size, serialization
- Info ('I'): string, int32_t, and float value layouts
- Info Multiple ('M'): string layout, continuation flag, field offsets
- Parameter ('P'): int32_t and float value layouts
- Default Parameter ('Q'): size, type bits, field offsets
- Subscription ('A'): size, field offsets, serialization
- Unsubscription ('R'): size, serialization
- Data ('D'): size, field offset
- Logging ('L'): size, field offsets, serialization
- Logging Tagged ('C'): size, field offsets
- Sync ('S'): size, magic bytes
- Dropout ('O'): size, default msg_size, serialization
- Message header: size, field offsets, ULOG_MSG_HEADER_LEN
- Enum values: all 13 ULogMessageType codes

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-12 21:20:27 -08:00
Ramon Roche
497704f3b9 fw_mode_manager: pass FigureEightPatternPoints by const reference
The 48-byte struct (6 Vector2f) is only read inside initializePattern,
so passing by value creates an unnecessary copy.

Fixes performance-unnecessary-value-param clang-tidy diagnostic.

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-12 21:20:27 -08:00
Ramon Roche
b60aa5dd2b ekf2, fw_mode_manager, fw_rate_control: remove unused using declarations
Remove using-declarations for math::constrain, math::max, and
math::min that are never used — all call sites use the fully-qualified
form (e.g. math::constrain()).

Fixes misc-unused-using-decls clang-tidy diagnostic.

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-12 21:20:27 -08:00
Ramon Roche
5d151c54a4 flight_mode_manager: call direct parent instead of grandparent
FlightTaskManualAcceleration and FlightTaskOrbit both inherit from
FlightTaskManualAltitudeSmoothVel but were calling FlightTask and
FlightTaskManualAltitude respectively, skipping the intermediate
parent's overrides (smoothing velocity init, parameter chain).

Fix the DEFINE_PARAMETERS_CUSTOM_PARENT macro argument and the
activate() call to use FlightTaskManualAltitudeSmoothVel.

Fixes bugprone-parent-virtual-call clang-tidy diagnostic.

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-12 21:20:27 -08:00
Ramon Roche
83a4d648e3 logger: copy null terminator in write_info memcpy
clang-tidy flags the memcpy of vlen bytes as
bugprone-not-null-terminated-result because the destination buffer
region is left unterminated in memory.

Copy vlen + 1 bytes (including the source null terminator) so the
buffer is null-terminated in memory. The ULog msg_size is not
incremented for the extra byte — the null sits in the struct's
key_value_str padding and is never written to the log file, preserving
the ULog wire format which does not include a null terminator for
string values.

The bounds check (vlen < sizeof(msg) - msg_size) guarantees at least
one byte of headroom beyond vlen, so vlen + 1 is always within the
struct.

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-12 21:20:27 -08:00
Ramon Roche
0646fa6c9d logger: add unit test for ULog INFO message serialization
Add a gtest that validates the exact binary layout of INFO and
INFO_MULTIPLE messages against the ULog spec. This exercises the same
packing logic as write_info/write_info_multiple and will catch any
accidental changes to the wire format (e.g. including a null terminator
in msg_size).

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
767eb75662 gyro_fft: fix clang build error on Linux arm64
Extend the -Wno-asm-operand-widths workaround to include Linux aarch64
in addition to Apple Silicon. CMSIS DSP contains ARM Cortex-M specific
assembly that clang (but not gcc) warns about on 64-bit ARM platforms.

The assembly code is unused on POSIX builds - only the C fallback
implementations are executed in SITL.

This fixes clang-tidy CI failing on arm64 runners.

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-12 21:20:27 -08:00
Yannick Poffet
3e1b7d4d0a clean-up(SIH): remove confusing runtime uorb sub change 2026-02-11 12:14:54 +01:00
Hamish Willee
509b4ba96d MC_RAPTOR_INTREF module.yaml rendering fix 2026-02-11 13:16:02 +13:00
Jacob Dahl
3fb1459c33
ManualControl: fix payload power switch state when mapped with RC (RC_MAP_PAY_SW) (#26357)
* ManualControl: Payload Power Switch: default PAYLOAD_POWER_EN false if RC_MAP_PAY_SW is configured. Apply initial switch state for Payload Power

* make format

* ManualControl: init power_en in init()

* ManualControl: Apply payload power state on first switch receipt if not armed

* simplfy

* fix idefs

* simplify
2026-02-09 21:36:35 -09:00
Julian Oes
0294d4a794 dataman: increase stack size for littlefs
Increase stack size when using littlefs filesystem, which requires
more stack space than traditional filesystems.
2026-02-10 15:23:51 +13:00
Julian Oes
d411e1c40d logger: increase stack size for littlefs 2026-02-10 15:23:51 +13:00
Eric Katzfey
1dbee4100a uORB: Added a new uorb_shutdown function that is called during normal shutdown procedures. It will only
call into a new UORB COMMUNICATOR ICHANNEL shutdown interface if it has been configured, otherwise it
does nothing. This allows ICHANNEL implementations to pass on a shutdown indication to a remote processor.
Implemented the shutdown interface in the muorb module for VOXL flight controllers.
2026-02-09 15:21:41 -07:00
Nick
dbb00d500f Update src/modules/commander/failure_detector/FailureDetector.cpp
Prevent Buffer overflow
2026-02-09 18:08:26 +01:00
Matthias Grob
61a8ae80a6 FailureDetector: implement upper and lower current limit with offset 2026-02-09 18:08:26 +01:00
Matthias Grob
f8329ff80d FailureDetector: rework motor status check 2026-02-09 18:08:26 +01:00
Matthias Grob
b4b1b44c6a FailureDetector: consistent timestamp naming 2026-02-09 18:08:26 +01:00
Matthias Grob
f5a56ae42f escCheck: rework online check to properly report offline ESCs
previous to this
09d79b221f274523349a029e63ab4462e41d0c1c
set `esc_online_flags` e.g. for UAVCAN ESCs which specific one is online and that then got compared to a mask where the first `esc_count` bits were set.

So if only ESC 5 is mapped and online you get the message "ESC 156 offline" because `esc_online_flags = 0b1000` gets compared to `online_bitmask = 0b1` based on `esc_count = 1` and the motor index is `esc[0].actuator_function = 0` wrapped using `0 - actuator_motors_s::ACTUATOR_FUNCTION_MOTOR1 + 1 = 156`.
2026-02-09 18:08:26 +01:00
Marco Hauswirth
c4535683a7 ekf2 unit-tests: adapt to strict GNSS checks on ground 2026-02-09 10:59:58 +01:00
Matthias Grob
f9cdd095b8 gnss_checks: always run strict checks on ground
With the goal to never take off if the GNSS solution is not fullfilling the configured requirements still not stopping to use it in case it degrades mid air.
2026-02-09 10:59:58 +01:00
Matthias Grob
61c990c5ee estimator_interface: remove unused getter 2026-02-09 10:59:58 +01:00
Eric Katzfey
eb43d21730 voxl2_io: Added UART passthru 2026-02-08 20:51:31 -07:00
Beat Küng
446895fdc0 Revert "failsafe: prevent Hold when no action is taken (#26383)"
This reverts commit 40dc011d82f5b79c11718992200e60c8534929ca.

Not needed anymore
2026-02-06 13:00:08 +01:00
Beat Küng
3eb0255922 fix commander: do not trigger Hold (delay) when failsafe action is Warn
The new unit test failed before and passes with the fix.
2026-02-06 13:00:08 +01:00
Hamish Willee
271d3f01a3
Update mavlink/mavlink to latest[A (#26410) 2026-02-06 08:17:44 +13:00
Nick
40dc011d82
failsafe: prevent Hold when no action is taken (#26383) 2026-01-30 14:09:56 +01:00
Pernilla
8d97013822 Mavlink: increase stream rate of GIMBAL_DEVICE_ATTITUDE_STATUS 2026-01-30 13:06:58 +01:00
mahima-yoga
4e59a060a8 HomePosition: only set home position using GNSS if bit 0 in EKF2_GPS_CTRL is active
If the vehicle position is not set by GNSS, then the home position should not be either.
2026-01-30 11:20:34 +01:00
ttechnick
03264ce1a7 failsafe: prevent switch offboard -->pos without RC 2026-01-29 18:21:00 +01:00
Loic Fernau
b7d9876cd9
Added missing Defaults to VEHICLE_CMD_DO_SET_MODE (#26291)
* Added missing Defaults to VEHICLE_CMD_DO_SET_MODE

* Made Format
2026-01-29 05:36:21 +13:00
Balduin
0676647d8a
ControlAllocator: Periodically spin MC motors to shed ice (#26322)
This feature periodically spins the unused motors on VTOL airframes, to
break off ice that has built up in the motor while it is still feasible
to do so. Each ice shedding event sends a motor ouput of 0.01 to the
unused motors for 2 seconds.

Configured by `CA_ICE_PERIOD`, the duration of the entire cycle. Set to
0 to disable.
2026-01-27 11:15:24 +01:00
Balduin
50bb31491b
AirspeedModule: Change to throttle without battery scaling (#26347)
rather than the vehicle_thrust_setpoint used previously, which includes
battery scaling which we don't want, neither for synthetic airspeed nor
for the airspeed validator.
2026-01-27 11:03:44 +01:00
Niklas Hauser
c0c265cd1f [vtx] Add VTX driver with Tramp and SmartAudio support 2026-01-26 11:05:22 +01:00
David Meng
1cfab8feb2
mavlink: odometry: Initialize the covariance matrix to 0 to prevent the entire matrix from becoming invalid after mavros performs coordinate transformation. (#26321) 2026-01-24 12:52:13 -09:00
Silvan Fuhrer
32fc5cb5b9 RTL: only run initRtlMissionType() when new type is of any mission type
Otherwise it kills the mission when the type jumps from mission to Home.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2026-01-23 17:16:42 +01:00
Matthias Grob
7a6506f2dd rtl: redability suggestions from review, remove unused subscription 2026-01-23 17:16:42 +01:00
Silvan
a416437561 rtl: guard access of dynamically created _rtl_mission_type_handle behind if()
To avoid hard faults from NULL access.

Signed-off-by: Silvan <silvan@auterion.com>
2026-01-23 17:16:42 +01:00
Silvan
554b52c6a1 RTL: fix RTL_TYPE=2 with RTL_LAND_DELAY set to indefinitely wait
Signed-off-by: Silvan <silvan@auterion.com>
2026-01-23 17:16:42 +01:00
Silvan
fc992385a9 RTL: fix RTL_TYPE=2 stuck without valid mission
Signed-off-by: Silvan <silvan@auterion.com>
2026-01-23 17:16:42 +01:00
Silvan
0577a40440 RTL Direct: remove unnecessary sanitization
Signed-off-by: Silvan <silvan@auterion.com>
2026-01-23 17:16:42 +01:00
Matthias Grob
2239c10192 rtl: restructure findRtlDestination() to one flow 2026-01-23 17:16:42 +01:00
Matthias Grob
8117fce790 rtl: never set arbitrary yaw, initialize _destination and _last_position_before_link_loss with NAN 2026-01-23 17:16:42 +01:00
Matthias Grob
18c3d889fe rtl: keep rtl_status struct on stack 2026-01-23 17:16:42 +01:00
Matthias Grob
31c7d70342 rtl refactor: name destination "destination" 2026-01-23 17:16:42 +01:00