18489 Commits

Author SHA1 Message Date
ttechnick
c5652b2084 escChecks: param reorg
Reorganise parameters
fix esc & motor indices
set failsafe flags
2026-03-12 18:30:51 +01:00
ttechnick
03fc051c29 uavcan:fix check 2026-03-12 18:30:51 +01:00
ttechnick
96c5c7ba02 work on: feed back checks to commander 2026-03-12 18:30:51 +01:00
ttechnick
e9874b6f05 ensure motor faults are cleared 2026-03-12 18:30:51 +01:00
ttechnick
15f5a18629 uavcan: cleanup 2026-03-12 18:30:51 +01:00
ttechnick
b2ea7ffab6 fd: reorganise motor & esc failures 2026-03-12 18:30:51 +01:00
ttechnick
9f978b05f3 uavcan: unify timeout handling 2026-03-12 18:30:51 +01:00
Jacob Dahl
55b62e5f2b fix(mavlink): use >= for depth check to match MAX_DEPTH semantics 2026-03-11 19:50:36 -07:00
Jacob Dahl
8d99569643 fix(mavlink): bound recursion depth in delete_all_logs
Prevent potential stack overflow from symlink loops or deeply nested
directories by capping recursion to 3 levels. Also fixes dot-entry
skipping to use strcmp instead of prefix check, and deduplicates the
filepath construction.
2026-03-11 19:50:36 -07:00
Ege Kural
d72d99f2d8
fix(ci): clang-tidy bugprone-too-small-loop-variable(#26709) 2026-03-11 08:18:53 -07:00
Balduin
e5071beaa3 fix(ekf2): fuse airspeed in both transition if above EKF2_ARSP_THR 2026-03-11 10:08:32 +01:00
Daniel Hadlow
454b690c4b Height fusion now only rotates ev samples if they are FRD 2026-03-10 11:14:51 +01:00
yulianoifa-mobius
358574f9f6
feat(mavlink): mavlink signing support (#25284)
* Applying PR #17084

* Comitting missing changes

* Adding incoming SETUP_SIGNING handling

* Adding proper message decoding for SETUP_SIGNING

* Adding persistance of sign key in chunks of 32 bits into parameters

* Allowing SETUP_SIGNING to be handled only on usb_uart

* Removing unused type and variable

* Changing the default for Mavlink Timestamp

* Fixing styling

* Merging

* Merging submodules

* Replacing parameters with sdcard storage for secured key and ts

* Fixing styles

* Isolating signing related items in separate class

* Adding new files

* Syncing with main

* Fixing styles

* Changing the signing logic to work only if key and ts properly initialized, adding store the ts on stop

* Updated submodules to latest versions

* Updated gz to proper version

* libfc-sensor-api to proper version

* libcanard to proper version

* Updated fuzztest to proper version

* Updated public_regulated_data_types to proper version

* Updated mip_sdk to proper version

* Updated pydronecan to proper version

* Updated rosidl to proper version

* Fixing styles

* Fixing cyclonedds version

* initializing sign control in the member declaration

* Update src/modules/mavlink/mavlink_main.h

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

* Fixing comments

* Fixing duplicate method

* Fixing defines

* Fixing styles

* Fixing the define errors

* replace duplicate logic with write_key_and_timestamp() function

* add docs

* Update docs/en/mavlink/message_signing.md

Co-authored-by: Julian Oes <julian@oes.ch>

* Update src/modules/mavlink/mavlink_sign_control.cpp

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

* Update src/modules/mavlink/mavlink_sign_control.h

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

* Update docs/en/mavlink/message_signing.md

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

* rename to MAV_SIGN_CFG, fix copyright dates, fix docs SHA type, rename secrets file

* fix newlines

---------

Co-authored-by: Jacob Dahl <37091262+dakejahl@users.noreply.github.com>
Co-authored-by: Jacob Dahl <dahl.jakejacob@gmail.com>
Co-authored-by: Julian Oes <julian@oes.ch>
Co-authored-by: Hamish Willee <hamishwillee@gmail.com>
2026-03-09 12:47:03 -08:00
Marco Hauswirth
48b6ec84bd
fix(simulation): use correlated gauss-markov noise for SIH-GPS (#26697) 2026-03-09 11:39:29 -08:00
Mathieu Bresciani
1a0b7dae9d
fix(ekf2): remove heading corrections from gravity fusion (#26694) 2026-03-09 11:31:44 -08:00
Balduin
029edb50b3 refactor(control_allocation): Clarify and enforce that motors are in matrix 0 2026-03-09 17:10:32 +01:00
Balduin
b6164107d1 refactor(control_allocation): Make type alias for actuator bitmask 2026-03-09 17:10:32 +01:00
Balduin
af3cfaea25 fix(control_allocator): Apply stopped motors before slew
So transitions between stopped/not stopped respect the slew rate.

 - Remove previous stopped motor handling in publish_actuator_controls
 - Replace with handle_stopped_motors, called in Run() before slew
 - Introduce ApplyNanToActuators in ControlAllocation to stop
 - Refactor ice shedding slightly to fit new structure
2026-03-09 17:10:32 +01:00
Balduin
ee636a0e3d refactor(control_allocator): Remove slew rate from ice shedding
Will be unified with main output slew rate in commit just after
2026-03-09 17:10:32 +01:00
ttechnick
1dadd92a86 refactor(mavlink): reword mission transfer timeout 2026-03-09 16:26:41 +01:00
Marco Hauswirth
3e396f65e5
fix(navigator): fix alt setpoint after home-alt reset (#26662)
fix(navigator): skip mission alt update for non-position items
2026-03-09 15:39:21 +01:00
Jeff Katz
5cdf5ac482
fix(commander): calibration CPU starvation on linux (#26608)
On Linux targets with high-rate external sensor data (>1000Hz), all
sensor calibrations (gyro, accel, mag) can freeze PX4 by starving
other threads of CPU. Normal flight is unaffected — only calibration
triggers the problem.

Two compounding issues in the calibration worker threads:

1. calibrate_cancel_check() creates a new uORB::Subscription on every
   call, which triggers getDeviceNodeLocked() — an O(n) linear strcmp
   scan through all uORB nodes. In gyro/mag calibration this was called
   on every sensor sample, consuming the majority of CPU in strcmp alone.

2. SubscriptionBlocking::updatedBlocking() returns immediately when data
   is already available (it only blocks when no data is pending). With
   continuous high-rate sensor data, the calibration loops never yield,
   spinning at 100% CPU.

These problems are addressed with this patch as follows:

- Throttle calibrate_cancel_check() to once per 200ms in gyro
  and mag calibration loops.

- Add 1ms px4_usleep() yield before updatedBlocking()/updateBlocking()
  in all calibration loops (gyro, accel, mag, orientation detection).
  This caps the effective loop rate at ~1000Hz — still far above what
  calibration needs (250-750 samples).

- Force Commander main loop to sleep during calibration so it does not
  compete with calibration worker threads for CPU.

Tested under Linux (x64, aarch64) both with RT and non-RT scheduling,
with sensor data arriving at ~3600Hz. Calibration completes normally
and no longer results in a deadlocked process.
2026-03-06 10:11:24 -09:00
Luka Filipovic
6558928069
zenoh: fix default config topic type to use actual uORB topic name (#26564) 2026-03-05 17:32:14 -09:00
Balduin
16d938cda9
Ice shedding: fix docs rendering (#26616)
In the CA_ICE_PERIOD param description, a '>' was at the start of a
line. This is interpredeted by markdown as a quotation type indented
block which applies not only to that line, but to all following ones.
Changing the line breaks to only occur after full stops fixes it.
2026-03-05 20:25:40 +11:00
Balduin
fa2d1c3662
SIH Simulator: Add wind (#26467)
* SIH: explicitly use local velocity for all aerodynamic calculations

no functional change

* SIH: add param & vars for wind and apparent vel

no functional change

* SIH: replace all relevant vels with apparent vel

Only places where _v_E is remaining:
 - ecefToNed to calculate _v_N
 - generate_rover_ackermann_dynamics
 - equations_of_motion
 - parameters_updated, init_variables
and _v_N:
 - ecefToNed
 - print_status
 - publish_ground_truth
 - generate_rover_ackermann_dynamics
 - equations_of_motion
 - parameters_updated, init_variables

which are all not relevant for aerodynamics.

* sih: wind review suggestions

* sih wind: switch direction to global wind source direction convention

* SIH: clean up variable declarations

* SIH: rename variables for consistency

* docs: SIH: document new wind parameters

* Release notes: note for SIH wind settings

---------

Co-authored-by: Matthias Grob <maetugr@gmail.com>
2026-03-05 08:53:39 +01:00
Jacob Dahl
88a57c5b65 logger: add sensor_gnss_relative to High Rate Sensors 2026-03-04 10:10:16 -09:00
Leonardo Cencetti
de9698e7fa
zenoh: Add support for ROS2 Humble and earlier (#26619)
* Add support for hash-less Zenoh topic key expressions

- Add kConfig option ZENOH_KEY_TYPE_HASH to toggle the inclusion
- Update topic and liveliness generators

* chore: Update Zenoh kConfig param description and help message

* docs(zenoh): Document Zenoh configuration for Humble

* docs: Clarify PX4 ROS2 Interface library compatibility
2026-03-04 10:00:58 -09:00
Matthias Grob
ebc2093e52 Parachute check: clarify error message and parameter description wording 2026-03-04 17:42:28 +01:00
gguidone
6b51eddecc Added failsafe if parachute is not detected mid flight 2026-03-04 17:42:28 +01:00
Marco Hauswirth
906b87581c
fix: revert debugging section of distance_sensor in dds-subscription (#26643) 2026-03-04 11:33:48 +01:00
Matthias Grob
18a07d2d7c
mavlink_receiver: revert blanket command rejection by frame enum (#26626) 2026-03-03 12:09:47 -09:00
Marco Hauswirth
defab5114d
ekf2: relax gnss vel/pos soft start test-ratios (#26625) 2026-03-03 12:08:52 -09:00
Marco Hauswirth
7f5de5d141
uxrce_dds: support multi-instance uORB topics (#26305)
uxrce_dds: improve DDS to uORB multi-instance routing and docs

* Route single DDS topic to multiple uORB instances via message field
* Document route_field → instance mapping
* Allow subscriptions_demux without route_field
* Rename subscriptions_demux → subscriptions_multi
* Update docs (ROS 2 wording, version tip, minor fixes)
2026-03-03 15:57:24 +01:00
Jacob Dahl
9c2e8aff0f
battery: remove unused param BAT_I_CHANNEL (#26590) 2026-03-02 13:28:14 -09:00
MaZeNHeKaL29
6bf4745144
navigator: MissionFeasibility: rename checkFixedWindLandApproach() (#26603)
* navigator:MissionFeasibility rename checkFixedWindLandApproach() to checkFixedWingLandApproach()

Renames checkFixedWindLandApproach() to checkFixedWingLandApproach() to fix a typo in the function name.

This improves code readability and makes the function name consistent with the intended FixedWing landing approach logic, without changing behavior.

* navigator:MissionFeasibility rename checkFixedWindLandApproach() to checkFixedWingLandApproach()

Renames checkFixedWindLandApproach() to checkFixedWingLandApproach() to fix a typo in the function name.

This improves code readability and makes the function name consistent with the intended FixedWing landing approach logic, without changing behavior.
2026-03-02 13:24:41 -09:00
Matthias Grob
9cb3ea44fb
sih: cleanup initializing variables in constructor (#26578) 2026-03-02 13:22:35 -09:00
CaFeZn
963a776fa6
feat(heater): Add multi-instance support for heaters (#26325)
* heater: add multi-instance support, refactor parameter handling, remove legacy params file

This change introduces multi-instance heater support to allow independent temperature control for multiple IMUs.

Main changes:
- Add support for multiple heater instances
- Refactor parameter handling to use per-instance parameters
- Remove the legacy parameter file and migrate to the updated parameter structure

This improves scalability and makes heater configuration consistent across setups with multiple sensors.

* Refactor heater configuration across multiple boards

- Updated heater GPIO definitions to introduce a new naming convention for better clarity and consistency.
- Replaced `GPIO_HEATER_OUTPUT` with `GPIO_HEATER1_OUTPUT` and adjusted the corresponding output enable macros.
- Changed parameter names from `SENS_TEMP_ID` to `HEATER1_IMU_ID` in various board default configurations to reflect the new heater setup.
- Ensured all affected board configurations are updated to maintain functionality with the new heater definitions.

* heater: fix missing HEATER1_OUTPUT_EN control

* heater: fix more missing HEATER1_OUTPUT_EN control

* heater: tidy config, docs, and instance handling

- Remove unused controller period member and use CONTROLLER_PERIOD_DEFAULT
- Improve HEATER${i}_IMU_ID description and instance-related logging/behavior
- Add a guard when HEATER_NUM exceeds HEATER_MAX_INSTANCES

Note: drop intermediate/reverted change around the 'celsius' spelling.

* heater: refactor constructor to remove unused parameter and add instance name function

- Remove unused ModuleParams argument from Heater constructor
- Add heater_instance_name() helper to provide per-instance work queue task names
- Use instance-specific parameter lookup (HEATER{n}_*) during initialization

Use heater_instance_name() to label each instance (heater_1/2/3) in work queue.
Also drop unused ModuleParams argument from constructor and keep per-instance
parameter handle lookup in initialization.

* format

* board: update GPIO configuration for multiple heater instances, add HEATER_NUM for boards using PX4IO

* heater: update heater control to use HEATER1_OUTPUT_EN when using PX4IO for consistency

* heater: add a TODO for px4io multi-instance

* heater: update missing GPIO_HEATER1_OUTPUT in  sky-drones

* heater: fix multiple newlines at EOF (resolve CI check failure)

* heater: switch to PublicationMulti for heater_status and log multi-instance

- Changed _heater_status_pub from Publication to PublicationMulti to support independent per-instance publications without overwriting.
- Updated logged_topics.cpp to use add_optional_topic_multi("heater_status")

This fixes the issue where multiple heater instances were writing to the same heater_status topic, causing data overwriting and incorrect update rates in logs.

---------

Co-authored-by: Jacob Dahl <dahl.jakejacob@gmail.com>
Co-authored-by: Jacob Dahl <37091262+dakejahl@users.noreply.github.com>
2026-03-02 12:13:08 -09:00
Hamish Willee
9e41ffd537
docs:Fix in-source broken links in modules and airframes ref (#26611) 2026-03-02 18:18:00 +11:00
Jacob Dahl
1550c8d245 battery: remove analog_battery_params_deprecated.c 2026-02-27 19:33:05 -09:00
zhaosheng.tan
d495014878 mavlink: fix invalid param handle check in send_autopilot_capabilities
Fix logic error where `mnt_mode_in` (value) was checked against `PARAM_INVALID`
instead of `param_handle`. This caused `param_get` to be called with an invalid
handle if the parameter was missing.
2026-02-27 19:32:32 -09:00
Marco Hauswirth
fab9874183
Mavlink: GLOBAL_POSITION for aux positioning (#26307)
* mavlink: add GLOBAL_POSITION message handling
- Add handler for incoming GLOBAL_POSITION MAVLink messages
- Publish received positions to aux_global_position uORB topic
- Update GLOBAL_POSITION stream to use aux_global_position topic
* correctly handle multi AGP in mavlink pub
* move from GLOBAL_POSITION to GLOBAL_POSITION_SENSOR
* mavlink: update submodule to include GLOBAL_POSITION_SENSOR in common.xml
2026-02-27 17:50:45 +01:00
Marco Hauswirth
57a380d8ec ekf2: fix silent pass of preflt heading check if no heading src active 2026-02-27 13:26:47 +01:00
Alexander Lerach
9ff373c325
modules: add task watchdog (#26535)
* modules: add task watchdog

* modules: adapt task watchdog to new module descriptor

* add review feedback
2026-02-27 13:09:21 +01:00
Ege Kural
d317113dc8
CI: enable clang-tidy bugprone-assignment-in-if-condition (#26580)
* docs: auto-sync metadata [skip ci]

  Co-Authored-By: PX4 BuildBot <bot@px4.io>

CI: enable clang-tidy bugprone-assignment-in-if-condition

Signed-off-by: kuralme <kuralme@protonmail.com>

initialize and immediate assignments made one line

Signed-off-by: kuralme <kuralme@protonmail.com>

* two more initialization fix

Signed-off-by: kuralme <kuralme@protonmail.com>

---------

Signed-off-by: kuralme <kuralme@protonmail.com>
Co-authored-by: PX4BuildBot <bot@px4.io>
2026-02-27 00:04:45 -09:00
Jonas Perolini
bea52104b7
AirspeedValidator: fix course over ground computation for NED frame (#26304)
* AirspeedValidator, fix course over ground computation for NED frame

* fix potential out of bounds call

---------

Co-authored-by: jonas <jonas.perolini@rigi.tech>
2026-02-26 09:18:09 +01:00
bresch
5395b3823a ekf2: disable heading update in drag fusion 2026-02-25 15:40:01 +01:00
Hamish Willee
8a8496d57e
mavlink:COMMAND_INT - reject invalid frame (#26408)
* mavlink:COMMAND_INT - reject invalid frame

* Add msg version for new command and use

* Delete msg/px4_msgs_old/msg/VehicleCommandAck.msg:Zone.Identifier

* Fix up translation

* fix: translation_node build

Signed-off-by: Beniamino Pozzan <beniamino.pozzan@gmail.com>

---------

Signed-off-by: Beniamino Pozzan <beniamino.pozzan@gmail.com>
Co-authored-by: Beniamino Pozzan <beniamino.pozzan@gmail.com>
2026-02-25 20:29:59 +13:00
Ege Kural
a5c67b90a9
CI: enable clang-tidy bugprone-incorrect-roundings (#26574)
switched to lroundf and included cmath in all



removed std namespace - quick tested

Signed-off-by: kuralme <kuralme@protonmail.com>
2026-02-24 13:16:33 -09:00
Ege Kural
207456fd35
CI: enable clang-tidy cppcoreguidelines-virtual-class-destructor (#26559)
* CI: enable clang-tidy cppcoreguidelines-virtual-class-destructor

Signed-off-by: kuralme <kuralme@protonmail.com>

* format fix

Signed-off-by: kuralme <kuralme@protonmail.com>

---------

Signed-off-by: kuralme <kuralme@protonmail.com>
2026-02-23 19:21:20 -09:00
Ege Kural
8fd3d3268a
CI: enable clang-tidy readability-duplicate-include (#26554)
Signed-off-by: kuralme <kuralme@protonmail.com>
2026-02-23 16:54:36 -09:00