Commit Graph

49035 Commits

Author SHA1 Message Date
asimopunov
dd7c47b7e3 fix(precland): use home position for precland altitude (#21260) 2026-03-18 00:32:35 -08:00
PX4BuildBot
0ac48b663c docs: auto-sync metadata [skip ci]
Co-Authored-By: PX4 BuildBot <bot@px4.io>
2026-03-18 08:11:31 +00:00
Eurus
305306ad1c fix(rtl_mission_fast_reverse): correct mission index assignment on activation (#26380)
After #25648, when performing RTL mission fast reverse, the vehicle would go to the waypoint before the previous one (i.e., two waypoints back). If the drone was already on its way to the first waypoint at that moment, it would even fly to the second waypoint first, and only then reverse back toward the takeoff point. This PR fixes that bug. #25648 was intended to address issues with NAV_CMD_CONDITION_GATE. The modification proposed in this PR also correctly bypasses NAV_CMD_CONDITION_GATE waypoints.
2026-03-18 00:04:44 -08:00
PX4BuildBot
a8313ffb79 docs: auto-sync metadata [skip ci]
Co-Authored-By: PX4 BuildBot <bot@px4.io>
2026-03-18 05:22:45 +00:00
Nick
5b1a0e7236 feat(drivers): silence TMP102 driver startup (#26776) 2026-03-17 21:15:30 -08:00
Jacob Dahl
45edfc1830 fix(docs): fix Python 3.8 SyntaxError in generate_msg_docs.py (#26788)
Line 319 used nested quotes inside f-strings, a feature only available
in Python 3.12+. The CI Docker image (px4-dev-base-focal:2021-08-18)
runs Python 3.8, causing the "msg file docs" Jenkins stage to fail on
every main build since 6bf73d9d89.

Extract the join expressions into local variables to restore
compatibility with Python 3.8+.
2026-03-17 21:07:42 -08:00
PX4BuildBot
6a238ef853 docs: auto-sync metadata [skip ci]
Co-Authored-By: PX4 BuildBot <bot@px4.io>
2026-03-18 04:04:29 +00:00
Silvan Fuhrer
89af91dbdb fix(npfg): use NFPG_DAMPING and NPFG_PERIOD to calculate directional p gain (#26765)
Signed-off-by: Silvan <silvan@auterion.com>
2026-03-17 20:57:29 -07:00
PX4BuildBot
3b28390a2e docs: auto-sync metadata [skip ci]
Co-Authored-By: PX4 BuildBot <bot@px4.io>
2026-03-18 02:37:49 +00:00
Jacob Dahl
4b2e0a6f59 feat(sensors/gps): add per-receiver GPS delay parameters (#26660)
* sensors: add per-receiver GPS delay parameters

Add SENS_GPS{0,1}_DELAY params to vehicle_gps_position, following the
same device-ID matching pattern used for antenna offsets. Each receiver
can now have its own measurement delay relative to the IMU.

The delay is applied to timestamp_sample before blending. When PPS time
correction is active it takes priority over the parameter-based delay.
When a GPS driver already provides its own timestamp_sample the
per-receiver delay is not applied on top of it.

* fix(ekf2): remove EKF2_GPS_DELAY and perform param transation

* fix(param_translation): fix GPS param migration return values

Add missing return for EKF2_GPS_POS_Z and remove incorrect return for
EKF2_GPS_DELAY (1-to-many migration should not return PARAM_MODIFIED).

* fix(sensors,ekf2): rename pps_compensation and clarify delay default

* fix(ekf2): account for SENS_GPS*_DELAY in observation buffer sizing

* fix(docs): migrate EKF2_GPS_DELAY param
2026-03-17 18:19:08 -08:00
PX4BuildBot
533b2d677c docs: auto-sync metadata [skip ci]
Co-Authored-By: PX4 BuildBot <bot@px4.io>
2026-03-18 02:16:44 +00:00
Hamish Willee
b1d25d05be docs(bug): Fix up typo to BATTERY_STATUS_DEMO (#26787) 2026-03-18 13:09:35 +11:00
PX4BuildBot
1f9911289c docs: auto-sync metadata [skip ci]
Co-Authored-By: PX4 BuildBot <bot@px4.io>
2026-03-18 01:41:01 +00:00
Jacob Dahl
89855926ef feat(sensors/gps): move GPS antenna offsets to per-receiver parameters (#26634)
* sensors: move GPS antenna offsets to per-receiver parameters

Move antenna position configuration from the single EKF2_GPS_POS_X/Y/Z
parameter set into per-receiver SENS_GPS{0,1}_OFF{X,Y,Z} parameters in
the sensors module. Each offset slot is matched to a physical receiver
by device ID (SENS_GPS{0,1}_ID), falling back to uORB instance index
when no IDs are configured.

The antenna offset is now carried through the SensorGps uORB message
and blended alongside other GPS states when multi-receiver blending is
active, so EKF2 receives the correct lever arm for whichever receiver
(or weighted combination) is selected.

- Add antenna_offset_{x,y,z} fields to SensorGps.msg
- Remove EKF2_GPS_POS_X/Y/Z params; EKF2 reads offset from gnssSample
- Add SENS_GPS{0,1}_ID and SENS_GPS{0,1}_OFF{X,Y,Z} params (module.yaml)
- Blend antenna offsets in GpsBlending (weighted average)
- Add unit tests for single, blended, and failover antenna offset cases
- Migrate params.c to module.yaml for the vehicle_gps_position module

* sensors: gps_blending: add asymmetric weight and fallthrough offset tests

Add two additional antenna offset test cases:

- dualReceiverAsymmetricWeightAntennaOffset: verify that unequal eph
  values produce correctly skewed blend weights (0.8/0.2) and that the
  output antenna offset reflects the weighted average
- blendingFallthroughAntennaOffset: verify that when blending is enabled
  but can_do_blending evaluates false (eph=0), the non-blending path
  correctly assigns the selected receiver's antenna offset

* feat(param_translation): translate EKF2_GPS_POS_ to SENS_GPS0_OFF_

* fix(msgs): proper formatting

* chore(msg): 0 if invalid/unknown

* fix(ROMFS): migrate EKF2_GPS_POS_ params

* fix(docs): migrate EKF2_GPS_POS_ params

* fix(blending): unsigned param

* Update msg/SensorGps.msg

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

* fix(sensors/gps): remove 'values:' tag in  module.yaml

* fix(sensors/gps): unsigned instance index

* fix(blending): restore const on gps_blend_states()

Move antenna offset blending into blend_gps_data() where the
weights are computed, keeping gps_blend_states() const.

* fix(sensors/gps): fix msg annotation and restore SENS_GPS_PRIME values

Remove incorrect @invalid NaN annotation from antenna offset fields
(0.0 default is correct, not a sentinel). Restore values tag for
SENS_GPS_PRIME so QGC shows a dropdown.

* fix(gps_blending): fix pre-existing bug to clear _gps_updated flags

The loop iterates over i but always clears gps_select_index. The intent is to clear
all updated flags, but only the selected one gets cleared (N times)

* test(gps_blending): add stale update flag regression test
2026-03-17 17:33:41 -08:00
PX4BuildBot
b597227da6 docs: auto-sync metadata [skip ci]
Co-Authored-By: PX4 BuildBot <bot@px4.io>
2026-03-18 00:46:16 +00:00
Jacob Dahl
f00e46f618 feat(dshot): Extended Telemetry and EEPROM support
Overhauls the DShot driver with per-timer BDShot selection, multi-timer                                                                                                                                  
sequential capture, Extended DShot Telemetry (EDT), and AM32 ESC EEPROM                                                                                                                                  
read/write via MAVLink. Expands ESC support from 8 to 12 channels.                                                                                                                                       
                                                                                                                                                                                                   
BDShot:                                                                                                                                                                                                  
- Per-timer BDShot protocol selection via actuator config UI                                                                                                                                             
- Multi-timer sequential burst/capture on any DMA-capable timer                                                                                                                                          
- Adaptive per-channel GCR bitstream decoding                                                                                                                                                            
- Per-channel online/offline detection with hysteresis                                                                                                                                                   
                                                                                                                                                                                                   
Extended DShot Telemetry (EDT):                                                                                                                                                                          
- Temperature, voltage, current from BDShot frames (no serial wire)                                                                                                                                      
- New DSHOT_BIDIR_EDT parameter                                                                                                                                     
- EDT data merged with serial telemetry when both available                                                                                                                                              
                                                                                                                                                                                                   
AM32 EEPROM:                                                                                                                                                                                             
- Read/write AM32 ESC settings via MAVLink ESC_EEPROM message                                                                                                                                            
- ESCSettingsInterface abstraction for future ESC firmware types                                                                                                                                         
- New DSHOT_ESC_TYPE parameter                                                                                                                                                                           
                                                                                                                                                                                                   
Other changes:                                                                                                                                                                                           
- Per-motor pole count params DSHOT_MOT_POL1–12 (replaces MOT_POLE_COUNT)                                                                                                                              
- EscStatus/EscReport expanded to 12 ESCs with uint16 bitmasks                                                                                                                                           
- Numerous bounds-check, overflow, and concurrency fixes                                                                                                                                                 
- Updated DShot documentation
2026-03-17 16:38:33 -08:00
PX4BuildBot
c9ee06ff17 docs: auto-sync metadata [skip ci]
Co-Authored-By: PX4 BuildBot <bot@px4.io>
2026-03-17 21:12:26 +00:00
Matthias Grob
09cb22f799 refactor(commander): remove unused parameter COM_MOT_TEST_EN 2026-03-17 12:56:18 -08:00
ghohl-30
9a5034b187 commander: fix typo in COM_RC_STICK_OV documentation (#26777) 2026-03-17 12:44:20 -08:00
Matthias Grob
efdd1e021f fix(rcS): reset the flight mode assignments during an airframe reset (#26773)
* fix(rcS): reset the flight mode assignments during an airframe reset

because there are many products that have a default flight mode assignment in the airframe file and if the user resets to airframe defaults the flight mode assignment stays custom and doesn't get reset to "factory settings". It's neither a unit specific calibration nor a parameter to track total flights or flight time. I suggest to reset it as well.

* fix(posix rcS): sync airframe reset with the px4 common startup script

to make simulation testing of an airframe reset more realistic.
2026-03-17 12:43:27 -08:00
PX4BuildBot
89068128cb docs: auto-sync metadata [skip ci]
Co-Authored-By: PX4 BuildBot <bot@px4.io>
2026-03-17 20:14:33 +00:00
Marco Hauswirth
f2608089fd fix(commander): decouple heading preflight check from attitude mode requirement 2026-03-17 20:47:12 +01:00
PX4BuildBot
c7c0e830f1 docs: auto-sync metadata [skip ci]
Co-Authored-By: PX4 BuildBot <bot@px4.io>
2026-03-17 19:44:30 +00:00
Marco Hauswirth
9fd967c857 fix(lib/events): add missing POSITION_SLOW and ALTITUDE_CRUISE to navigation_mode_groups 2026-03-17 20:27:52 +01:00
PX4BuildBot
b066181512 docs: auto-sync metadata [skip ci]
Co-Authored-By: PX4 BuildBot <bot@px4.io>
2026-03-17 17:54:55 +00:00
ttechnick
c5b8eee4c3 fix(fw_att_control): fix comments / docs 2026-03-17 17:59:20 +01:00
ttechnick
3601a01594 feat(fw_att_control): limit turn coordination to normal flight 2026-03-17 17:59:20 +01:00
ttechnick
ca4ae7cf41 feat(fw_att_control): use Axis angles instead of Euler Angles 2026-03-17 17:59:20 +01:00
ttechnick
22cad6ebf7 fix(fw_att_control): guard against 0 in param 2026-03-17 17:59:20 +01:00
ttechnick
c0e7086d90 feat(fw_att_control): add derrivation of formulas
refactor(fw_att_control): move error calc to function
2026-03-17 17:59:20 +01:00
ttechnick
82bf75df0f docs(fw_att_ctrl): update quat turn coordination
fix(fw_att_control): use correct formula
2026-03-17 17:59:20 +01:00
ttechnick
a42e7ebb2a feat(fw_att_control): add yaw rotation unit test 2026-03-17 17:59:20 +01:00
bresch
c71e196dcf feat(fw q att control): improve pitchrate tracking using turn coordination constraint
refactor(fw_att_control): clean-up & optimization
2026-03-17 17:59:20 +01:00
ttechnick
00f952ed93 feat(fw_att_control): yaw error reallocation 2026-03-17 17:59:20 +01:00
ttechnick
7e5aca5540 feat(fw_att_control): magic numbers 2026-03-17 17:59:20 +01:00
ttechnick
fdf258c2aa docs(fw_att_control): update docs 2026-03-17 17:59:20 +01:00
ttechnick
11ffa179bb docs(fw_att_control): update docs 2026-03-17 17:59:20 +01:00
ttechnick
c4330f5a47 feat(fw_att_control): tilt-tracking controller 2026-03-17 17:59:20 +01:00
ttechnick
e370b3f4b8 feat(fw_att_control): Add Initial Quat Controller + Debug topic
This commit introduces a new control mode for fixed-wing aircraft that
utilizes Euler angles for attitude control.
Additionally, a new logged topic has been added to facilitate debugging and
monitoring of the Euler rates setpoints during flight.
2026-03-17 17:59:20 +01:00
Eric Katzfey
9136c66b7e fix(voxl2): Added explicit port identifier on gps start command 2026-03-17 09:03:32 -07:00
PX4BuildBot
2ca42e5252 docs: auto-sync metadata [skip ci]
Co-Authored-By: PX4 BuildBot <bot@px4.io>
2026-03-16 23:14:52 +00:00
Jacob Dahl
1e5a485424 docs(dronecan): add SENS_GPS_PRIME guidance for moving baseline GPS heading (#26769)
Recommend setting SENS_GPS_PRIME to the moving base CAN node ID
when using dual antenna GPS heading. The rover receiver in a
moving baseline configuration can experience degraded navigation
rate and increased data latency when corrections are intermittent,
making the moving base the better primary position source.
2026-03-16 15:06:41 -08:00
Gennaro Guidone
00b27c56a8 fix(mixer_module): change MixingOutput to use float outputs (#26724)
* refactor(mixer_module): change MixingOutput to use float outputs

MixingOutput now passes float values to output drivers instead of
uint16_t. This removes the need for the 8192 offset encoding and
allows reversible motors to receive negative values directly.

* fix(mixer_module): fix float safety issues

-EscClient and voxl2_io: replace outputs[i] with fabs(outputs[i]) > 0.fto fix compilation issues
-GZMixingInterface: add explicit double cast to prevent compilation error
-PWMSim: replaced unit16 cast with lroundf given that now motors outputs can be negative and casting a negative float to unit16 is undefinder behaviour
-mixer_module: same fix of PWM (unit126 cast on negative float is undefined behaviour)

* refactor(mixer_module): float rounding suggestions

* fix(pwm_sim): fix inverted disarmed condition

* fix(mixer_module): more float rounding improvements

* fix(mixer_module_tests): use casting method which are now in drivers for rounding tests

---------

Co-authored-by: Matthias Grob <maetugr@gmail.com>
2026-03-16 14:59:53 -08:00
Jacob Dahl
26c9ca115f fix(mathlib): rename euler312YawTest to match tested function (#26753)
* fix(mathlib): rename euler312YawTest to match tested function

The test calls getEuler321Yaw() but was named euler312YawTest.

Fixes #22103

* test(mathlib): add unit test for getEuler312Yaw

The existing test was named euler312YawTest but actually tested
getEuler321Yaw. Rename it and add a proper test for getEuler312Yaw
that verifies the quaternion and DCM overloads agree, and that
312 and 321 yaw match for a pure-yaw rotation.

Fixes #22103
2026-03-16 14:52:23 -08:00
Jacob Dahl
ba5b96edbe fix(boards): correct GPIO_VDD_3V3_SENSORS_EN macro name (#26751)
* fix(fmu-v6c): correct GPIO_VDD_3V3_SENSORS_EN macro name

VDD_3V3_SENSORS_EN() referenced GPIO_VDD_3V3_SENSORS4_EN which
does not exist. The correct macro is GPIO_VDD_3V3_SENSORS_EN.

Fixes #26454

* fix(boards): rename VDD_3V3_SENSORS4_EN to VDD_3V3_SENSORS_EN

These boards have a single sensor power rail that was incorrectly
named SENSORS4_EN (copy-paste from boards with 4 rails). Rename
to SENSORS_EN to match the actual hardware.

Boards with legitimately numbered rails (fmu-v6xrt, x25-evo,
x25-super) are not changed.
2026-03-16 14:51:47 -08:00
Jacob Dahl
a107179ce7 fix(commander): fix baro calibration infinite loop (#26752)
In dd2322d622, the local PressureToAltitude(pressure_pa, temperature)
was replaced with the shared getAltitudeFromPressure(pressure_pa,
pressure_sealevel_pa), but the call sites continued passing temperature
where sea-level pressure was expected. This caused the binary search to
never converge, hanging "commander calibrate baro" indefinitely.

The original function used measured temperature in its hypsometric
equation. The replacement uses standard atmosphere temperature (15C)
internally, which is sufficient since the calibration computes a
relative offset against GPS altitude.

- Pass kPressRefSeaLevelPa as the second argument instead of temperature
- Remove the now-unused temperature accumulation
- Replace unbounded while loop with iteration-capped for loop to prevent
  hangs from float precision stalls, matching VehicleAirData.cpp
2026-03-16 14:51:12 -08:00
Jacob Dahl
d04858efe0 fix(uavcan): silence DroneCAN DSDL compiler build warnings (#26757)
Fix Python DeprecationWarning for invalid escape sequence in pyratemp.py
and replace deprecated FindPythonInterp CMake module in libuavcan.
2026-03-16 14:49:21 -08:00
Jacob Dahl
0b2e554202 refactor(voxl_esc): pass vehicle_control_mode_s and led_control_s by const reference 2026-03-16 14:48:13 -08:00
Jacob Dahl
7d9484e7a6 refactor(flight_mode_manager): pass follow_target_s by const reference 2026-03-16 14:48:13 -08:00
Jacob Dahl
37745a97d3 refactor(navigator): pass PositionYawSetpoint and loiter_point_s by const reference 2026-03-16 14:48:13 -08:00