28695 Commits

Author SHA1 Message Date
bresch
2c044b327e ekf2: refactor airspeed starting logic
- avoids using invalid velocity estimate to reset wind
- do not set fusion flags if starting was impossible
- reset wind to 0 before resetting velocity using airspeed if wind data
  is outdated
2025-12-18 11:37:10 +01:00
isentek-webbyeh
b537601b7a
driver: ist8310: add IST8310J device ID support (#26134)
* driver: ist8310: add IST8310J device ID support and cross-axis compensation

IST8310J shares the same register map and initialization sequence as IST8310.

This change extends the existing IST8310 driver to:
- Accept the IST8310J device ID during probe and reset
- Load factory cross-axis calibration data from OTP
- Apply cross-axis compensation to raw magnetometer samples

The cross-axis compensation corrects factory axis misalignment only and
does not replace PX4 runtime magnetometer calibration.

Tested on Raspberry Pi using I2C with both IST8310 and IST8310J devices.

Signed-off-by: webbyeh <webbyeh@isentek.com>

* driver: ist8310: add IST8310J device ID support

IST8310J shares the same register map and initialization sequence as IST8310.

Factory cross-axis compensation support was evaluated but has been removed
in this revision due to flash size constraints on embedded targets. The
driver now focuses on device identification and stability, while relying on
the existing PX4 magnetometer calibration framework.

This commit also addresses review feedback by caching the WAI register value
to avoid redundant I2C reads during the reset wait state.

Tested on Raspberry Pi using I2C with both IST8310 and IST8310J devices.

Signed-off-by: webbyeh <webbyeh@isentek.com>

* Fix formatting issues in IST8310.cpp

---------

Signed-off-by: webbyeh <webbyeh@isentek.com>
Co-authored-by: Jacob Dahl <37091262+dakejahl@users.noreply.github.com>
2025-12-17 17:14:17 -09:00
Jacob Dahl
1d5a8531e4 update gps submodule 2025-12-17 10:33:21 -09:00
Jacob Dahl
e71348967d
gps: fix RTCM injection and enable MSM7 for PPK (#26095)
* serial: add txSpaceAvailable function

* serial: txSpaceAvailable and bytesAvailable fixups

* msg: GpsDump: increase queue from 8 to 16 and replace instance with device_id

* lib: gnss: add RTCM parsing library. Generated by Claude Code.

* gps: fix RTCM injection to use inject-before-read pattern as before. Add RTCM parser to frame-align injection. Drain GpsInjectData uORB queue into RTCM parser buffer and then inject. Add GPS_UBX_PPK parameter to enable MSM7 output from the GPS module (rather than the default of MSM4) which is required for PPK workflows.

* gps: replace PX4_WARN with perf counters
2025-12-17 10:20:00 -09:00
Jacob Dahl
fbe49db571
uavcannode: publisher: MovingBaseLine enhancements (#26092)
* uavcannode: publishers: MovingBaselineData: publish all GpsInjectData updates during BroadcastAnyUpdates. Check and report data loss via uorb generationcounter. Only registerCallback outside of the loop.

* remove unnecessary include
2025-12-17 10:18:17 -09:00
Jacob Dahl
4b36cfccfc
uavcan: gnss: MovingBaselineData subscriber (#26094)
* msg: GpsDump: increase queue from 8 to 16 and replace instance with device_id

* uavcan: gnss: MovingBaselineData subscriber for RTCM logging for PPK. Add uORB generation tracking to detect data loss on RTCM injection.

* add instance TODO
2025-12-17 10:17:56 -09:00
Jacob Dahl
699ec30c9c
logger: gps_dump non-optional (#26096) 2025-12-17 09:59:38 -09:00
Jacob Dahl
e6c49edd20
docs: battery: clarify BAT${i}_SOURCE parameter documentation (#26071)
* docs: battery: clarify Power Module option to state that it works additionally for onboard Analog

* Update src/lib/battery/module.yaml

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

* Update src/lib/battery/module.yaml

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

* Update src/lib/battery/module.yaml

* Apply suggestions from code review

* Update msg/versioned/BatteryStatus.msg

---------

Co-authored-by: Hamish Willee <hamishwillee@gmail.com>
2025-12-17 09:58:41 -09:00
Phil-Engljaehringer
3438d593a1
drivers: MCP23009 & MCP23017 shared code base (#25924)
* Implemented driver for MCP23017

* fixed compatability with mcp23009. (naming of instantiated GPIO-Devices)

* removed some comments

* removed even more comments

* commented out instatntiation of driver since it will not be used with v6x

* removed last useless comments

* re-activated gpio_mcp23009 driver, removed useless comments and empty lines

* removed empty lines at the end of mcp23017.cpp

* removed empty line

* Implemented driver for MCP23017

* fixed compatability with mcp23009. (naming of instantiated GPIO-Devices)

* removed some comments

* removed even more comments

* commented out instatntiation of driver since it will not be used with v6x

* removed last useless comments

* re-activated gpio_mcp23009 driver, removed useless comments and empty lines

* removed empty lines at the end of mcp23017.cpp

* removed empty line

* basic working implementation

* first improved driver version with shared code base for MCP23009 & MCP23017 (built as state machine with sanity checks)

* removed unused imports

* changed module name from MCP to MCP230XX

* removed debug print statements

* adjusted auto start command of driver

* removed comments

* -added seperate main functions for both derivative modules (mcp23009 and mcp23017)

* compile common functions as shared library in src/lib/drivers

* fixed cleanup of modules

* ->unclean working version with shared common library

* used make format

* working & cleaned version

* -> Added CallbackHandler to be able to use multiple reading GPIO-expanders simultaneously
-> Removed old mcap23009 calls and pin registrations
-> Adjusted GpioIn.msg to contain MAX_INSTANCES

* ->removed unused imports
->used make format

* Fix: Re-enabled platform_mcp_gpio for accton-godwit, cuav, fmu-v5x

* Fix: enabled platform_mcp_gpio in px4/fmu-v5x

* added depency to fmu-v5x

* Fix: removed new lines

* Fix: fixed linker errors

* removed unused linkage against mcp-library

* Made mcp start calls consistent for fmu-v5x and fmu-v6x

* moved logging of comm errors to read/write function directly

* added perf_count for sanity_check

* removed error message

* ensured member variables follow naming convention

* added retries to probe function

* simplyfied state-logic

* add break to terminate loop early

* ensured clean state when register_gpios() fails

* add registered-flag to pins

* used path from top dir instead of relative path in CMakeLists

* used constexpr to set parameters instead of calculating them at runtime

* style: used make format

* fix: corrected i2c_bus assignment

* style: init input of callbackhandler to 0

* fix: mark pin as registered if successful

* style: made arguments const type

---------

Co-authored-by: Alexander Lerach <alexander@auterion.com>
2025-12-17 17:48:30 +01:00
dirksavage88
38f89a8b69 remove extraneous newlines
Signed-off-by: dirksavage88 <dirksavage88@gmail.com>
2025-12-17 17:12:12 +01:00
dirksavage88
3e290695ef fix to check q
Signed-off-by: dirksavage88 <dirksavage88@gmail.com>
2025-12-17 17:12:12 +01:00
Andrew Brahim
11bf3cffde Update src/lib/drivers/rangefinder/PX4Rangefinder.hpp
Co-authored-by: Jacob Dahl <37091262+dakejahl@users.noreply.github.com>
2025-12-17 17:12:12 +01:00
dirksavage88
ba4437ae60 revert to passing raw pointer and length
Signed-off-by: dirksavage88 <dirksavage88@gmail.com>
2025-12-17 17:12:12 +01:00
dirksavage88
b64860f9f8 consolidated into update method; use default value in declaration
Signed-off-by: dirksavage88 <dirksavage88@gmail.com>
2025-12-17 17:12:12 +01:00
dirksavage88
e51d09612f vl53l1x quaternion example
Signed-off-by: dirksavage88 <dirksavage88@gmail.com>
2025-12-17 17:12:12 +01:00
dirksavage88
eb1c0322e3 rangefinder update quaternion
Signed-off-by: dirksavage88 <dirksavage88@gmail.com>
2025-12-17 17:12:12 +01:00
bresch
ccaad82f61 mc_att: remove dependency to heading_god_for_control
Absolute heading is not required in stabilized mode and a change in
heading convergence is already handled by the StickYaw class using
unaided_heading
2025-12-17 16:59:47 +01:00
Claudio Chies
24d06047bd
UAVCAN: Add device tracking and information publishing (#25617)
* uavcan: collect node info and publish every second

* UORB: Add DeviceInformation Message

Format DeviceInformation.msg with standard comment spaces

* SENS: add getter for device_id

* UAVCAN: add publishing of DeviceInformation based on publised message type, and Node Information

* LOG: add deviceInformation

* MSG:BAT: fix comment to be inline with the max_instaces

* UAVCAN: DeviceInformation, incorporated feedback

* UAVCAN: DeviceInformation, incorporated feedback

* UAVCAN: DeviceInformation, Fixed bug with Powermonitor

---------

Co-authored-by: Beat Küng <beat-kueng@gmx.net>
2025-12-16 14:53:44 -09:00
Pedro Roque
cb682006fe
fix: esc status sizing fix for gz simulation
* init: working towards dual-action ATMOS

* fix: update gz sim to latest

* fix: add motor number max fitting Actuator

* fix: revert non-necessary changes

* fix: ensure esc count does not exceed maximum number of ESCs

* fix: remove extra modules

* fix: sync submodules with remote

* fix: sync with main
2025-12-16 15:46:51 -08:00
Jacob Dahl
5632728467
lib: gnss: add RTCM parsing library (#26093)
* lib: gnss: add RTCM parsing library. Generated by Claude Code.

* lib: gnss: rtcm: use rtcm3_payload_length()

* lib: gnss: rtcm: set header year

* lib: gnss: rtcm: add units tests

* Update src/lib/gnss/rtcm.h

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update src/lib/gnss/CMakeLists.txt

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update src/lib/gnss/rtcm.h

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* remove mention of reset()

* lib: gnss: rtcm: more effecient preamble search

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-12-16 09:28:10 -09:00
Jacob Dahl
778ad160f2
msg: GpsDump: queue 8->16 and add device_id (#26091)
* msg: GpsDump: increase queue from 8 to 16 and replace instance with device_id

* gps: add back instance
2025-12-16 08:36:02 -09:00
Marco Hauswirth
8393f46100
Ekf2 add jamming to gnss checks (#26085)
* add jamming check to gnss checks

* keep original order of gnss_check params for default backwards compability
2025-12-16 10:10:37 +01:00
Brandon W. Banks
1345b3500a
Vehicle command for Prearm Safety button (#26079)
* added vehicle command and support to remotely activate/deactivate the safety system (#26078)

* added print_status support for prearm safety status

* updated safety button to map to MAV_CMD_DO_SET_SAFETY_SWITCH_STATE = '5300'

* safety switch cmd: fixed incorrect catch-all and added commanded_state variable for easier reading
2025-12-15 11:25:32 -09:00
Balduin
8604604a5b
logged_topics: clean up old commented-out topics (#26120) 2025-12-15 09:53:24 -09:00
bresch
d62f112017 ekf2: prevent false mag fault detection
A false positive could be triggered if velocity fusion started,
then stopped after takeoff and only position fusion started again
(because velocity fusion timed out and had a timestamp > time_last_on_ground).
We now also check if the fusion timeout is due to the innovation being
rejected (and not just a temporary check failure or data interruption).
2025-12-15 14:06:04 +01:00
Julian Oes
5fe82aa485
[Sponsored by CubePilot] Try to fix potential mavlink segfaults on USB disconnect (#26083)
* mavlink: fix potential use-after-free

If a mavlink instance is force stopped, the main thread might be out of
scope and the receiver thread would be doing a use-after-free.

Instead the receiver thread needs to check its own _should_exit flag.

* mavlink: protect shared data by mutex in dtor

I'm not sure if this potentially fixes any of the segfaults we have seen
on stopping mavlink instances but it potentially could matter if the
mavlink_receiver thread is killed after a timeout and tries to send any
messages as a zombie.
2025-12-12 12:24:02 -09:00
Alex Klimaj
12745baf6c
Adds configurable I2C address for PCA9685 PWM driver (#26051)
* Adds configurable I2C address for PCA9685 PWM driver

Introduces a parameter to set the I2C address for the PCA9685 PWM output driver, enhancing flexibility for hardware variations. Updates documentation and board initialization scripts to support the new configuration and streamline device startup.

* Update src/drivers/pca9685_pwm_out/module.yaml

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update src/drivers/pca9685_pwm_out/module.yaml

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Jacob Dahl <37091262+dakejahl@users.noreply.github.com>
2025-12-12 09:31:19 -09:00
Jacob Dahl
c25fcabcc6 esc_battery: fix current reporting 2025-12-12 11:17:24 -07:00
Jacob Dahl
67d62cb371 Revert "gps: fix RTCM injection to use inject-before-read pattern as before. Add RTCM parser to frame-align injection. Drain GpsInjectData uORB queue into RTCM parser buffer and then inject. Add GPS_UBX_PPK parameter to enable MSM7 output from the GPS module (rather than the default of MSM4) which is required for PPK workflows."
This reverts commit 0704580a30bb319fddc8c036675996a3e7202704.
2025-12-11 21:32:26 -09:00
Jacob Dahl
0704580a30 gps: fix RTCM injection to use inject-before-read pattern as before. Add RTCM parser to frame-align injection. Drain GpsInjectData uORB queue into RTCM parser buffer and then inject. Add GPS_UBX_PPK parameter to enable MSM7 output from the GPS module (rather than the default of MSM4) which is required for PPK workflows. 2025-12-11 20:10:22 -09:00
Kyle Fitzpatrick
3ebb47d53f TemperatureCompensationModule: fix order of temp cal args 2025-12-05 08:49:23 -09:00
mahima-yoga
18477554e0 wind-estimator: learn airspeed scale faster at beginning of flight
Multiply TAS scale process noise by 100 during the first 5 minutes
when ASPD_SCALE_n = 1.0 (default), enabling faster convergence on first flights.
2025-12-05 16:26:11 +01:00
Mahima Yoga
bcd67b7bad
ekf: enable constant position fusion during engine warm-up (#26041)
In cold weather, fuel engines need to be warmed up. Currently, this is done by switching to stabilized mode and throttle up. The issue is that when not using GNSS data, the vehicle is not detected as "at rest" due to vibrations and cannot switch into auto/takeoff modes.

If EKF2_ENGINE_WRM is enabled, and if the vehicle is armed and landed, constant position fusion is enabled.
2025-12-05 15:08:37 +01:00
mahima-yoga
ca83b8330d autotune: enable autotune in mission mode
When operating fully autonomously (i.e., without manual control or a guaranteed link to the ground station), tuning a vehicle can be difficult since the current autotune process requires either RC input or a GCS command. For these scenarios, it it useful to be able to start autotune inside a mission.
2025-12-05 14:03:10 +01:00
Farhang
a7de5d176f
Permission error gz build fix (#25921) 2025-12-04 07:52:02 -05:00
Jaeyoung Lim
5df20b8e9b
Add custom gz airspeed plugin and add wind effects (#26018)
* Add px4 custom airspeed sensor

* Format fix
2025-12-01 08:56:40 -08:00
MarkieMark
980956496b
ICE Control Module: Added option for VTOL state (FW/Transition to FW) to start engine (#25948)
* ICE Control Module: Added option to use VTOL transition state to trigger ICE on/off states

Signed-off-by: Mf-ff99 <force.j.mark@gmail.com>

* ran make format

Signed-off-by: Mf-ff99 <force.j.mark@gmail.com>

* Update src/modules/internal_combustion_engine_control/InternalCombustionEngineControl.cpp to initialize vtol_vehicle_status_s correctly

Initialize appropriately

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

* ICE Module: adjusted VTOL logic to use vehicle_status

Signed-off-by: Mf-ff99 <force.j.mark@gmail.com>

---------

Signed-off-by: Mf-ff99 <force.j.mark@gmail.com>
Co-authored-by: Jacob Dahl <37091262+dakejahl@users.noreply.github.com>
2025-12-01 16:46:51 +01:00
mahima-yoga
0985c22701 [fix] autotune: fix indentation on _state_start_time in abort logic 2025-11-28 09:31:37 +01:00
Julian Oes
0618b0b529
mavlink: GNSS_INTEGRITY and GLOBAL_POSITION are WIP (#26012)
These two messages are still work in progress, only defined in the
development.xml MAVLink dialect. Therefore, we need to ifdef them.
2025-11-28 11:41:38 +13:00
bresch
4fbff2cdd9 fw gain compression: add docs 2025-11-27 17:33:06 +01:00
bresch
3646032296 fw rate: add gain compression algorithm 2025-11-27 17:33:06 +01:00
Tarmo Tänav
ad38dba167 crsf_rc: fixed cmake directory conflict 2025-11-26 15:52:33 -09:00
Onur Özkan
8874d533bb add fast-path mavlink forwarding for single instance
Counts active mavlink instances atomically when instances
are claimed or released and uses that value to early-exit
the forwarding logic.

It means on single-instance scenarios this will skip taking
the mavlink_module_mutex lock and will not iterate over
mavlink_module_instances on every received message.

Signed-off-by: Onur Özkan <work@onurozkan.dev>
2025-11-26 10:35:40 -09:00
Matthias Grob
c8286d4bba Remove COM_RC_ARM_HYST
I've never anyone seen change that value and break the familiar user experience.
2025-11-26 09:58:19 -09:00
Nick
575fa0850b
PWM: Add servo center setting & asymetric deflection (#25897)
Add PWM_*_CENTERx for each servo.
Use a bilinear transform to map actuator_servos to PWM signals.

This solution only works for PWM based servos. Other types of servos are not affected.

* PWM: Add servo trim option

* PWM: Improve documentation of PWM trim feature

* PWM: cleaner clamping and docs typo

* update documentation & safety

* add migration formula

* rename param from trim to center

* docs with center instead of trim

* move clamping and reorder values

* improve documentation

* adress failing range check

* improve documentation

* CA: add event for setting CENTER with TRIM

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

---------

Signed-off-by: Silvan <silvan@auterion.com>
Co-authored-by: Silvan <silvan@auterion.com>
2025-11-26 18:12:25 +01:00
Balduin
6caf4f0942
ekf2: fuse airspeed & beta only in fronttransition and fixed wing (#25980)
This allows airspeed and sideslip fusion to start during VTOL front
transition, but not in backtransition or MC. This mitigates issues seen
due to going in and out of airspeed fusion in strong headwinds in MC.

Co-authored-by: bresch <brescianimathieu@gmail.com>
2025-11-26 16:29:19 +01:00
Niklas Hauser
0ce60fd528 Revert "[crsf_rc] Allow setting the baudrate via parameter"
This reverts commit 7a9b04c67c25e4b9eb2feef8a89a53a6c3e25b9c.
2025-11-26 15:09:00 +01:00
Nick
93d767ab51
Airspeed Filter: add filter to airspeed for scaling (#25908) 2025-11-26 12:38:17 +01:00
Michael Schaeuble
d97a8d7d3b mode: control auto set home from an external mode
The mode executor can run land mode which updates the home position to the landing location. This
can be not the desirable behavior and the home position should stay at the original location.

A flag is added to the configuration overrides to control if the home position is updated or not.
2025-11-26 10:16:54 +01:00
Michael Schaeuble
a2299b02c8 modes: make available modes user selectable with a registration option
Some modes should only be run within the context of a mode executor and the user should not be able
to select them in the GCS. With this change, the external component registration request can be
used to set if a mode is selectable or not.
2025-11-26 10:04:53 +01:00