Commit Graph
2989 Commits
Author SHA1 Message Date
Matthias Grob abda07efe4 fix(navigator): use yaw acceptance timeout by default
MIS_YAW_TMT defaults to 10s, counted from when the heading is commanded, so a multicopter with low yaw authority continues instead of getting stuck.
Forced heading in a mission still fails the mission.
VTOLs only wait for forced headings.
2026-11-05 16:54:27 +01:00
Beniamino Pozzan 97edba71fd feat(sitl): select uXRCE-DDS or Zenoh at runtime
SITL users who want Zenoh had to build the separate px4_sitl_zenoh
target, so the prebuilt packages and containers could only talk
uXRCE-DDS. Build both clients into the SITL default board (and thereby
SIH) and pick one at startup instead.

PX4_ROS2_MIDDLEWARE=uxrce_dds|zenoh|none selects the middleware and is
stored in ZENOH_ENABLE, so without the variable the persisted parameter
decides; uXRCE-DDS stays the default. rcS keeps only this selection and
sources px4-rc.uxrce_dds or px4-rc.zenoh for the client startup. The
Zenoh one maps ROS_DOMAIN_ID to ZENOH_DOMAIN_ID and applies
PX4_ZENOH_LOCATOR, when set, as the router address.

The container entrypoint follows the uXRCE-DDS start command into its
new file so Docker Desktop keeps routing DDS to the host.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Beniamino Pozzan <beniamino.pozzan@gmail.com>
2026-11-04 15:51:34 +00:00
4964fa5995 feat(sensors/gnss): select the GNSS receiver on failures and the strict checks (#28798)
* feat(sensors/gnss): select the GNSS receiver on failures and reported accuracy

The interim selection took the receiver with the best fix type and the most satellites, and the preferred one whenever it had a 3D fix. Fix type and satellite count compare poorly across receivers, and nothing held a switch, so a one-sample fix blip flipped the output and back.

A preferred receiver (SENS_GNSS_PRIME, or with -1 the moving base of a moving base pair) is used until it fails: no usable, on-time sample for 2 s, or clearly less available than the other receiver. The selection returns to it once usable again, after 10 s while armed. Without one, it moves after 5 s to a receiver reporting at most half the eph and no worse epv, floored at 5 cm. SENS_GNSS_PRIME defaults to -1. vehicle_gnss carries the reason for the last switch, sensors_status_gnss each receiver's availability. GpsBlending becomes GnssSelector.

Co-authored-by: Andrea Bernasconi <andrea.bernasconi@auterion.com>
Assisted-by: Claude:claude-opus-5-5

* docs(sensors/gnss): rewrite the SENS_GNSS_PRIME description

The description walked through the selection's internal timings and thresholds, and claimed that every switch resets the EKF2 position, which it doesn't while another source constrains the position. The availability comment left out that late samples count as unavailable.

Assisted-by: Claude:claude-opus-5-5

* fix(sensors/gnss): update the selection while no receiver publishes

The selector and sensors_status_gnss only updated when a sample arrived. When every receiver stopped, the last status kept reporting the receiver healthy and available, the receiver never timed out, and on its return the gap counted as available time.

Co-authored-by: Andrea Bernasconi <andrea.bernasconi@auterion.com>
Assisted-by: Claude:claude-opus-5-5

* refactor(sensors/gnss): keep the GNSS samples in the module, not the selector

The selector stored full samples and antenna offsets only to hand them back, a leftover from blending; it reads just each sample's timestamp, eph and epv. The module now keeps every receiver's latest sample and publishes the selected one, which is the sample its checks ran on, and the heading path reads the receiver state from it instead of copying every receiver out of uORB. A timed-out receiver is reset in one place, without the writes to the fix type and satellite count that only blending ranked on.

Assisted-by: Claude:claude-opus-5-5

* feat(sensors/gnss): rank receivers on the requirements and RTK fix, without returning to a failed one

The eph ratio switched receivers on reported accuracy alone, and the 10 s return to the primary went back to a receiver likely to fail again in the same flight, at the cost of another EKF2 position reset. While disarmed, the selection fell back to the other receiver, so a vehicle could take off on it with a failing primary.

While disarmed the primary is now selected whenever it publishes, so commander reports its failed checks before arming. While armed, a receiver left because it failed is selected again only when the selected one fails, until disarmed. Without a primary, receivers rank by meeting GNSS_REQ_EPH/EPV/SACC/FIX, which GnssChecks now also evaluates in flight, then by an RTK fixed solution; the selection moves up after 10 s armed or 2 s disarmed.

Assisted-by: Claude:claude-opus-5-5

* feat(gnss_checks): always run strict checks to have the information for the selection algorithm, switch to simplified checks in-air when the strict checks fail

* feat(GnssSelector): rework selection algorithm

* fix(lib/gnss): pass the checks again and relax them only after a strict pass

493c86ce58 set the fail time on every sample that hadn't passed yet, including samples still inside the required pass duration, so the duration restarted on every sample and no receiver ever passed: EKF2 never fused GNSS. It also relaxed the checks only while flying, so a vehicle armed on the ground lost GNSS for GNSS_REQ_TIME on a single strict failure, and a receiver that first published in flight got the relaxed checks without ever passing the strict ones.

The relaxed checks apply again once the strict ones passed, until disarmed on the ground. The strict checks still run on every sample, and meetsRequirements() is their result for that sample, without a pass duration: the selection holds its own, and a duration here would turn one failed sample into GNSS_REQ_TIME of not meeting the requirements. Once relaxed, only the relaxed checks are reported as failed.

* fix(sensors/gnss): restore failover and switch holds, leave a primary that misses the requirements

a23b25aa3b failed over to the preferred receiver where it meant the higher ranked one, which selects instance -1 without a preferred receiver, read the availability of instance -1, stayed on a failed primary whose late samples still met the requirements, and replaced a failed receiver only with one that met the requirements or was far more available. Without the hold, two receivers whose RTK fixed solutions came and went switched on every change, each switch an EKF2 position reset.

Its design stays: the primary is kept while it meets the requirements and left when it hasn't met them through the hold while the other receiver has. Receivers rank by being usable, then meeting the requirements, then, without a primary, an RTK fixed solution, and the primary ranks above an equal receiver that meets them. So it is taken back once it meets them through the hold, unless it failed, and an RTK fixed solution never outranks it, as a moving-base rover reports one while being the worse position source. A silent or failed receiver is replaced at once by the best publishing or usable one, a rank switch waits 10 s armed and 2 s disarmed, and while disarmed the primary is selected only while it publishes, so that a vehicle without it still has a position and the pre-arm check reports the missing primary. getSelectionReason() returns a value set in update().

* feat(sensors/gnss): double the switch hold with every rank switch in a flight

The hold rides through changes shorter than 10 s, but a receiver that goes in and out of the requirements for longer still costs two EKF2 position resets per cycle, for as long as it keeps doing so: under sustained interference, switching is worse than staying on one receiver and letting the failsafes act. Doubling the hold with every rank switch while armed, up to 160 s, bounds the switches in a flight while a single recovery, such as the corrections coming back, still returns after 20 s. Failovers keep switching at once.

* fix(sensors/gnss): report a receiver as healthy only while the selection can use it

sensors_status_gnss.healthy took only the checks into account, while the selection also requires samples at the receiver's usual rate. A receiver whose rate collapsed showed as healthy next to its falling availability and the selection leaving it, and commander's redundancy check counted it.

* docs(releases): note the SENS_GNSS_PRIME default change in the upgrade guide

Setups that never set SENS_GNSS_PRIME move from preferring the main serial receiver to Auto without migration.

* fix(sensors/gnss): learn a receiver's lower update rate instead of failing it for good

The late threshold followed the shortest interval a receiver ever reached, so a receiver that slowed to below a third of its rate had every sample late from then on and stayed out of the selection, although receivers slow down for reasons that don't make their samples worse, such as processing RTCM corrections. With the no-return rule, a primary that slowed down was left for the rest of the flight.

Samples are now late against the receiver's recent interval, which follows a lower rate within a sample: only the first sample at the lower rate is late, so a single gap still counts. Below about 1 Hz the first two intervals at the lower rate still add up to the 2 s that fail a receiver.

* feat(lib/gnss): meetRequirements() requires to pass the strict checks for min_health_time_us. Report checks as strict for as long as the strict checks pass.

* refactor(lib/gnss/test): remove hardcoded min_health_time_us from setParams(GnssChecks::Params params) method

* feat(sensors/gnss):  restructure receiver selection

- don't select a previously failing receiver as better if the current is still usable and hasn't failed
- priority of availability over higher rank (and preferred), but still choose the highest rank (or preferred) in case multiple have high availability

* fix(sensors/gnss): prefer the primary receiver only while it meets the requirements

Once both receivers missed the requirements, the selection moved back to the primary after the hold: an EKF2 position reset with no better receiver to show for it. The primary is kept while it meets the requirements; when neither does, nothing favours it.

* docs(lib/gnss): describe when meetsRequirements() restarts its pass duration

The comments still said that meetsRequirements() holds no pass duration and that strict() is true only before the first pass. A sample that fails only the strict checks deliberately doesn't restart the duration once the relaxed checks apply, so that one bad sample doesn't drop the receiver's rank for GNSS_REQ_TIME and switch it away after the selection's hold.

* refactor(sensors/gnss): name the two GNSS check sets strict and relaxed

The same two sets of checks went by strict, initial fix, requirements, simplified, pre-flight and in-flight, and failed_checks reported whichever set decided usable, so its meaning changed with the vehicle state. Each result now names its set: vehicle_gnss and sensors_status_gnss report failed_strict_checks and failed_relaxed_checks for every sample, and strict says which of them decides usable. In code the sets are runStrictChecks() and runRelaxedChecks(), the held strict result is passedStrict(), and the selector ranks on RANK_STRICT and reports SELECTION_STRICT. No behaviour changes.

* refactor(ekf2): drop EKF2_REQ_SACC and the GNSS restart wait, move the heading wait to EKF2_GPS_YAW_RST

EKF2 kept its own copies of two GNSS check thresholds after the checks moved to the sensors module. Whether a receiver's sample is good is the sensors module's call and reaches EKF2 on vehicle_gnss; EKF2 keeps only waits about its own estimate.

Trusting GNSS vertical velocity while the accelerometer clips, and feeding GNSS velocity to the yaw estimator, now use the sample's strict speed accuracy check (GNSS_REQ_SACC) from vehicle_gnss.failed_strict_checks, evaluated on every sample, also in flight. vehicle_gnss.usable alone would not do: in flight the relaxed checks decide it, which only bound the speed accuracy at 10 m/s.

The wait before GNSS fusion restarts after EKF2 stops it only reproduced the requalification EKF2 forced by resetting the checks when they lived in EKF2. GNSS_REQ_TIME now does that in the sensors module, and a restart after a stop EKF2 decided on its own is already gated on GNSS agreeing with the estimate. The replay test output is unchanged.

The wait before a yaw reset to the GNSS heading after a heading fusion failure or a spoofing or jamming report is EKF2's own and moves to EKF2_GPS_YAW_RST. Saved EKF2_REQ_SACC and EKF2_REQ_GPS_H values migrate to GNSS_REQ_SACC and GNSS_REQ_TIME.

* fix(sensors/gnss): checking for better availability now works both ways

* test(sensors/gnss): add unit test for availability taking precedence over rank. Assisted by Codex 6.1 Sol

* refactor(lib/gnss): name the relaxed-checks gate _initial_strict_checks_passed

"since disarm" read as the moment of disarming, while the flag is cleared on every sample the vehicle sits disarmed on the ground.

Assisted-by: Claude:claude-opus-5-5

* refactor(ekf2): keep starting_conditions_passing in the GNSS fusion control

The other aid source controls decide a start on starting_conditions_passing; keep that structure even though it now equals the continuing conditions.

Assisted-by: Claude:claude-opus-5-5

* fix(sensors/gnss): keep the strict rank through a failure shorter than the fail time

In flight a sample that fails the relaxed checks restarts GNSS_REQ_TIME for passedStrict(), and GNSS_REQ_TIME (10 s) is as long as the armed switch hold. A one-second failure on the primary receiver, such as a spoofing flag, therefore switched to the other receiver after the hold and back once the doubled hold passed: two EKF2 position resets for a blip.

A receiver now gains the strict rank only once its strict checks held for GNSS_REQ_TIME, and keeps it while its samples pass them until it fails (FAIL_TIME_US without a usable sample). occasionalFailureDoesNotSwitch kept passed_strict true through the failures, which GnssChecks never reports, so it missed this.

Assisted-by: Claude:claude-opus-5-5

* fix(sensors/gnss): report a receiver unhealthy only once the selection fails it

healthy followed isUsable(), which goes false for a single sample arriving 300 ms late. The commander's GNSS redundancy check counts healthy receivers without hysteresis, so with SYS_HAS_NUM_GNSS set one late sample triggered the GNSS loss failsafe, and with two receivers it reported "GPS n unhealthy". healthy now means usable within FAIL_TIME_US (2 s), when the selection fails over; that still covers a receiver whose rate collapsed below about 1 Hz.

Assisted-by: Claude:claude-opus-5-5

* fix(sensors/gnss): count receiver availability from arming

While disarmed the strict checks keep a receiver unusable for GNSS_REQ_TIME after every failure, and the availability kept counting that time. Arming within a few seconds of the primary receiver requalifying after a ground outage left the other receiver more available by over 0.2 for the whole armed hold, so the selection left a healthy primary 10 s after arming and returned 20 s later. Availability is meant to catch intermittent failures in flight, so it now starts over at arming.

Assisted-by: Claude:claude-opus-5-5

* fix(sensors/gnss): don't count a receiver that hadn't qualified at arming as failed in flight

While disarmed the primary receiver is selected whenever it publishes, even before it passes its checks. Armed in that state, the selection failed over at once and marked the primary failed for the flight, so it was never used again even after it passed its checks, while a primary that was silent at arming is taken once it qualifies. A receiver is now marked failed only if it was working at some point since arming.

Assisted-by: Claude:claude-opus-5-5

* docs(sensors/gnss): correct the selection comments and parameter descriptions

The AVAILABILITY_MARGIN comment described a half margin the code never applied, SELECTION_RTK_FIXED claimed both receivers pass the strict checks, and SENS_GNSS_PRIME said the primary returns after 10 s, while the doubled hold makes the first return take 20 s, and left out switches on availability. GNSS_REQ_SACC now says it also gates the EKF-GSF yaw estimator and the GNSS vertical velocity while the accelerometer clips, which turning off the speed accuracy check disables. Drops _time_usable_since_us, which nothing read.

Assisted-by: Claude:claude-opus-5-5

* docs(releases): list the GNSS check parameters that moved from EKF2

EKF2_GPS_CHECK, EKF2_REQ_* and EKF2_REQ_GPS_H are migrated to GNSS_CHECK, GNSS_REQ_* and GNSS_REQ_TIME, but the upgrade guide had no entry for them, and the GNSS rename entry still said the EKF2 parameters were unchanged.

Assisted-by: Claude:claude-opus-5-5

---------

Co-authored-by: Jacob Dahl <dahl.jakejacob@gmail.com>
Co-authored-by: thomas <thomas@rigi.tech>
2026-10-19 20:18:40 -06:00
Michael Rogov Papernov f20fda6e9c build(romfs): drop the px4io firmware image when the driver is not built (#29318)
With CONFIG_DRIVERS_PX4IO=n the px4io firmware image is still copied into
the ROMFS.

Skip the image when the driver is not built. This saves 38384 bytes of
FLASH.

Assisted-by: Claude:claude-fable-5-1

Signed-off-by: Michael Rogov Papernov <michael@membrowse.com>
2026-10-19 20:16:06 -06:00
Ahmet Burak Tektas 55e3d0ab22 fix(airframes): set CA_ROTOR_COUNT in three airframe scripts (#29274)
4901_crazyflie21 and 3011_jsbsim_hexarotor_x describe their rotors with
CA_ROTORn_* but never set CA_ROTOR_COUNT, whose default of 0 leaves the
control allocator without motors. The Crazyflie script lost the line in
b70b19b7eb; the hexarotor never had it.

1002_standard_vtol.hil set the count to 5 and then, in the quad X block
from b70b19b7eb, to 4, which left out the forward thrust motor.

Assisted-by: Claude:claude-opus-5-5

Signed-off-by: A.Burak Tektas <15087318+Abtektas@users.noreply.github.com>
2026-10-16 17:09:43 -06:00
Benjamin Cabé c76ba712e0 fix(romfs): add the missing space in tune_control play -t 17
Assisted-by: Claude:opus-5.5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-10-14 12:10:40 +02:00
E-Krantz 1ff6b8e3d6 feat(atmos): add ATMOS-DUAL airframe (#29056) 2026-10-12 11:19:10 -07:00
Jacob Dahl de52c98eff feat(cannode): bootloader update from the app and combined flash image (#28293)
* feat(bl_update): pet the watchdog during erase and program

CAN nodes start the IWDG in the bootloader, and nothing else pets it
while bl_update holds the scheduler lock.

Assisted-by: Claude:claude-opus-5-5

* feat(nuttx): emit canbootloader to board extras and build bootloader+app image

canbootloader builds now write extras/<vendor>_<board>_bootloader.bin
like FMU bootloader builds do, which plugs CAN nodes into the existing
ROMFS / rc.board_bootloader_upgrade / jlink wiring. CAN node app builds
with that file also emit <config>_with_bootloader.bin (bootloader padded
to the app's ELF load address, followed by the CRC'd image) so a bare
board is flashed in one SWD step instead of two.

Assisted-by: Claude:claude-opus-5-5

* feat(cannode): run rc.board_bootloader_upgrade at startup

The hook was only wired into the FMU rcS, so SYS_BL_UPDATE did nothing
on CAN nodes even with bl_update built in.

* feat(ark): enable bootloader update on CAN nodes

Ships the CAN bootloader in the app ROMFS so a node can rewrite it via
SYS_BL_UPDATE without SWD.

Assisted-by: Claude:claude-opus-5-5

* docs(dronecan): bootloader update and combined image for CAN nodes

Assisted-by: Claude:claude-opus-5-5

* build(ark): rebuild CAN node bootloaders from current main

The committed binaries predated the F412 chip-selection and linker fixes
and the NuttX 12.12 upgrade, so they no longer matched the source.

Assisted-by: Claude:claude-opus-5-5

* feat(uavcannode): update the bootloader as soon as SYS_BL_UPDATE is set

Same approach as AP_Periph. Running the update on the next boot needed
two reboots and reported nothing over CAN: it ran before uavcannode
started, and the boot script printed "done" even when bl_update failed.
The node now flashes while running, skips an identical bootloader, and
the result reaches the flight controller through the existing log
message forwarding. A value left set from before boot is cleared rather
than acted on.

The flash routine moves into a library so uavcannode can call it.

Assisted-by: Claude:claude-opus-5-5

* docs(dronecan): note that the combined CAN node image resets parameters

Found on the bench: the padding between bootloader and app covers the
parameter sectors, so every SWD flash of the combined image erases them.

Assisted-by: Claude:claude-opus-5-5

* fix(nuttx): limit CAN bootloader extras and combined image to STM32

Every canbootloader build wrote its binary to the board's extras, so a
later nxp_ucans32k146 default or cyphal configure picked it up and failed
in prepend_bootloader.py: the S32K application loads at 0x6000, below
the 0x08000000 base the script and bl_update assume. CI only passed
because the canbootloader was built after both had configured.

Assisted-by: Claude:claude-fable-5-1

* fix(bl_update): pad the image before erasing and warn on every flash failure

The STM32F4 up_progmem_write() returns -EINVAL for an odd byte count,
which was only found out after sector 0 had been erased. An erase or
program failure also leaves the board without a bootloader, but only a
verify failure told the user to retry before rebooting.

Assisted-by: Claude:claude-fable-5-1

* fix(romfs): pack rc.board_bootloader_upgrade only where rcS runs it

CAN nodes with bl_update carried the script in their ROMFS although the
cannode rcS never sources it: uavcannode flashes the bootloader itself.

Assisted-by: Claude:claude-fable-5-1

* refactor(bl_update): move the flash routine to src/lib

The library lived under systemcmds, which is configured after drivers,
so uavcannode could only link it through a forward reference. The
watchdog is now selected by chip because the platform targets do not
exist yet when src/lib is configured.

Assisted-by: Claude:claude-fable-5-1

* docs(dronecan): the CAN bootloader is written to extras on STM32 only

Assisted-by: Claude:claude-fable-5-1
2026-10-06 15:42:33 -06:00
Ahmet Burak Tektas 94ae73bca5 fix(rover): silence missing HIWONDER_EMM_EN on builds without the driver (#28887)
rc.rover checks HIWONDER_EMM_EN with param compare, which logs an error
when the parameter does not exist. The parameter only exists when the
hiwonder_emm driver is built, so rovers in SITL and on boards without
CONFIG_DRIVERS_HIWONDER_EMM printed "Parameter HIWONDER_EMM_EN not found"
at every startup.

Use param compare -s, which only suppresses that error. The result is
unchanged, so the driver still starts when the parameter is 1.

Fixes #28882

Assisted-by: Claude:claude-opus-5-5

Signed-off-by: A.Burak Tektas <15087318+Abtektas@users.noreply.github.com>
2026-10-05 16:23:19 -04:00
Jacob Dahl 12b158889b chore(boards/ark/cannode): drop optical flow (#28984)
* chore(boards/ark/cannode): drop optical flow

The ARK CAN node has no flow sensor.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>

* chore(boards/ark/cannode): keep the default optical flow sensors option

Removing the flow drivers is enough; the board config does not need to override the sensors module default.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>

* chore(cannode): remove the px4flow start from the node startup script

No CAN node board builds the px4flow driver once the ARK CAN node drops optical flow.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>

* chore(boards/ark/cannode): disable vehicle optical flow

The sensors module builds VehicleOpticalFlow by default, which this board never starts without a flow sensor.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>

---------

Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>
2026-10-02 17:24:23 -06:00
Mathéo Taillandier 03c32c66f6 fix(build): move gz_env.sh out of rootfs (#28977) 2026-10-02 11:51:26 -06:00
Jacob Dahl d3fb335a55 refactor(ekf2): stop reading the sensors module's GNSS params (#28935)
* refactor(ekf2): stop reading the sensors module's GNSS params

When the GNSS checks moved to the sensors module, EKF2 kept reading
three of their parameters for its own logic: GNSS_REQ_TIME for the wait
before restarting GNSS fusion and before a GNSS heading reset,
GNSS_REQ_SACC for trusting GNSS vertical velocity while the
accelerometer clips and for the yaw estimator, and GNSS_CHECK for the
heading receiver's spoofing and jamming. That coupled EKF2 to the
sensors module's parameters, and tied EKF2's waits and thresholds,
which judge a sample against the estimate, to thresholds that judge a
receiver on its own.

EKF2_REQ_GPS_H and EKF2_REQ_SACC come back as EKF2 parameters for
EKF2's own use. An imported value is also copied to GNSS_REQ_TIME and
GNSS_REQ_SACC, as it drove the checks as well before they moved, and
airframes that set the check parameter set the EKF2 one too. The
sensors module marks a heading unusable when its receiver reports
spoofing or jamming and those checks are enabled, and EKF2 fuses
vehicle_gnss_heading.usable instead of reading GNSS_CHECK.

Assisted-by: Claude:claude-opus-5-5

* refactor(ekf2): use EKF2 constants for its own GNSS thresholds

EKF2_REQ_GPS_H and EKF2_REQ_SACC duplicated GNSS_REQ_TIME and
GNSS_REQ_SACC for the few places EKF2 reused the check thresholds: the
wait before restarting GNSS fusion and before a GNSS heading reset, and
the speed accuracy for the clipping case and the yaw estimator. They
aren't tuned apart from the checks, and a second parameter for the same
threshold in another module only invites the two to disagree.

EKF2 now uses its 10 s GNSS health time default, and 1 m/s, which
fixed-wing, PX4 Vision and SITL already set and the EKF2 tests always
used. The requirement parameters exist once, with the checks.

Assisted-by: Claude:claude-opus-5-5

* revert(ekf2): keep EKF2_REQ_GPS_H and EKF2_REQ_SACC as EKF2 parameters

Reverts 7fc8503dd3d. EKF2's waits and speed accuracy threshold aren't
duplicates of GNSS_REQ_TIME and GNSS_REQ_SACC: the checks decide when a
receiver is good enough to use, EKF2 decides how long to wait after it
gave up on GNSS and when a velocity is good enough to override a clipped
accelerometer or feed the yaw estimator. They shared a parameter only
because EKF2 ran the checks. As constants they lose tuning that is in
use: SITL sets a 0.5 s health time, fixed-wing a 1 m/s speed accuracy.

Assisted-by: Claude:claude-opus-5-5
2026-09-30 15:03:30 -06:00
4ad48205df feat(gnss): check each receiver and carry the result on the sample (#28520)
* refactor(gnss): move GnssChecks to src/lib/gnss

The checks judge a receiver, not the estimate, and the sensors module needs one checker per receiver. GnssChecks now takes its thresholds as a params struct and armed, in air and at rest per call instead of referencing EKF2's parameters and control status, and the thresholds become GNSS_CHECK and GNSS_REQ_*, with GNSS_REQ_TIME for the health time. EKF2 still runs it, so the checks behave as before.

Co-authored-by: jonas <jonas.perolini@rigi.tech>
Assisted-by: Claude:claude-opus-5-5

* feat(gnss): carry the GNSS check result on the sample

A latest-wins status can't gate fusion: it describes the newest sample, which runs ahead of the one EKF2 fuses by the GNSS delay plus the EKF buffer. The sensors module now runs one GnssChecks per receiver and stamps the selected receiver's result on each vehicle_gnss sample (usable, and failed_checks in GNSS_CHECK bit order), and EKF2 fuses a sample only if that sample is usable. EKF2 drops its own checker and estimator_gps_status; estimator_status.gps_check_fail_flags forwards the sample's failures in its own bit order until commander reads vehicle_gnss. Every receiver's diagnostics go on sensors_status_gnss.

Co-authored-by: Matheo Taillandier <matheo.taillandier@rigi.tech>
Co-authored-by: jonas <jonas.perolini@rigi.tech>
Assisted-by: Claude:claude-opus-5-5

* feat(commander): count GNSS receivers that pass their checks

A 3D fix says nothing about accuracy, drift, spoofing or jamming, so the redundancy check counted receivers the sensors module rejects. It now counts a receiver while sensors_status_gnss says it passes its checks.

Co-authored-by: jonas <jonas.perolini@rigi.tech>
Assisted-by: Claude:claude-opus-5-5

* fix(boards): drop EKF2::PublishGpsStatus from the i.MX RT ITCM lists

The function went with estimator_gps_status, and the ITCM check fails on a listed symbol that is missing from the ELF.

Assisted-by: Claude:claude-fable-5-1

* fix(ekf2): report GNSS check failures only while GNSS fusion is enabled

EKF2 ran the checks only past its GNSS-intended gate, so with EKF2_GPS_CTRL 0 estimator_status.gps_check_fail_flags stayed 0. Forwarding the sample's failures unconditionally made commander turn a receiver EKF2 ignores into pre-arm failures, and into an arming block with COM_ARM_WO_GPS 0.

Assisted-by: Claude:claude-fable-5-1

* refactor(commander): index the GNSS status by receiver instance

The sensors module fills sensors_status_gnss by sensor_gnss instance, the index the redundancy check already subscribes with, so the device_id lookup was redundant. Its sizeof idiom also tripped clang-tidy's bugprone-sizeof-expression.

Assisted-by: Claude:claude-fable-5-1

* refactor(ekf2): rename the GNSS checks pass time to sample accepted

It is set only for a sample that is both usable and within EKF2_VEL_LIM, so it is the last time a sample was accepted for fusion, not the last time the checks passed.

Assisted-by: Claude:claude-fable-5-1

* docs(msg): keep thresholds and parameters out of the GNSS check comments

Message comments describe the message and its fields, not the code that fills them.

Assisted-by: Claude:claude-fable-5-1

---------

Co-authored-by: Matheo Taillandier <matheo.taillandier@rigi.tech>
Co-authored-by: jonas <jonas.perolini@rigi.tech>
Co-authored-by: Jacob Dahl <dahl.jakejacob@gmail.com>
2026-09-30 11:34:05 -06:00
Jacob Dahl 20eabe6184 refactor(sensors): remove GNSS blending (#28921)
Blending averages receivers whose errors are largely shared, drifts when the weights change, and hands every consumer a synthetic sample that no receiver produced, so no per-receiver check result applies to it. The sensors module now always outputs one receiver, chosen by the selection it already used with SENS_GNSS_MASK 0: the SENS_GNSS_PRIME receiver while it has a 3D fix, otherwise the best fix, then the most satellites. Receiver selection replaces that next. SENS_GNSS_MASK and SENS_GNSS_TAU are removed.

Assisted-by: Claude:claude-opus-5-5
2026-09-29 16:38:31 -06:00
Jacob Dahl e40501eba0 refactor(msg): rename GPS to GNSS in messages, topics and sensor parameters (#24399)
* refactor(msg): rename SensorGps to SensorGnss and add VehicleGnss

GPS is one constellation; the receivers and the rest of PX4 handle GNSS. Field names lose their units (latitude, speed_accuracy, course, ...), which move into the metadata comments. The sensors module's output becomes VehicleGnss on vehicle_gnss: the selected receiver's sample next to what the sensors module adds to it (corrected sample time, antenna position, selected instance), so a consumer can tell the two apart and later selection and check results have a place to go.

Assisted-by: Claude:claude-opus-5-5

* refactor(drivers/gps): publish sensor_gnss

Follows the SensorGps to SensorGnss and vehicle_gps_position to VehicleGnss rename.

Assisted-by: Claude:claude-opus-5-5

* refactor(drivers/septentrio): publish sensor_gnss

Follows the SensorGps to SensorGnss and vehicle_gps_position to VehicleGnss rename.

Assisted-by: Claude:claude-opus-5-5

* refactor(drivers/pps_capture): read sensor_gnss

Follows the SensorGps to SensorGnss and vehicle_gps_position to VehicleGnss rename.

Assisted-by: Claude:claude-opus-5-5

* refactor(lib/gnss): select receivers on sensor_gnss

Follows the SensorGps to SensorGnss and vehicle_gps_position to VehicleGnss rename.

Assisted-by: Claude:claude-opus-5-5

* refactor(sensors): publish VehicleGnss on vehicle_gnss and rename SENS_GPS* to SENS_GNSS*

The sensors module's output nests the selected receiver's sample, with the corrected sample time, antenna position and selected instance next to it. SENS_GPS_MASK/TAU/PRIME and SENS_GPSn_ID/OFFX/OFFY/OFFZ/DELAY take the SENS_GNSS name the heading parameters already use; saved parameters migrate on import, and the EKF2_GPS_POS/EKF2_GPS_DELAY translations now land on the new names directly.

Assisted-by: Claude:claude-opus-5-5

* refactor(logger): log sensor_gnss and vehicle_gnss

Follows the SensorGps to SensorGnss and vehicle_gps_position to VehicleGnss rename.

Assisted-by: Claude:claude-opus-5-5

* refactor(ekf2): fuse vehicle_gnss

Follows the SensorGps to SensorGnss and vehicle_gps_position to VehicleGnss rename.

Assisted-by: Claude:claude-opus-5-5

* refactor(replay): replay vehicle_gnss

Follows the SensorGps to SensorGnss and vehicle_gps_position to VehicleGnss rename.

Assisted-by: Claude:claude-opus-5-5

* refactor(local_position_estimator): read vehicle_gnss

Follows the SensorGps to SensorGnss and vehicle_gps_position to VehicleGnss rename.

Assisted-by: Claude:claude-opus-5-5

* refactor(attitude_estimator_q): read vehicle_gnss

Follows the SensorGps to SensorGnss and vehicle_gps_position to VehicleGnss rename.

Assisted-by: Claude:claude-opus-5-5

* refactor(lib/terrain_estimation): take sensor_gnss

Follows the SensorGps to SensorGnss and vehicle_gps_position to VehicleGnss rename.

Assisted-by: Claude:claude-opus-5-5

* refactor(lib/wind_estimator): read vehicle_gnss in the replay script

Follows the SensorGps to SensorGnss and vehicle_gps_position to VehicleGnss rename.

Assisted-by: Claude:claude-opus-5-5

* refactor(vision_target_estimator): read vehicle_gnss

Follows the SensorGps to SensorGnss and vehicle_gps_position to VehicleGnss rename.

Assisted-by: Claude:claude-opus-5-5

* refactor(navigator): read vehicle_gnss

Follows the SensorGps to SensorGnss and vehicle_gps_position to VehicleGnss rename.

Assisted-by: Claude:claude-opus-5-5

* refactor(commander): read sensor_gnss and vehicle_gnss

Follows the SensorGps to SensorGnss and vehicle_gps_position to VehicleGnss rename.

Assisted-by: Claude:claude-opus-5-5

* refactor(mavlink): stream sensor_gnss and vehicle_gnss

Follows the SensorGps to SensorGnss and vehicle_gps_position to VehicleGnss rename.

Assisted-by: Claude:claude-opus-5-5

* refactor(uxrce_dds_client): bridge vehicle_gnss

Follows the SensorGps to SensorGnss and vehicle_gps_position to VehicleGnss rename.

Assisted-by: Claude:claude-opus-5-5

* refactor(zenoh): bridge vehicle_gnss

Follows the SensorGps to SensorGnss and vehicle_gps_position to VehicleGnss rename.

Assisted-by: Claude:claude-opus-5-5

* refactor(failure_injection): inject GNSS failures on sensor_gnss

Follows the SensorGps to SensorGnss and vehicle_gps_position to VehicleGnss rename.

Assisted-by: Claude:claude-opus-5-5

* refactor(drivers/ins): publish sensor_gnss

Follows the SensorGps to SensorGnss and vehicle_gps_position to VehicleGnss rename.

Assisted-by: Claude:claude-opus-5-5

* refactor(drivers/uavcan): publish sensor_gnss

Follows the SensorGps to SensorGnss and vehicle_gps_position to VehicleGnss rename.

Assisted-by: Claude:claude-opus-5-5

* refactor(drivers/uavcannode): read sensor_gnss

Follows the SensorGps to SensorGnss and vehicle_gps_position to VehicleGnss rename.

Assisted-by: Claude:claude-opus-5-5

* refactor(drivers/cyphal): bridge sensor_gnss

Follows the SensorGps to SensorGnss and vehicle_gps_position to VehicleGnss rename.

Assisted-by: Claude:claude-opus-5-5

* refactor(drivers/telemetry): read vehicle_gnss

Follows the SensorGps to SensorGnss and vehicle_gps_position to VehicleGnss rename.

Assisted-by: Claude:claude-opus-5-5

* refactor(drivers/rc): read vehicle_gnss for telemetry

Follows the SensorGps to SensorGnss and vehicle_gps_position to VehicleGnss rename.

Assisted-by: Claude:claude-opus-5-5

* refactor(drivers/osd): read vehicle_gnss

Follows the SensorGps to SensorGnss and vehicle_gps_position to VehicleGnss rename.

Assisted-by: Claude:claude-opus-5-5

* refactor(drivers/transponder): read sensor_gnss

Follows the SensorGps to SensorGnss and vehicle_gps_position to VehicleGnss rename.

Assisted-by: Claude:claude-opus-5-5

* refactor(boards/modalai): publish sensor_gnss from the voxl2 drivers

Follows the SensorGps to SensorGnss and vehicle_gps_position to VehicleGnss rename.

Assisted-by: Claude:claude-opus-5-5

* refactor(examples): publish sensor_gnss and read vehicle_gnss

Follows the SensorGps to SensorGnss and vehicle_gps_position to VehicleGnss rename.

Assisted-by: Claude:claude-opus-5-5

* refactor(simulation): publish sensor_gnss

Follows the SensorGps to SensorGnss and vehicle_gps_position to VehicleGnss rename.

Assisted-by: Claude:claude-opus-5-5

* refactor(gnss): name GNSS variables gnss in the sensors module and receiver drivers

GPS is one constellation. Identifiers that hold or handle GNSS samples, or bind to the renamed parameters, follow the message and parameter rename; classes, files, modules and names tied to parameters that keep GPS stay.

Assisted-by: Claude:claude-opus-5-5

* refactor(gnss): name GNSS variables gnss in the estimators and navigator

GPS is one constellation. Identifiers that hold or handle GNSS samples, or bind to the renamed parameters, follow the message and parameter rename; classes, files, modules and names tied to parameters that keep GPS stay.

Assisted-by: Claude:claude-opus-5-5

* refactor(gnss): name GNSS variables gnss in commander, mavlink and failure injection

GPS is one constellation. Identifiers that hold or handle GNSS samples, or bind to the renamed parameters, follow the message and parameter rename; classes, files, modules and names tied to parameters that keep GPS stay.

Assisted-by: Claude:claude-opus-5-5

* refactor(gnss): name GNSS variables gnss in the remaining drivers and simulation

GPS is one constellation. Identifiers that hold or handle GNSS samples, or bind to the renamed parameters, follow the message and parameter rename; classes, files, modules and names tied to parameters that keep GPS stay.

Assisted-by: Claude:claude-opus-5-5

* docs(gnss): reference sensor_gnss, vehicle_gnss and SENS_GNSS* parameters

The upgrade guide covers the topic, field, ROS 2, parameter and Cyphal register renames.

Assisted-by: Claude:claude-opus-5-5

* fix(boards): name EKF2::UpdateGnssSample in the fmu-v6xrt ITCM lists

The rename left the old UpdateGpsSample symbol in the lists, so the ITCM check fails and the function drops out of ITCM on the boards it doesn't check.

Assisted-by: Claude:claude-opus-5-5

* chore(drivers/gps): bump PX4-GPSDrivers to the merged sensor_gnss rename

The submodule pointed at the PX4-GPSDrivers#243 branch commit; #243 is merged.

Assisted-by: Claude:claude-opus-5-5

* docs(msg): restore WGS84 in SensorGnss and point VehicleGlobalPosition at vehicle_gnss

The rename dropped the only mention of the WGS84 datum and ellipsoid, and left VehicleGlobalPosition referring to the removed vehicle_gps_position topic.

Assisted-by: Claude:claude-opus-5-5

* refactor(msg): drop selected_instance from VehicleGnss

receiver.device_id already names the selected receiver, and 0 while blended. The sensor_gnss instance depends on the order drivers advertise at boot, so it doesn't identify a receiver across boots or logs, and nothing reads it. It would also be meaningless on the per-receiver VehicleGnss instances proposed in #28894.

Assisted-by: Claude:claude-opus-5-5

* refactor(gnss): fuse vehicle_gnss.timestamp_sample directly and document the receiver's corrected time

vehicle_gnss.timestamp is now the sensors module's publish time, so EKF2's check of timestamp_sample against it was always true; the sensors module always fills timestamp_sample. The message docs described receiver.timestamp_sample as the driver's uncorrected value, but the sensors module writes the corrected time into it as well.

Assisted-by: Claude:claude-opus-5-5

* docs(msg): point VehicleGnss users at the top-level timestamp_sample

uXRCE-DDS shifts only top-level timestamp and timestamp_sample into agent time, so receiver.timestamp_sample reaches ROS 2 on the PX4 boot clock even though it holds the same value on uORB.

Assisted-by: Claude:claude-opus-5-5

* docs(releases): tell ROS 2 users which VehicleGnss timestamps to read

Only top-level timestamps are converted to ROS time, so a port that reads receiver.timestamp gets the PX4 boot clock, and vehicle_gnss.timestamp is now the sensors module's publish time rather than the receiver's.

Assisted-by: Claude:claude-opus-5-5
2026-09-29 10:36:49 -06:00
Ramon Roche e0dc50d7cc build(uavcan)!: stop embedding CAN node firmware in flight controller builds
CONFIG_BOARD_UAVCAN_PERIPHERALS made ROMFS clone the PX4 repository and
run a second full build of a CAN node on every build of the flight
controller, to carry that node's firmware in /etc/uavcan/fw/. Its only
user, px4_fmu-v5_uavcanv0periph (CUAV CAN GPS v1), disabled about 30
modules to make room, and was downloaded 40 times in five years, never
through QGroundControl. Releases now publish every CAN node's firmware
standalone as <target>.uavcan.bin, which the DroneCAN firmware server
installs from the SD card on any flight controller.

Remove the option, the ROMFS ExternalProject and the board variant, and
point the DroneCAN docs and the release notes at the SD card path. The
server still serves /etc/uavcan/fw/, which is now empty.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-09-28 09:45:09 -07:00
Ramon Roche 9a90020437 fix(romfs): serialize gencromfs across concurrent builds
gencromfs writes its intermediate data to fixed file names in /tmp
(/tmp/gencromfs-000000, ...) because its mkstemp path is compiled out, so
two NuttX builds generating a ROMFS at the same moment overwrite each
other's temporary files and emit a corrupted nsh_romfsimg.c ("/*" within
comment, invalid suffix "x00"). Run gencromfs under flock where it is
available; it takes about a second, so the lock costs nothing.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-09-28 09:45:09 -07:00
LtxxandBeniamino Pozzan d2de298122 fix(uxrce_dds): align SITL namespace prefix (#28338)
* fix(uxrce_dds): align SITL namespace prefix

Use the same uav_ namespace prefix for SITL multi-instance startup and UXRCE_DDS_NS_IDX fallback. This keeps simulation and hardware topic names consistent without changing the existing hardware default.

Assisted-by: OpenAI Codex: GPT-5

* docs(uxrce): update uxrce_dds docs

* docs(release): update `main` release page

---------

Signed-off-by: Beniamino Pozzan <beniamino.pozzan@gmail.com>
Co-authored-by: Beniamino Pozzan <beniamino.pozzan@gmail.com>
2026-09-27 00:12:55 +01:00
Ramon Roche a8b0e91ebe feat(setup): install macOS Gazebo from a locked conda-forge environment
Homebrew rebuilds and drops the gz bottles whenever homebrew-core bumps
protobuf or abseil, which breaks the macOS Gazebo install until the pins
catch up. conda-forge keeps every package it has published, so
Tools/setup/macos/pixi.toml and its lock install the same gz, protobuf,
abseil, OpenCV and GStreamer binaries until the lock is updated on
purpose. OpenCV is the headless build, and GStreamer brings the good,
bad and ugly plugin sets the gz camera plugin's pipeline uses.

macos.sh installs the environment with pixi and loads it from the venv
activation through a small script, since pixi shell-hook would export
the installing shell's PATH. The build and the gz launch do not depend
on that activation: CMake searches the environment like it pins the
.venv Python, and px4-rc.gzsim sources gz_env.sh before it looks for
gz, which loads the environment when it is not already active and puts
its lib dir ahead of Homebrew's in the dyld fallback path.
conda-forge's gz-transport13 does not pull in cppzmq, so the manifest
lists it.

The osrf/simulation pin, the protobuf pin and the weekly bot that
refreshed them are removed. The homebrew-core commit moves into
homebrew-pins.txt unchanged.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-09-26 15:12:00 -07:00
Ramon Roche a23449cbe5 feat(simulation)!: remove jMAVSim
PX4 SIH with the Hawkeye visualizer replaces jMAVSim, in SITL and as the
display-only viewer for SIH running on hardware. Drop the jMAVSim
submodule, its make targets, px4-rc.jmavsim, the 10017_jmavsim_iris
airframe and the VS Code debug helpers, stop installing Java and ant in
the macOS and Arch setup scripts, and point the remaining mentions at SIH
and Hawkeye.

BREAKING CHANGE: make px4_sitl jmavsim and SYS_AUTOSTART 10017 no longer
exist. Use make px4_sitl_sih sihsim_quadx with Hawkeye instead.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-09-26 14:28:26 -07:00
Andrea Bernasconi b38dcb1f6c fix(navigator): use "Return" instead of "RTL" in user-facing text (#28543) 2026-09-26 12:40:56 +10:00
bresch 7526943204 fix(init): start the estimator right before logging
The estimator was started near the top of the script and logging at the
very end, so its startup - the alignment and the first resets - was never
in the log and an ekf2 replay could not reproduce it.

Assisted-by: Claude:claude-opus-5[1m]
Signed-off-by: bresch <brescianimathieu@gmail.com>
2026-09-22 16:01:46 +02:00
bresch 95466c2fa8 fix(replay): poll the logger on the last topic ekf2 publishes
ekf2_timestamps is the last publication of an ekf2 update and the
only one produced on every update, so waking on it logs whole updates
and keeps the lockstep barrier fed before the attitude becomes valid.

Assisted-by: Claude:claude-opus-5[1m]
Signed-off-by: bresch <brescianimathieu@gmail.com>
2026-09-22 16:01:46 +02:00
Julian Oes cc976e150a feat(posix): separate the filesystem root from the storage directory (#28582)
On NuttX these are two things: / is the filesystem root, and /fs/microsd is the
SD card mounted under it. MAVLink FTP serves the root and confines writes to the
SD card, so the read-only ROMFS at /etc is visible but cannot be written.

On POSIX they were the same directory. PX4_ROOTFSDIR and PX4_STORAGEDIR both
resolved to CONFIG_BOARD_ROOT_PATH, which on SITL is ".", so the working
directory was simultaneously the FTP root and the only writable area. The
consequences were that the ROMFS symlink sat inside the FTP root, and that
_validatePathIsWritable() had nothing meaningful to check against and so was
compiled out on POSIX entirely, leaving no write restriction at all.

Give POSIX the same split. CONFIG_BOARD_ROOT_PATH keeps its meaning as the
storage directory, and a new CONFIG_BOARD_FS_ROOT_PATH names the root FTP
serves, defaulting to the storage path so every existing board is unchanged.
SITL sets the root to "." and storage to "./fs", which mirrors NuttX: logs,
parameters, dataman and eeprom move under ./fs, and etc/ stays in the root as
read-only data.

With storage distinct from the root, the write restriction now applies on every
platform rather than NuttX only, and no longer compares against a hardcoded
prefix length that was wrong for any board not using /fs/microsd.

Assisted-by: Claude:claude-opus-5[1m]

Signed-off-by: Julian Oes <julian@oes.ch>
2026-09-08 17:01:55 -06:00
elisaaferraraa e73644ba70 fix(4001_gz_x500): tuned drag fusion parameters for gazebo sim (#28490) 2026-09-02 09:13:28 +02:00
Matthias Grob 639e983df4 fix(ROMFS): use SYS_AUTOCFG_CAL also in simulation
to enable simulation testing of the feature and keep the parameter reset logic consistent.
2026-08-27 18:36:45 +02:00
Elisa Ferrara d519eee5e2 feat(ROMFS): make MAV_SYS_ID NOT resetting when SYS_AUTOCONFIG enabled and reboot happens 2026-08-27 18:36:45 +02:00
Silvan e006f67a89 feat(sihsim): more airplane thrust for a 30 deg climb and 20 m/s cruise
At 9000 RPM the propeller produced 4.6 N at trim airspeed while the model
needs about 5.3 N to hold 15 m/s level, so the plane could not sustain
trim airspeed at all.

Spin the same APC 8x6" propeller at 13000 RPM, which gives 11.3 N at trim
airspeed. The step is this large because prop wash over the tailplane and
the fin increases their local dynamic pressure, which eats roughly three
quarters of any added thrust.

Also raise the maximum climb rate, since a 30 deg climb at trim airspeed
needs 15 m/s * sin(30 deg) = 7.5 m/s and the default is 5 m/s.

Measured in SITL: 19.7 m/s at full throttle in near level flight (3 deg,
1 m/s climb). The thrust sustains a climb of over 30 deg, but reaching it
requires a steeper pitch than the takeoff and pitch limit defaults allow.

Signed-off-by: Silvan <silvan@auterion.com>
2026-08-25 11:25:23 +02:00
Silvan 0010100f6d fix: sihsim_airplane: use propeller model with advance ratio
Signed-off-by: Silvan <silvan@auterion.com>
2026-08-25 11:25:23 +02:00
Veli Bakırcıoğlu 7ff136a020 fix(simulation): align gz_x500 rotor geometry with model
The gz_x500 airframe configures asymmetric CA_ROTOR positions while the current Gazebo x500 model places all four rotors on a square at +/-0.174 m.

Because ControlAllocator builds its effectiveness matrix from CA_ROTOR geometry, the mismatch produces a fixed roll/pitch control-effectiveness asymmetry in an otherwise symmetric simulated vehicle.

Align CA_ROTOR0-3 PX/PY with the current x500 model geometry. No allocator logic, thrust model, motor ordering, KM, CT, or controller gains are changed.

SITL validation with stock PX4 position control:
- 4/4 takeoff/hover/step/land flights completed without errors
- before: K_pitch/K_roll = 1.3804 +/- 0.0114 (OLS)
- after:  K_pitch/K_roll = 1.0015 +/- 0.0002 (OLS)

Assisted-by: Claude:claude-opus-5
Signed-off-by: Veli Bakırcıoğlu <vbakircioglu@gmail.com>
2026-08-21 21:38:20 -07:00
Marin DandHamish Willee ae663d374e feat(driver/dlvr): add support for dlvr airspeed-sensors (#26363)
* add: driver for dlvr - airspeed family (continuous sampling only)

* unify: INH_TO_PA

---------

Signed-off-by: Marin Doetterer <marin@auterion.com>
Co-authored-by: Hamish Willee <hamishwillee@gmail.com>
2026-08-21 11:28:04 +02:00
Hamish Willee e6df0597f0 fix(docs): Fix links in source (#28299) 2026-08-20 11:53:01 +10:00
elisaaferraraa e308d6105d feat(reboot): new param to not exlcude CAL_* params on a param reset (#28110)
* feat(reboot): new param to reset also CAL_* params with reboot and SYS_AUTOCONFIG on

* refactor(reboot): SYS_AUTOCFG_CAL description shorter

* refactor(reboot): reset SYS_AUTOCFG_CAL

* refactor(reboot): swap lines to make SYS_AUTOCFG_CAL appear in params list even if not set default to anything
2026-08-05 15:56:42 +02:00
James Botwina 47ce421a88 fix(simulator_sih): restore xvert front transition (#28090)
* fix(simulator_sih): correct tailsitter pitot axis

Signed-off-by: jbotwina <jimbotwina16@gmail.com>

* fix(airframes/10042): tune xvert transition

Signed-off-by: jbotwina <jimbotwina16@gmail.com>

* test(mavsdk_tests): cover xvert transition

Signed-off-by: jbotwina <jimbotwina16@gmail.com>

* fix(airframes/10042): disable airspeed scaling

Signed-off-by: jbotwina <jimbotwina16@gmail.com>

---------

Signed-off-by: jbotwina <jimbotwina16@gmail.com>
2026-07-29 13:01:51 -06:00
Phil-Engljaehringer 14b3f44081 feat(ufw): enable nfs mounting and flashing 2026-07-28 16:25:42 +02:00
Claudio Chies 282c969687 fix(commander): capture home orientation on ground independent of local position (#27946) 2026-07-21 11:49:06 -07:00
Julian Oes 28b7c7e970 fix(rcS): use awk instead of bc for scaled timeout math
bc isn't installed in the px4-dev CI container we now use. awk is
required by POSIX so it's always present. Same float math, no extra
dependency.
2026-07-17 10:51:42 -05:00
Julian Oes 92c6818fc5 fix(rcS): scale COM_DISARM_PRFLT by sim speed factor
Symmetric with the existing COM_DL_LOSS_T / COM_RC_LOSS_T /
COM_OF_LOSS_T / COM_OBC_LOSS_T scalings just above. At high simulation
speed the default 10s preflight disarm is reached much sooner in
real wall time than tests expect, so scale it the same way.
2026-07-17 10:51:42 -05:00
Claudio ChiesandClaudio Chies d63f30c612 feat(failure_injection): Enable failure-injection on hardware, and through RC-switch (#27832)
* feat(failure_injection): integrate failure injection support across sensor drivers

* feat(failure_injection): enhance failure injection with RC switch support and instance bitmasking

feat(failure_injection): add disabled failure injection manager and system command support for v5x and v6x boards

* feat(failure_injection): add battery failure injection

Add a value-mutating apply-site for FAILURE_UNIT_SYSTEM_BATTERY. On an
injected OFF the outgoing battery_status is reported as a depleted pack
(zero remaining, emergency warning) so the low-battery failsafe triggers.

The apply-site lives in the shared Battery library, covering the analog
ADC, INA power monitors, ESC battery and SITL in one place, plus the
UAVCAN battery driver which publishes battery_status directly. The
previous SITL-only hack in BatterySimulator is removed in favour of this
shared path so simulation and hardware behave identically.

* fix(failure_injection): change parameter types from int32 to enum

* refactor(failure_injection): disable failure injection manager and system commands across multiple boards

* feat(failure_injection): enhance failure injection with timestamp handling and message-less support

* refactor(failure_injection): simplify has_timestamp_sample implementation and remove unused includes

* refactor(failure_injection):move conditional compilation into helper libary

* refactor(failure_injection): update CMakeLists to include failure_injection dependency across multiple drivers

---------

Co-authored-by: Claudio Chies <chiesc@chies.com>
2026-07-15 07:56:13 -07:00
25b7d627da fix(ROMFS): Safe flash pruning more unnecessary characters from ROMFS (#27775)
* refactor(ROMFS): remove trailing zeros from all airframes

* refactor(ROMFS): remove allignment whitespace from all startup scripts

* feat(romfs_pruner): strip end of line comments in startup scripts

and airframes to not waste any flash.

* feat(romfs_pruner): strip inline multi-whitespace

* fix typo

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

---------

Co-authored-by: Jacob Dahl <37091262+dakejahl@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-07-01 11:53:21 -08:00
Balduin f17f70be6f fix(airframes/10042): correct sihsim_xvert sign error
The sihsim_xvert currently tumbles immediately on takeoff. Here is why:

generate_ts_aerodynamics in sih.cpp calculates elevon torques.
everything is rotated into the fixed-wing frame, in which
 - positive _u[4] (configured as CA_SV_CS0) generates positive FW roll
   torque (left wing pushed up)
 - positive _u[5] (configured as CA_SV_CS1) generates positive FW roll
   torque (right wing pushed down, note the additional minus)

So in the FW frame, they work like this:
 - positive _u[4] + _u[5] -> positive FW roll torque
 - positive _u[4] - _u[5] -> positive FW pitch torque

The airframe file however configures all of these in the multicopter
frame. So accounting for the frame conversion, we have:
 - MC yaw = -FW roll = -_u[4] - _u[5]
     - because FW x points nose-forward while MC z points nose-backward
 - MC pitch = FW pitch = _u[4] - _u[5]

or in matrix form:

[  MC yaw  ]   [ -1  -1 ] [ _u[4] ]
[ MC pitch ] = [ 1   -1 ] [ _u[5] ]

and as this matrix is basically (up to scaling)

[ CS0_TRQ_Y CS1_TRQ_Y ]
[ CS0_TRQ_P CS1_TRQ_P ]

we have to change the CS1_TRQ_* coefficients to be negative.
2026-07-01 15:51:28 +02:00
Alireza Ghaderi b885c2d7e9 feat(sim): add X-Plane SITL airframes (#22493) 2026-07-01 18:42:33 +10:00
f937bd5818 refactor(failure_injection): centralize MAV_CMD_INJECT_FAILURE behind a manager module (#27572)
* feat(failure_injection): add failure_injection topic and helper library

* feat(failure_injection): add failure injection manager module

* refactor(commander): route motor failure injection through the manager

* refactor(simulation): route sensor sim failure injection through the manager

* refactor(simulation): route SimulatorMavlink failure injection through the manager

* feat(failure_injection): start the manager in the SITL startup

* docs(failure_injection): document per-simulator failure support

* feat(failure_injection): enhance failure injection management and configuration

* fix(rebase): baro failure injectionb

* refactor(failure_injection): simplify FailureInjectionManager and FailureTable implementations

* refactor(failure_injection): replace Subscriber with Config in various modules and add update method

* update(uorb): FailureInjection.msg to docs standard

* docs(docs): subedit

* fix(failure_injection): correct comment formatting in FailureInjection.msg

* feat(failure_injection): add failure injection manager support across multiple boards and modules

* feat(mavlink): implement failure injection functionality

---------

Co-authored-by: Claudio Chies <chiesc@chies.com>
Co-authored-by: Hamish Willee <hamishwillee@gmail.com>
2026-06-30 15:33:39 +02:00
Hyunduk Shin 2bc9774170 feat(airframes): add generic airship 2026-06-29 12:34:55 -07:00
6ddf60c7b4 feat(sim): add RotorPy simulator support (#27116)
* Add rotorpy simulator and integrate with main simulator script

* docs: add rotorpy simulator instructions

* docs(update): subedit

* docs: address RotorPy review comments

---------

Co-authored-by: Davide Iafrate <dvde.iafrate98@gmail.com>
Co-authored-by: Ramon Roche <mrpollo@gmail.com>
Co-authored-by: Hamish Willee <hamishwillee@gmail.com>
2026-06-25 15:51:55 -07:00
Matthias Grob c05cc47b75 fix(mc_defaults): remove 2m instead of 10m acceptance radius (#27738)
This setting comes from a time where takeoff was accepted immediately if the acceptance radius was too big and also the mission behavior was completely different:

95a8414895
2026-06-24 10:06:26 -06:00
Gennaro Guidone 143b518528 fix(rcS): FMU output pins not working when serial passthrough is not compiled for a board (#27682)
#27605 gated the dshot/pwm_out start on `param compare -s PASSTHRU_EN 0`.
PASSTHRU_EN is registered only when the serialpassthrough driver is
compiled in, which is not the case on most boards (e.g. fmu-v5x). There
param_find() fails, `param compare` returns "no match", the else branch
runs, and the FMU outputs never start: the PWM_AUX group disappears from
the Actuators screen and motors wired to those pins won't arm. SITL uses a
separate init.d-posix rcS and is unaffected, so CI did not catch it.

Use the start-unless-explicitly-enabled idiom already used elsewhere in
rcS (`param greater -s`): only skip the outputs when PASSTHRU_EN is
explicitly > 0. A missing or zero parameter starts the outputs as before.
2026-06-17 16:37:50 +02:00
Jacob Dahl a5b2270292 fix(parameters): save resets synchronously and scope caldata repair (#27658)
* fix(commander): save parameters synchronously after parameter reset

ParamResetAll and ParamResetAllConfig relied on the deferred autosave (300 ms delay, 2 s rate limit) to persist the reset, so a reboot or power cycle right after the command ack could leave the old parameters in storage. Save synchronously like ParamResetSensorFactory already does.

Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>

* fix(rcS): only run caldata BSON size repair on boards with caldata

The bsondump docsize block from #23088 repairs a zeroed BSON document size field in /fs/mtd_caldata, but it ran unconditionally with a comment claiming it checks /fs/mtd_params, producing failed-bsondump boot noise on every board without a caldata partition. Move it inside the MTD_CALDATA gate next to the param load it exists to protect.

Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>

---------

Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>
2026-06-14 16:24:09 -06:00
Jacob Dahl 940af26b4b fix(sensors): disable SENS_MAG_AUTOCAL by default, keep for CAN nodes (#27659)
PR #18421 added the initial mag calibration save and was deliberately merged with SENS_MAG_AUTOCAL=0 until parameter system concerns were addressed. PR #19818 (CAN GPS nodes) flipped the global default to 1 as an undiscussed side change, shipped in v1.14.0. Since then every uncalibrated mag marks itself calibrated (CAL_MAGn_ID set) shortly after the disarmed bias estimator stabilizes, so ground stations stop prompting for compass calibration on new setups, and the first flight happens on a hard-iron-only estimate with an assumed mount rotation.

Restore the disabled default and enable it where it is genuinely needed: CAN nodes, which have no GCS calibration flow and no EKF for in-flight refinement. MBE_ENABLE is untouched, the bias estimator still runs and corrects everywhere.

Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>
2026-06-12 19:17:53 -06:00
Phil-Engljaehringer f2eecc33f7 feat(drivers): implemented serial passthrough (#27605)
* feat: implemented serial passthrough

* fix: used make format

* fix: changed function order to match other drivers

* fix: moved passthrough from systemcmds to drivers

* fix: renamed BITBANG_TIMER to UART_BITBANG_TIMER

* fix: used make format

* feat: added PASSTHRU_EN guard to start of dshot&pwm_out

* fix: made changing ESC channels more stable

* fix: adjusted naming of guards

* fix: changed include guard of bitbang

* fix: removed unused variable SER_PASS_BAUD

* fix: adjusted comments

* fix: adjusted print_usage() to match other drivers

* fix: remove bitbang_write_byte from public API and some buffer guard

* fix: added Serialpassthrough&Bitbang to exclude list of allyesconfig.py

* fix: added missing flag to print_usage()
2026-06-12 18:27:26 +02:00