Commit Graph
1923 Commits
Author SHA1 Message Date
Marco Hauswirth 3bd1839a72 feat(ekf2): support up to two optical flow sensors 2026-11-18 13:52:41 +01:00
Matthias Grob 7f83c28400 feat(failure_detector)!: check tilt instead of roll and pitch separately
Checking roll and pitch against separate limits misses a combined
tilt: 45° roll with 45° pitch is a 60° tilt but stays below both
default 60° limits. Euler angles are also unreliable near 90° pitch
and when inverted.

FD_FAIL_R and FD_FAIL_R_TTRI now set the maximum tilt and its trigger
time. FD_FAIL_P and FD_FAIL_P_TTRI are removed without migration
(see the Upgrade Guide). The check is disabled with -1; 0 still
disables it for existing setups. In FailureDetectorStatus, fd_roll
and fd_pitch are replaced by fd_tilt.
2026-11-18 11:02:27 +01:00
Andrea Bernasconi 67f5c57e9a feat(GNSS): Introduce kinematic consistency check (#29660)
* feat(gnss): check that the position change matches the velocity

A receiver computes its position from the code (time of flight) and its
velocity from the Doppler shift. Multipath and other degradation hit the
two differently, so a degraded receiver's position change stops matching
its velocity, often before its reported accuracy shows it. The existing
drift checks compare the two only at rest on the ground.

The new strict check filters the position change rate minus the mean
velocity over about 1 s and fails above GNSS_REQ_POSVEL, also in flight,
so the selection prefers another receiver that passes. It is off by
default (GNSS_CHECK bit 12) until the threshold is tuned on logs; the
filtered value is logged in sensors_status_gnss either way.

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

* fix(gnss): skip the position step at a fix type change in the consistency check

When a receiver starts or stops applying differential or RTK corrections,
its position steps by up to a few meters in one epoch while the Doppler
velocity is unaffected. That is a new solution, not degradation, and it
shouldn't demote a receiver that just reached RTK fixed. On a 10 Hz log
with DGPS dropping in and out, these steps drove the filtered value to
4.5 m/s; without them it peaks at 0.8 m/s, during a real vertical drift.

Only the interval spanning the change is skipped and the filter keeps its
state, so a receiver that keeps switching isn't blind for longer.

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

* refactor(gnss): Reduce check description

* fix(GNSS): Make the feature enabled by default but with more margin

* fix(gnss): restrict the position/velocity consistency check to horizontal

Receivers that don't report the vertical velocity failed the check on any
climb. Merge the consistency tests into fewer cases.

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

* refactor(gnss): mark the position/velocity consistency check as horizontal

The check only compares the horizontal position change with the horizontal
velocity. Name the parameter, flags and status field after that, so that a
vertical counterpart can be added later as GNSS_REQ_VPOSVEL / CHECK_VPOSVEL.

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

* refactor(gnss): rename the position/velocity check to kinematic consistency

HPOSVEL read like a check on position and velocity separately, next to
HDRIFT and HSPEED. "Kinematic consistency" names the property being
tested and leaves room for a vertical counterpart (VKIN). Messages,
flag comments and the parameter's long description keep the plain
wording, since "kinematic" alone can be read as RTK.

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

---------

Signed-off-by: Andrea Bernasconi <andrea.bernasconi@auterion.com>
2026-11-17 10:38:26 +01:00
Michael Fritsche e8b3274ab0 feat(msg): rename rover throttle setpoint to surface_vehicle_thrust_setpoint (#29777)
* feat(msg): rename rover throttle setpoint to surface_vehicle_*

The throttle setpoint was the last rover topic shared by rovers and boats
without the surface_vehicle_* prefix decided in #29524. Rename
RoverThrottleSetpoint to SurfaceVehicleThrottleSetpoint and the
TYPE_ROVER_THROTTLE_* setpoint types to TYPE_SURFACE_VEHICLE_THROTTLE_*.
The type values are unchanged.

The topic rename breaks ROS 2 users anyway, so also shorten the fields of
the throttle and speed setpoints to x and y: the message name already says
what the value is and [@frame Body] states the frame.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Michael Fritsche <frimi999@gmail.com>

* fix(zenoh): bring surface_vehicle rename to the zenoh dds topics

* fix(concept): rename rover throttle setpoint to surface_vehicle_* in navigation terminology

* fix(tools): update px4-ros2-interface-lib pin

* docs(msg): describe sideways fields as omnidirectional, not mecanum

The surface vehicle messages are shared by rovers and boats, and the lateral
axis applies to any vehicle that can move sideways, not only mecanum rovers.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Michael Fritsche <frimi999@gmail.com>

* docs(ros2): use the surface vehicle setpoint type names of the interface lib

The pinned px4-ros2-interface-lib names the rover setpoint types
SurfaceVehicle*SetpointType. The table and the example reference still used
the old Rover*SetpointType class names, which do not exist in that version.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Michael Fritsche <frimi999@gmail.com>

* feat(msg)!: rename surface vehicle throttle setpoint to thrust setpoint

The setpoint is a normalized force command along the body x and y axes,
which is a thrust, not a throttle. Throttle stays the name for the motor
command the actuator control derives from it.

surface_vehicle_throttle_setpoint is now surface_vehicle_thrust_setpoint
(SurfaceVehicleThrustSetpoint), and SetpointConfig
TYPE_SURFACE_VEHICLE_THROTTLE_* are now TYPE_SURFACE_VEHICLE_THRUST_*
(same values). The px4-ros2-interface-lib pin follows the matching rename
there.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Michael Fritsche <frimi999@gmail.com>

* fix(tools): update px4-ros2-interface-lib pin

* fix(commander): do not enable velocity control for surface vehicle thrust setpoints

The SurfaceVehicleThrust* setpoint types enabled the velocity flag, taken
over from the original interface lib configuration. Nothing in these types
uses velocity, and offboard mode maps the same combinations without it.

The flag kept the rover speed controller running: switching from a
SurfaceVehicleSpeed* to a SurfaceVehicleThrust* type sets the same flags,
so the controllers were not reset and a stale speed setpoint kept
overriding the commanded thrust. It also made external modes that only
command thrust require a local position estimate.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Michael Fritsche <frimi999@gmail.com>

* docs(msg): apply review suggestions for the surface vehicle setpoints

Add long descriptions to the thrust and speed setpoints and the speed
status, name modules instead of C++ classes, and use single spaces before
field comments. Rename the speed status PID integrals from pid_throttle_*
to pid_thrust_*, since the speed controller drives the thrust setpoint.

Update the docs and the rover control structure diagram for the thrust
setpoint and omnidirectional vehicles, note the Rover*SetpointType names of
PX4 v1.17 and v1.18, and add the ROS 2 release note.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Michael Fritsche <frimi999@gmail.com>

---------

Signed-off-by: Michael Fritsche <frimi999@gmail.com>
2026-11-13 10:05:26 +01:00
Hamish Willee cec32f5ea7 docs(msg): fix WheelEncoders field comments and units (#29746)
Follow-up to #28848. Use the standard timestamp comment, replace the
[counts/rev] unit the msg doc generator rejects with [-], add the
missing unit tag to encoder_counts, and punctuate the multi-sentence
comments.

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

Signed-off-by: Hamish Willee <hamishwillee@gmail.com>
2026-11-10 17:22:17 -05:00
e03e075003 feat(rover): add high level encoder support (#28848)
* feat(rover): add high level encoder support

Signed-off-by: dirksavage88 <dirksavage88@gmail.com>

* fix(rover): add gz mixing interface to output encoder position

Signed-off-by: dirksavage88 <dirksavage88@gmail.com>

* fix(rover): add wheel encoder to logged topics, high rate sensors

Signed-off-by: dirksavage88 <dirksavage88@gmail.com>

* fix(rover): fix wheel encoder division by zero and stream iteration

Corrected Roboclaw driver to initialize counts_per_rev, fixed wheel encoder stream to iterate over multiple wheels, and added trapezoidal integration to GZMixingInterfaceWheel. Removed unused RO_WHEEL_RAD from position controllers and restricted the wheel encoder stream to rover targets.

Assisted-by: Qwen-Code

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
Signed-off-by: dirksavage88 <dirksavage88@gmail.com>

* fix(rover): adjust wheel radius default for SITL

Signed-off-by: dirksavage88 <dirksavage88@gmail.com>

* Update src/lib/rover_control/rovercontrol_params.yaml

Co-authored-by: Michael Fritsche <64464652+Frigiii@users.noreply.github.com>

* Update src/lib/rover_control/rovercontrol_params.yaml

Co-authored-by: Michael Fritsche <64464652+Frigiii@users.noreply.github.com>

* Update msg/WheelEncoders.msg

Co-authored-by: Michael Fritsche <64464652+Frigiii@users.noreply.github.com>

* chore(rover): fixes to decimal and constrained flash mavlink message

Signed-off-by: dirksavage88 <dirksavage88@gmail.com>

* chore(gz): update encoder counts reference

Signed-off-by: dirksavage88 <dirksavage88@gmail.com>

* chore(rover): fix to outdated encoder pos reference

* fix(rover): update uorb message to account for 4 wheel encoders

Signed-off-by: dirksavage88 <dirksavage88@gmail.com>

* Update msg/WheelEncoders.msg

Co-authored-by: Michael Fritsche <64464652+Frigiii@users.noreply.github.com>

* fix(roboclaw): add in encoder position, counts per rev. Msg desc update

Signed-off-by: dirksavage88 <dirksavage88@gmail.com>

* chore(wheel_encoders): add description to top of msg file for docs

Signed-off-by: dirksavage88 <dirksavage88@gmail.com>

* chore(sim): fixes to initialize wheel pos m, rename wheel_encoder to wheel_distance

Signed-off-by: dirksavage88 <dirksavage88@gmail.com>

* Update src/lib/rover_control/rovercontrol_params.yaml

Co-authored-by: Michael Fritsche <64464652+Frigiii@users.noreply.github.com>

* Update src/modules/mavlink/streams/WHEEL_DISTANCE.hpp

Co-authored-by: Michael Fritsche <64464652+Frigiii@users.noreply.github.com>

* Update src/modules/simulation/gz_bridge/GZMixingInterfaceWheel.cpp

Co-authored-by: Michael Fritsche <64464652+Frigiii@users.noreply.github.com>

* Update src/modules/simulation/gz_bridge/GZMixingInterfaceWheel.hpp

Co-authored-by: Michael Fritsche <64464652+Frigiii@users.noreply.github.com>

* chore(rover): update wheel encoder msg, fixes to gz bridge

Signed-off-by: dirksavage88 <dirksavage88@gmail.com>

* chore(rover): Apply batched suggestions from code review

Co-authored-by: Michael Fritsche <64464652+Frigiii@users.noreply.github.com>

---------

Signed-off-by: dirksavage88 <dirksavage88@gmail.com>
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
Co-authored-by: Michael Fritsche <64464652+Frigiii@users.noreply.github.com>
2026-11-10 08:54:19 -05:00
Sofian ElmotiemandSofian Elmotiem 92b18d17f3 fix(msg): escape IDL keywords in uORB field names for idlc (#29696)
A uORB field named after an IDL keyword, such as `sequence` in several
MAVLink-M messages, made CycloneDDS idlc fail with a syntax error on any
build with CONFIG_LIB_CDRSTREAM, such as the Zenoh targets. Escaping the
name in the shared IDL is not enough: rosidl_parser, which computes the
RIHS01 type hash, rejects escaped identifiers.

Generate a second IDL copy for idlc with every field and constant name
escaped by a leading underscore. idlc strips the underscore, so the
generated C member names are unchanged. The hash step keeps reading the
plain IDL, so RIHS01 hashes and Zenoh key expressions are unchanged too.

Fixes #29600

Signed-off-by: Sofian Elmotiem <191787501+SofianElmotiem@users.noreply.github.com>
Co-authored-by: Sofian Elmotiem <191787501+SofianElmotiem@users.noreply.github.com>
2026-11-09 13:17:42 +00:00
f9088053ab fix(zenoh): px4_sitl_zenoh build on macOS (#29538)
zenoh is now part of px4_sitl_default, so the macOS SITL build compiles
it and fails in two places:

- msg: zenoh_topics was a static library with only a header as its
  source. macOS ar rejects the resulting empty archive ("no archive
  members specified"). It only orders header generation, so make it a
  custom target.
- zenoh: POSIX_COMPATIBLE makes zenoh-pico define ZENOH_LINUX ahead of
  its own Darwin detection, which pulls in the Linux-only getrandom().
  Set it only on non-Apple platforms. Linux is unaffected, and NuttX
  (CMAKE_SYSTEM_NAME Generic) keeps it.

Also mark the uORB_Zenoh_Subscriber overrides, consistent with the
publisher.

Signed-off-by: Beniamino Pozzan <beniamino.pozzan@gmail.com>
Co-authored-by: Farhang <46557204+farhangnaderi@users.noreply.github.com>
Co-authored-by: Beniamino Pozzan <beniamino.pozzan@gmail.com>
2026-11-08 22:15:08 -05:00
Hamish Willee d5a77d8fce docs(docs): ConfigOverrides.msg to uorb doc standard (#28658) 2026-11-06 06:08:32 +11:00
Michael Fritsche ec454b9a9b feat(msg): rename shared rover topics to surface_vehicle_* (#29524)
Signed-off-by: Michael Fritsche <frimi999@gmail.com>
2026-11-04 15:21:37 +01:00
Jacob DahlandBeniamino Pozzan be03ec79c9 feat(uxrce_dds_client): accept RTCM corrections from ROS 2 (#29368)
* feat(uxrce_dds_client): accept RTCM corrections from ROS 2

ROS 2 setups that need RTK had to keep a MAVLink link beside DDS just for GPS_RTCM_DATA. Routing by device_id gives each DDS source its own rtcm_corrections instance, so two publishers never interleave their byte streams. The DDS side needs no framing: the injectors reframe the stream from arbitrary chunks.

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

* docs(releases): note RTCM corrections over uXRCE-DDS

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

* fix(uavcan): bound RTCM corrections length before forwarding

uXRCE-DDS is the first rtcm_corrections source that does not bound len. A ROS 2 RtcmData with len over 300 made the DroneCAN forwarder read past the data array and broadcast that memory as RTCMStream.

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

* docs(msg): drop the uXRCE-DDS routing note from RtcmData

It described the client's routing rather than the message, and the device_id field comment already covers it.

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

* fix(uavcan): bound moving-baseline length before forwarding

The forwarder trusted the publisher's len, the same gap just closed for rtcm_corrections. No current publisher exceeds the array, so this only keeps a future one from reading past it.

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

---------

Co-authored-by: Beniamino Pozzan <beniamino.pozzan@gmail.com>
2026-11-03 11:39:08 -07:00
Jacob Dahlanddanielbuleandra ae7977f868 feat(dshot): log the ESC EEPROM dumps (#28800)
* fix(dshot): retry telemetry init until the motor mask is known

rc.serial issues `dshot telemetry` right after `dshot start`, and the first
Run() usually handles it before the mixer has reported the outputs.
initSettingsHandlers() then latches with an empty motor mask, so no ESC
settings handler is ever created and the EEPROM is never read.

Co-authored-by: danielbuleandra <daniel.buleandra@auterion.com>
Assisted-by: Claude:claude-fable-5-1
Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>

* feat(logger): log the ESC EEPROM dumps

The raw dump is logged through the existing queued esc_eeprom_read topic.
The layout depends on the ESC firmware and its EEPROM revision, so decoding
happens offline in Tools/esc_eeprom_decode.py against the schema the ESC
vendor publishes.

A subscriber that joins after the first publish only sees the newest queued
entry. The logger subscribes on a sweep that can lag a new topic by half a
second while all ESCs answer within milliseconds of each other, so the topic
is advertised when the settings handlers are created, well before the first
request goes out at ESC_INIT_TELEM_DELAY.

Co-authored-by: danielbuleandra <daniel.buleandra@auterion.com>
Assisted-by: Claude:claude-fable-5-1
Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>

* feat(dshot): publish and refresh cached ESC settings

Logs can start after boot or during flight, so cached settings must be published independently of arming. The queue must retain a complete set of ESC dumps for the logger and MAVLink stream.

Keep programming uninterrupted and cached data valid across saves and reconnects. Failed reads remain pending with spaced retries so one unresponsive ESC cannot starve the rest.

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

* fix(tools): decode repeated ESC dumps across firmware layouts

Logs contain repeated dumps and may mix EEPROM layouts. Collapse unchanged samples, apply the schema's version bounds and disabled values, and keep overlays immutable so one ESC cannot change another's decoding.

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

* fix(dshot): bound ESC settings read retries

A pending settings read blocks the telemetry round-robin until it completes or times out, and the retry spacing was kept per ESC. With several ESCs that never answer, reads ran back to back, telemetry went stale and the arming check reported every ESC offline.

Space retries across all ESCs, give up on one after three failed reads until it reconnects or is asked for again, and time a read out at 100 ms: AM32 answers within milliseconds of the sixth frame, and anything under the 400 ms arming-check window keeps telemetry fresh.

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

* fix(dshot): keep programming active until the save is sent

The flag was cleared when the save command was queued, so it no longer guarded the save itself. Only the finished() gate in the vehicle command loop kept a CONFIGURE_ACTUATOR from replacing it. Clear the flag when the last save frame goes out so the guard covers the whole sequence.

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

* fix(dshot): send each ESC EEPROM read once per MAVLink link

The once-a-second republish that keeps the dumps in every log also went out on every link with ESC_EEPROM configured, low-bandwidth ones included, one message per ESC per second. timestamp_sample records when a dump was read, so the stream forwards each read once per link and still reaches a link that connects later.

A motor waiting on an EDT retry or out of EDT attempts took the command slot without sending anything, so settings reads never ran while any ESC left EDT unconfirmed. Vehicle commands now wait for an outstanding settings read, which ends within 100 ms, instead of CONFIGURE_ACTUATOR being rejected.

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

* fix(msg): queue one ESC EEPROM dump per esc_status ESC

The republish queues every cached dump at once, so the queue needs one entry per ESC and no more. DSHOT_MAX_MOTORS is capped at CONNECTED_ESC_MAX, and the static_assert in AM32Settings.cpp keeps the two in step.

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

* fix(dshot): mark the settings save explicitly

Programming ended when any finished command carried the value 12, which the address and value frames do whenever they write offset 12 (active brake power) or a value of 12. The write then stopped part way, with the ESC still in programming mode and the next write resuming mid-sequence.

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

* fix(dshot): keep settings requests and writes to configured motors

An all-ESC save requested settings for every motor slot, and the single-ESC request and write paths took any index below the motor limit. Reads only go to motors with a settings handler, so the other bits stayed pending in dshot status forever. A write to an index with no output was never sent, so the command never finished and blocked every later command and the serial telemetry until reboot.

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

* docs(dshot): describe the logged ESC settings and their decoding

The page said the settings are only read at boot and only reach a ground station.

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

* feat(dshot): set the ciclicity to 10s for eeprom logging

---------

Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>
Co-authored-by: danielbuleandra <daniel.buleandra@auterion.com>
2026-11-03 08:14:51 -07:00
Beniamino PozzanandHamish Willee 05d2b24c94 feat(commander): add rpm-based motor stuck detection for MC (#29436)
* feat(commander): disarm if a motor is not spinning right after arming

During the spool-up window, while landed and before takeoff is detected,
a motor that is commanded to run but never reports RPM, or reports the
motor-stuck fault, raises a new failsafe flag. The failsafe then disarms,
like the existing ESC arming and battery spool-up failures. Motors with
a NaN command are ignored.

The check runs only for rotary-wing vehicles, since it assumes the
minimum output spins the motors. It is enabled by COM_ARM_CHK_ESCS and
needs per-motor RPM telemetry. It adds no parameters; timing is a
fraction of COM_SPOOLUP_TIME: nothing is evaluated up to 50%, and the
decision is made at 80%.

Assisted-by: Claude:claude-sonnet-5-5

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

* feat(sih): add motor stuck failure injection

`failure motor stuck -i N` models a stuck rotor with a healthy ESC: the
motor is still commanded but produces no thrust, and the ESC stays
online reporting zero RPM. The failure detector and control allocator
are not informed, unlike `motor off` and `motor wrong`.

The failure injection catalogue now accepts STUCK for the motor unit,
and SIH zeroes the thrust of the addressed motors, which also zeroes
their reported RPM. Other environments accept the command but do not
apply it, as documented in the failure injection table.

Assisted-by: Claude:claude-sonnet-5-5
Signed-off-by: Beniamino Pozzan <beniamino.pozzan@auterion.com>

* feat(sih): publish esc status for standard VTOL pusher

add case in motor_inded_from_actuator for StandardVTOL

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

* chore(params): increase COM_SPOOLUP_TIME default value to 2 seconds

This is to ensure that the motor has enough time to try to start
and the stuck-detection logic does not return false negative
when an attemp of spin is marked as healty motor

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

---------

Signed-off-by: Beniamino Pozzan <beniamino.pozzan@auterion.com>
Signed-off-by: Hamish Willee <hamishwillee@gmail.com>
Co-authored-by: Hamish Willee <hamishwillee@gmail.com>
2026-11-02 09:30:56 +00:00
Michael FritscheandHamish Willee d998124a2a feat(rover): add SurfaceVehicleCourseSetpoint for course hold (#29243)
* docs(msg): clarify RoverPositionSetpoint field descriptions

* feat(rover): introduce a course parameter to get rid of the course-hold workaround hack (#29245)

* fix(ros2): update ros2 interface lib pin to include course and target_ned in RoverPositionSetpoint

* style(msg): use single space before comments in RoverPositionSetpoint

The column padding triggers the msg doc generator's multiple-whitespace
note on every field.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Hamish Willee <hamishwillee@gmail.com>

* fix(msg): update RoverPositionSetpoint descriptions

* feat(msg): add SurfaceVehicleCourseSetpoint

* fix(repositories): update px4 ros2 interface lib version

* fix(msg): add comment that yaw in RoverPositionSetpoint msg is currently not used

* fix(msg): rename surface_vehicle_course_setpoint to planar_course_setpoint

* fix(rover): keep the course line while a course setpoint is streamed

A PlanarCourseSetpoint without start_ned re-anchored the line at the
vehicle position on every message. Publishers that stream the setpoint,
the usual pattern over ROS 2, therefore never got cross-track error
corrected: in SITL the rover drifted 3.8 m off course over 54 m. Keep the
current line while the same course is published without a start
position, and only re-anchor when the course changes.

Also document that a NaN course leaves the position controller idle and
that yaw is currently unused, matching RoverPositionSetpoint.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Michael Fritsche <frimi999@gmail.com>

* fix(msg): rename planar_course_setpoint to ugv_usv_course_setpoint

* docs(msg): add documentation for UgvUsvCourseSetpoint

* feat(rover): proper guided course implementation

* fix(rover): rename course setpoint cruising_speed param to speed

* fix(msgs): rename ugv_usv_course_setpoint.msg to surface_vehicle_course_setpoint.msg

* docs(rover): clarify course setpoint wording

Doc review fixes for the course hold docs and message comments:
unclear antecedents, a misplaced modifier, a missing verb, and the
pure pursuit sentence separated from the course setpoint text it no
longer described. The yaw @invalid tag now matches in both messages,
since no controller reads the field.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Hamish Willee <hamishwillee@gmail.com>

* Apply suggestion from @hamishwillee

* docs(rover): fix course tracking formulation for the different rover types

* fix(rover): maintain current speed upon guided course mode entry

* docs(rover): clarify guided course mode documentation.

* fix(rover): handle nav_state_land in rovers

* fix(rovers): polish the used terminology

* docs(rover): switch to list for guided course mode usable commands

---------

Signed-off-by: Hamish Willee <hamishwillee@gmail.com>
Signed-off-by: Michael Fritsche <frimi999@gmail.com>
Co-authored-by: Hamish Willee <hamishwillee@gmail.com>
2026-10-29 11:12:41 -04:00
Jonas Peroliniandjonas f26361d999 fix(vision_target_estimator): harden inputs and reset lifecycle (#29399)
* fix(vision_target_estimator): harden inputs and reset lifecycle

Retain acceleration until attitude is available and age it by sample time. Normalize vision attitude, invalidate published estimator states on reset, and enforce valid timeouts and delayed fallback scheduling across task transitions.

Assisted-by: Codex
Signed-off-by: jonas <jonas.perolini@rigi.tech>

* refactor(vision_target_estimator): remove runtime timeout clamping

Use configured timeouts directly and keep their permitted ranges in parameter metadata.

Assisted-by: Codex
Signed-off-by: jonas <jonas.perolini@rigi.tech>

---------

Co-authored-by: jonas <jonas.perolini@rigi.tech>
2026-10-25 10:09:58 -05:00
Jonas Peroliniandjonas 77c37ea4f6 perf(vision_target_estimator): cap OOSM observation storage (#29395)
Co-authored-by: jonas <jonas.perolini@rigi.tech>
2026-10-25 10:08:42 -05:00
Jonas Peroliniandjonas cafa463630 feat(vision_target_estimator): recheck observations during replay (#29394)
Co-authored-by: jonas <jonas.perolini@rigi.tech>
2026-10-25 10:08:22 -05:00
Jonas Peroliniandjonas 9fd8018713 fix(vision_target_estimator): handle future stamps, late freshness and replay failures (#29383)
Co-authored-by: jonas <jonas.perolini@rigi.tech>
2026-10-25 05:41:27 -08:00
Jonas Peroliniandjonas 23baf6c0e0 feat(vision_target_estimator): log replay diagnostics in the aid topics (#29381)
* feat(vision_target_estimator): log replay diagnostics in the aid topics

* docs(vision_target_estimator): correct NIS equation

---------

Co-authored-by: jonas <jonas.perolini@rigi.tech>
2026-10-24 10:45:26 +02:00
Julian Oes d17b623b19 feat(msg): widen system IDs to 32 bit
MAVLink 2 now supports 32-bit system IDs. The uORB fields carrying a
MAVLink system ID need to hold them, so VehicleStatus (v5),
VehicleCommand (v1), VehicleCommandAck (v2) and ManualControlSetpoint
(v2) get uint32 system ID fields, with translations to the previous
versions. Older versions get IDs above 255 clamped to 255.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Julian Oes <julian@oes.ch>
2026-10-23 22:48:49 +02:00
Mahima Yogaandfedericomagri12 02dbc12355 feat(navigator): continue in Guided Course after the fixed-wing takeoff (#28930)
* feat(navigator): hold a commanded course after the fixed-wing takeoff

A finite yaw in MAV_CMD_NAV_TAKEOFF (param4) ends the climbout in a
course hold at the takeoff altitude instead of a loiter, and the vehicle
stays in Takeoff mode. NaN keeps the loiter.

* feat(navigator): continue in Guided Course after a course takeoff

* fix(navigator): ignore lat/lon during a course-based takeoff

* fix(navigator): add guard for 0 heading takeoff

---------

Co-authored-by: federicomagri12 <federico.magri@auterion.com>
2026-10-23 12:00:48 +02:00
Saibernard 7efdb01978 fix(dataman): widen client IDs to 16 bit (#28944)
Signed-off-by: Saibernard Yogendran <bernie97@seas.upenn.edu>
2026-10-20 08:23:31 +02: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
Matthias Grob a919f4e687 refactor(msg): remove extra spacing and redundant comments 2026-10-19 09:24:23 +02:00
Jonas Peroliniandjonas 9e1c635ae7 fix(vision_target_estimator): correct startup timing and uncertainty (#29307)
Assisted-by: Codex

Co-authored-by: jonas <jonas.perolini@rigi.tech>
2026-10-18 17:02:15 -06:00
Akash KarkeraandHamish Willee d57419e2c8 fix(commander): introduce a mode_not_supported flag to route rovers to Stabilized mode on position loss (#28696)
* Refactor rover failsafe: Replace Parked mode with mode_req_not_possible flag

* Rename unsupported flag and restrict from ground station UI

* Complete global rename of mode_not_supported flag

* Apply PX4 CI code formatting

* Apply PX4 CI code formatting for ui.hpp

* Restrict VTOL/Descend on rovers and reroute fallback to disarm

* docs(rover): add failsafe fallback cascade to manual modes

* fix(failsafe): update rover fallback docs, honor COM_POS_FS_ACT, and add unit test

* style: fix indentation for CI

* docs: move rover failsafe sequence to end of page and format

* docs(rover): move failsafe fallback sequence to drive modes overview

The fallback cascade applies across rover drive modes rather than to
Manual mode specifically, so it belongs on the parent overview page.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Hamish Willee <hamishwillee@gmail.com>

---------

Signed-off-by: Hamish Willee <hamishwillee@gmail.com>
Co-authored-by: Hamish Willee <hamishwillee@gmail.com>
2026-10-14 10:50:06 +02:00
Matthias Grob 4e11f71f6d fix(rc_update): handle every RC map function with sanitization on access 2026-10-13 14:49:20 +02:00
Silvan 026f8d1fa8 docs(fw): define the fixed-wing pitch angle and FW_PSP_OFF
PX4 never said in which frame fixed-wing pitch angles are given, and
FW_PSP_OFF was described as an offset added to the pitch setpoint and as
the angle of attack, which holds only for TECS and Stabilized mode, and
only in level flight measured from the body x-axis.

- Trimming guide: a side-view diagram of the body frame, the pitch angle
  and FW_PSP_OFF, and where FW_PSP_OFF is used.
- Messages: state that pitch setpoints and limits are absolute, drop the
  FRD frame tag on an Euler angle, correct the pitch range to +-pi/2,
  and describe the TECS pitch integrator as a correction term.
  Comment-only, so no message version change.
- Parameters: describe FW_PSP_OFF as the level-flight pitch, mark the
  absolute pitch parameters as such, and describe the asymmetric
  FW_MAN_P_MAX range with a non-zero FW_PSP_OFF.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Silvan <silvan@auterion.com>
2026-10-13 11:36:46 +02:00
Mahima Yoga f16f99d4b5 feat(sensors): support multiple airspeed sensors (#28832)
* feat(lib/sensor_calibration): add differential pressure calibration

Airspeed sensors had a single global zero offset, so a second or third
sensor could not be calibrated.

Link the calibration to the sensor's device ID, following the existing
barometer and magnetometer pattern, so the offsets stay bound to physical
sensors rather than to uORB instance order.

Signed-off-by: mahima-yoga <mahima@auterion.com>

* feat(sensors): support multiple airspeed sensors

The airspeed selector has always been able to validate and fail over
between three airspeed sensors, but nothing ever produced more than one.

Give each differential pressure sensor its own VehicleAirspeed item,
which owns its calibration, validator and airspeed publication, following the
VehicleIMU pattern.

Airspeed carries the device ID of the sensor it came from, so consumers
can tell the instances apart. The calibration routine now calibrates every
connected sensor.

Signed-off-by: mahima-yoga <mahima@auterion.com>

* refactor(sensors)!: replace SENS_DPRES_OFF with per-sensor calibration

SENS_DPRES_OFF applied one zero offset to whichever airspeed sensor
happened to come first, which cannot work once there is more than one
sensor. It is superseded by CAL_DPRESx_OFF.

BREAKING CHANGE: SENS_DPRES_OFF is removed. Ground stations that read it
to decide whether airspeed has been calibrated must check CAL_DPRES0_ID
instead, matching how CAL_MAG0_ID, CAL_GYRO0_ID and CAL_ACC0_ID are
already used.

Signed-off-by: mahima-yoga <mahima@auterion.com>

* feat(logger): log all airspeed and differential pressure instances

The airspeed selector supports up to three airspeed sensors, but the
logger only recorded one airspeed instance and two differential pressure
instances.

Signed-off-by: mahima-yoga <mahima@auterion.com>

* fix(commander): stop airspeed calibration consuming a new slot each time

Signed-off-by: mahima-yoga <mahima@auterion.com>

* fix(sensors): give the analogue airspeed sensor a device ID

Signed-off-by: mahima-yoga <mahima@auterion.com>

* fix(boards): keep the airspeed conversion in ITCM

Signed-off-by: mahima-yoga <mahima@auterion.com>

* refactor(sensors): initialise airspeed instances outside the main loop

Signed-off-by: mahima-yoga <mahima@auterion.com>

* chore(sensors): correct the copyright year on the new CMakeLists

Signed-off-by: mahima-yoga <mahima@auterion.com>

* refactor(airspeed_selector): share the airspeed sensor count constant

Signed-off-by: mahima-yoga <mahima@auterion.com>

* docs(sensor_calibration): explain the unusable calibration slot guard

Signed-off-by: mahima-yoga <mahima@auterion.com>

* fix(sensors): keep SENS_DPRES_OFF as a mirror of the first sensor

Signed-off-by: mahima-yoga <mahima@auterion.com>

---------

Signed-off-by: mahima-yoga <mahima@auterion.com>
2026-10-12 10:51:22 +02:00
SaibernardandJacob Dahl 1a3f7971b9 fix(battery): stop a charging battery from disabling battery failsafes (#29012)
* fix(battery): don't let a charging battery switch off the battery failsafes

Since #28422 a DroneCAN battery that sets its charging flag reports
WARNING_CHARGING, which is 7. The battery check keeps the highest warning
across batteries and, while armed, only lets it rise, but the failsafe has
no action for 7. So one charging report outranked a real emergency on
another pack and stayed latched until disarm, and a vehicle that armed
while still charging on a dock never got a low battery failsafe at all.
The driver also replaced a real low, critical or emergency warning with
charging, so a nearly empty pack on a charger still passed the arming
check.

The driver now reports charging only while the pack has no real warning,
and the battery check treats charging as no warning when it picks the
worst one. MAVLink still shows charging while the pack has no warning.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Saibernard Yogendran <bernie97@seas.upenn.edu>

* test(commander): cover a charging battery in the battery check

A charging pack doesn't outrank another pack's emergency, charging at
arming doesn't latch over a later low or critical warning, and charging
on its own is no warning. All three fail without the fix.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Saibernard Yogendran <bernie97@seas.upenn.edu>

* docs(msg): say WARNING_CHARGING is a state, not a severity

The DroneCAN driver only reports charging when no other warning applies,
and the battery check and HIGH_LATENCY2 stream rely on that and on not
ordering it against the real warnings.

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

* fix(mavlink): don't flag a charging battery as failed in HIGH_LATENCY2

WARNING_CHARGING is 7, so the greater-than-LOW test set
HL_FAILURE_FLAG_BATTERY for every healthy pack on a charger.

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

---------

Signed-off-by: Saibernard Yogendran <bernie97@seas.upenn.edu>
Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>
Co-authored-by: Jacob Dahl <dahl.jakejacob@gmail.com>
2026-10-06 19:19:01 -06:00
ac97d5263a feat(commander)!: Replace CBRK_IO_SAFETY with COM_SAFETY_MODE for more options (#28744)
* feat(commander): only report safety button as available when it is available and configured to be used via COM_PREARM_MODE

* feat(commander): add a new option to COM_PREARM_MODE to explicitly and exclusively allow prearming via VEHICLE_CMD_DO_SET_SAFETY_SWITCH_STATE

* feat(commander): explicit dedicated safety-button-only and mavlink-only prearm modes

* fix(commander): also accept VEHICLE_CMD_DO_SET_SAFETY_SWITCH_STATE on Always and Disarmed pre-arm profiles to match documentation

* docs(prearm): update docs with new prearm mode behaviour

* fix(commander): fix syntax for bool

* docs(prearm): revert last param table, as COM_FORCE_SAFETY is already mentioned in a table above.

* docs(prearm): fix MAVLink spelling, grammar and parameter table

Make the pre-arm docs consistent with the COM_PREARM_MODE parameter and
the docs style guide: MAVLink is spelled consistently (page and option
labels), selectable option names are shown in code style, the parameter
table lists all five COM_PREARM_MODE options with the correct default,
and sentences are fixed and put one per line.

Question for the author: the COM_PREARM_MODE option labels say "Safety
button", while the docs say "safety switch". Are these synonyms? If so,
which term should we use in both places? If not, what is the difference?

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Hamish Willee <hamishwillee@gmail.com>

* fix(commander): clean up _button_disabled logic: button still needs to be enabled in Disabled and Always prearmed modes to switch safety off.

* docs(prearm): adjust COM_PREARM_MODE description and clarify/fix/improve prearm docs

* chore(VehicleCommand.msg): improved comments

* chore(msg): v0->v1 translation for VehicleCommand.msg

* Revert "chore(msg): v0->v1 translation for VehicleCommand.msg"

This reverts commit 50ea14fc76310ba7b53ebcd1c6ee8cf4e1c0776b.

* feat(commander): deny VEHICLE_CMD_DO_SET_SAFETY_SWITCH_STATE when not accepted

* feat(commander): COM_SAFETY_MODE replaces CBRK_IO_SAFETY

* docs(prearm): update docs with new COM_SAFETY_MODE behaviour

* docs(prearm): minor cleanup

* fix(commander): migrate CBRK_IO_SAFETY and correct safety ACKs

A stored CBRK_IO_SAFETY=0 was dropped on import, so upgraded vehicles booted with COM_SAFETY_MODE=0 and safety off. The CAN GPS nodes have no commander, so setting COM_SAFETY_MODE there only logged an error at boot. A SAFETY_SAFE command in mode 0 and ESC calibration with safety on were ACKed ACCEPTED while doing nothing.

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

---------

Signed-off-by: Hamish Willee <hamishwillee@gmail.com>
Co-authored-by: Hamish Willee <hamishwillee@gmail.com>
Co-authored-by: Jacob Dahl <dahl.jakejacob@gmail.com>
2026-10-06 17:35:07 -06:00
Thomas Stauber f629d451de fix(VehicleCommand.msg): rename and align enum for DO_SET_SAFETY_SWITCH_STATE to match MAVLink standard (#28948) 2026-10-02 16:50:39 -06:00
Jacob Dahl 8e67d725de feat(gnss): keep one receiver each on GPS_RAW_INT and GPS2_RAW (#28940)
An operator reads the two messages as two fixed receivers, but SensorGpsSelector resolved SENS_GNSS_PRIME in the MAVLink streams on its own and put instance 0 on GPS_RAW_INT whenever no receiver was named. The sensors module now gives every receiver a fixed position on sensors_status_gnss: 0 for the preferred receiver, otherwise for the first to publish, then in order of first publication. GPS_RAW_INT and GPS2_RAW report positions 0 and 1, and more receivers fit once MAVLink has an instanced GNSS message. MAX_RECEIVERS names the array length, as .msg array sizes can't reference a constant.

Assisted-by: Claude:claude-opus-5-5
2026-09-30 17:26:52 -06:00
Jacob DahlandAndrea Bernasconi d6c24648a6 feat(ekf2): reset position when the GNSS receiver changes (#28939)
* feat(ekf2): reset position when the GNSS receiver changes

Receivers report positions in the frame of their correction source and
compute the altitude with their own geoid model, so a switch of the
receiver behind vehicle_gnss steps the measured position. EKF2 fused that
step as a normal measurement.

EKF2 now counts the changes of the selected receiver from its device_id
and resets the horizontal position to the new receiver on its first
fused sample, as proposed in the GNSS selection RFC (#28813). A receiver
without a device_id isn't counted. If another source constrains the
position, GNSS position fusion restarts instead, once the new receiver is
consistent with it. The height is reset if GNSS is the height reference,
otherwise the offset goes into the GNSS height bias.

The count stays in EKF2 for now. vehicle_gnss, next to the selection
that causes it, is the natural place for it in a follow-up.

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

* feat(gnss): count receiver changes in the sensors module

EKF2 counted the changes of the selected receiver itself from the device_id, in every EKF instance, and couldn't tell apart receivers without one. The sensors module makes the switch, so it now stamps selection_count and selected_instance on vehicle_gnss and EKF2 resets on that count.

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

---------

Signed-off-by: Andrea Bernasconi <andrea.bernasconi@auterion.com>
Co-authored-by: Andrea Bernasconi <andrea.bernasconi@auterion.com>
2026-09-30 17:13:46 -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
Jacob Dahl df34662110 docs(msg): keep implementation details out of the GNSS message comments (#28932)
Message comments describe the message and its fields. These named parameters, a threshold and the logic of the code that fills or reads them, which goes stale when that code changes.

Assisted-by: Claude:claude-fable-5-1
2026-09-30 11:45:21 -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
Daniel Buleandră 1dbf64d67e fix(vtx): Update peak thor parameter name and remove Rush MAX SOLO (#28692)
Rename the VTX_DEVICE entry for the Peak THOR so it lists the supported
models, and drop the Rush MAX SOLO device entirely: its VTX_DEVICE enum
value and the DEVICE_RUSH_MAX_SOLO constant in Vtx.msg.

A stored VTX_DEVICE of 10240 (Rush MAX SOLO) is migrated to Generic with
Tramp, the only protocol it speaks.
2026-09-30 13:27:50 +02: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
Julian Oes 107d8bb038 fix(mavlink): forward received frames unchanged (#28891)
* fix(mavlink): forward received frames unchanged

Forwarded messages were queued as a truncated copy of mavlink_message_t
and re-serialized on the way out. The signature bytes were never
copied, so forwarded signed messages went out with a garbage signature.

Messages which are not in our dialect were not forwarded at all: the
parser can't check their CRC without CRC_EXTRA, reports them as bad CRC,
and mavlink_parse_char() drops them.

Frames are now queued as they arrived, checksum and signature included,
and written out as is. Following the MAVLink routing guide, frames that
can't be processed locally are still forwarded but not handled: unknown
MAVLink 2 messages, and messages whose signature can't be verified. The
signature isn't checked or removed, that's up to the receiver, which
may well have a different key than PX4. SETUP_SIGNING is still never
forwarded.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Julian Oes <julian@oes.ch>

* fix(mavlink): only apply SETUP_SIGNING addressed to us

The target of SETUP_SIGNING was ignored, so a key meant for another
system or component, e.g. a companion computer, was applied to PX4 and
all its links instead.

SETUP_SIGNING is now only applied when it is broadcast or addressed to
us. Otherwise it is dropped, as it must never be forwarded, and a
warning tells the user that it didn't reach its target.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Julian Oes <julian@oes.ch>

* refactor(mavlink): forward messages from one place

Messages which were handled locally were forwarded from the end of
Mavlink::handle_message(), while frames which can only be forwarded
took a separate path in the receive loop. Forwarding is now decided in
one place in the receive loop for both, and Mavlink::handle_message()
only deals with SETUP_SIGNING.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Julian Oes <julian@oes.ch>

* refactor(mavlink): check forwarding enabled only once

Whether to forward is decided by forward_if_enabled(), so
forward_only_frame() only needs to decide whether a frame is valid but
can't be processed locally. As a result, unknown and incorrectly signed
frames no longer count as parse errors, independent of whether
forwarding is enabled.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Julian Oes <julian@oes.ch>

* feat(mavlink): count unknown and incorrectly signed messages

Messages which are not in our dialect or whose signature can't be
verified are not processed and no longer count as parse errors. Count
them per link in telemetry_status instead, so they show up in the log
and in mavlink status, e.g. to find a sender using the wrong key.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Julian Oes <julian@oes.ch>

* fix(mavlink): count lost messages correctly across sequence wrap-around

The sequence number wraps from 255 to 0, so the gap across the wrap is
seq + 256 - expected, not seq + 255 - expected. Every wrap-around with
loss undercounted by one message.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Julian Oes <julian@oes.ch>

* fix(mavlink): report rx message loss as a fraction of all messages

rx_message_lost_rate was lost / received, which exceeds 1 with heavy
loss and is 0/0 before anything was received, and mavlink status then
printed that ratio as a percentage without scaling it. It is now
lost / (received + lost), 0 if nothing was received yet, and printed
as a percentage.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Julian Oes <julian@oes.ch>

* fix(mavlink): don't forward unauthenticated frames when signing is active

With a signing key loaded, frames which fail PX4's signature check were
forwarded to the other links. PX4 keeps unauthenticated traffic from
e.g. the radio away from components which don't sign themselves, as the
signing docs describe, so drop them again, and count them as bad
signatures.

Unknown messages are reported as bad CRC by the parser, which doesn't
report their signature result, so apply the same rules to them: with
signing active they are only forwarded if signed with PX4's key or
allowed unsigned.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Julian Oes <julian@oes.ch>

* fix(mavlink): don't count forwarded unknown messages as lost

Unknown messages didn't advance the sender's sequence, so the next
message from it counted them as lost. Track their sequence as well, but
only for components we have already seen: the header of an unknown
message isn't CRC checked, and garbage IDs would fill the component
table, which is also used for routing.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Julian Oes <julian@oes.ch>

* fix(mavlink): forward signed frames PX4 can't verify

With signing active, a signed frame which fails PX4's check might be
signed with the receiver's key, so forward it for the receiver to
check, as the MAVLink routing guide says, but don't process it.
Unsigned frames are still dropped, apart from the unsigned allowlist,
so an attacker still can't send unsigned messages through PX4.

Suggested by @dakejahl in review.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Julian Oes <julian@oes.ch>

* fix(mavlink): drop signed frames PX4 can't verify again

This reverts commit 80639d05d8. Setting the signed flag and appending a
random signature is trivial, so forwarding signed frames that fail
verification would let an attacker reach components behind PX4 that
don't check signatures themselves, just like unsigned frames. In
practice all systems share one key anyway, so with signing active only
forward what verifies with PX4's key, or is on the unsigned allowlist.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Julian Oes <julian@oes.ch>

* docs(mavlink): signing assumes one shared key

Make explicit that all systems and components share one symmetric key,
that components communicating through PX4 need to use PX4's key, and
that incorrectly signed messages are not forwarded, so they don't reach
components behind PX4 which don't check signatures themselves.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Julian Oes <julian@oes.ch>

---------

Signed-off-by: Julian Oes <julian@oes.ch>
2026-09-30 10:55:25 +13: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
Jacob Dahl eb8f2f9b42 refactor(ekf2): separate GNSS heading from position into independent topic (#27102)
* feat(sensors/vehicle_gps_position): publish GNSS heading on its own topic

Dual-antenna heading was only reachable through the blended
vehicle_gps_position, so it carried the position timestamp, followed the
position blending weights and was published at the position rate.
vehicle_gnss_heading carries one selected source at a time, preferring
sensor_gnss_relative (callback driven) and falling back to
sensor_gps.heading for receivers that do not publish it. Per-receiver
delay and the driver heading offset are resolved by device_id; a sample
timestamp within 10 ms of the publish timestamp is treated as unset so
the configured delay applies.

* refactor(ekf2): fuse GNSS heading from its own sample buffer

Heading rode on gnssSample and was only fused when a position sample was
popped: faster heading was dropped by the observation rate limit, its
timestamp was the position timestamp and a position outage blocked the
start. gnssYawSample has its own TimestampedRingBuffer and pop. Non-finite
yaw is rejected at the interface and a NaN heading_offset is treated as
zero instead of reaching the fusion Jacobian. The test simulator feeds
heading as an independent sensor.

* feat(sensors/vehicle_gps_position): per-receiver baseline rotation SENS_GPSn_ROT

The antenna baseline orientation lived in three places depending on the
transport: the serial driver (GPS_YAW_OFFSET), the Septentrio receiver
(SEP_YAW_OFFS, SEP_PITCH_OFFS) and EKF2 for anything arriving with a NaN
offset, in practice CAN receivers (EKF2_GPS_YAW_OFF). A second receiver
with a different baseline had no parameter at all. Drivers now publish
the raw baseline heading and vehicle_gps_position rotates it into the
body frame from the receiver's SENS_GPSn_* slot, the same Rotation enum
the other sensors use, before blending and before publishing
vehicle_gnss_heading. Bumps PX4-GPSDrivers so sensor_gnss_relative
carries a real UTC time and no parse-time sample timestamp, which lets
the relative-position heading be delay-compensated and PPS-aligned.

* refactor(drivers/gps): drop the UBX heading_offset setting

Bumps PX4-GPSDrivers to PX4/PX4-GPSDrivers#241, which removes the
driver-side heading offset now that SENS_GPSn_ROT is the only place the
baseline is rotated.

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

* refactor(sensors/vehicle_gps_position): remove sensor_gps.heading_offset

With the baseline rotation in SENS_GPSn_ROT, a finite offset only meant
"the driver already rotated this heading, skip SENS_GPSn_ROT". The only
remaining writer was older DroneCAN node firmware through the Fix2 ECEF
hack, which made a CAN node's heading switch between two conventions
depending on whether a RelPosHeading arrived between Fix2 messages: with
a non-zero SENS_GPSn_ROT yaw the heading jumped by that angle. Every
receiver's heading is now the measured baseline and SENS_GPSn_ROT is the
only rotation. MicroStrain external heading aiding, which recovered the
baseline heading from vehicle_gps_position, reads vehicle_gnss_heading.

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

* fix(mavlink): report the body-frame GNSS heading in GPS_RAW_INT and GPS2_RAW

sensor_gps now carries the measured baseline heading, so for a baseline
not along the body x axis the yaw field was off by the mounting angle.
The body-frame heading is taken from vehicle_gnss_heading when the
streamed receiver is the heading source.

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

* fix(replay): replay vehicle_gnss_heading to EKF2

ReplayEkf2 publishes only the topics it lists from inside the lockstep
barrier, so EKF2 replay never received the heading.

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

* feat(parameters): migrate GNSS heading offsets to SENS_GPSn_YAW

GPS_YAW_OFFSET, SEP_YAW_OFFS and EKF2_GPS_YAW_OFF were removed without a
migration, so an upgraded vehicle silently lost its antenna mounting
offset and its GNSS yaw was off by that angle.

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

* fix(sensors/vehicle_gps_position): build GNSS heading only where it is consumed

The heading selection, baseline rotation and SENS_GPSn_ROT parameters
overflowed diatone_mamba-f405-mk2 flash by 657 bytes. Boards built
without EKF2 GNSS yaw fusion or MicroStrain have no consumer for
vehicle_gnss_heading, so SENSORS_VEHICLE_GNSS_HEADING defaults on only
with one of them. The parameter migration also drops fmodf, since the
old parameters never exceeded one wrap.

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

* feat(sensors/vehicle_gps_position): carry the heading receiver's jamming and spoofing state

So that EKF2 can gate GNSS yaw on the receiver providing the heading, which is not necessarily the position receiver.

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

* fix(ekf2): gate GNSS yaw on the heading, not the position checks

Yaw fusion could only start once the position checks passed, and stopped with them. On an ARK G5 outdoors the heading was good from 36 s after power-up and was first fused at 104 s, held back by EPV while Galileo HAS converged; a 0.45 s PDOP failure while the vehicle was handled on the ground stopped yaw for 10 s with its innovations under 5.4 deg.

The heading is its own observation, often from its own receiver: yaw now starts on fresh data, tilt alignment and the heading receiver's spoofing and jamming state under the EKF2_GPS_CHECK bits, and keeps running when position and velocity fusion stop. The hold-off after a yaw fusion failure was a side effect of the position checks resetting; it is now a yaw timer that withholds the heading from a reset for the GNSS health time.

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

* fix(sensors/vehicle_gps_position): carry an unknown GNSS sample time as 0

A GNSS sample time within 10 ms of the publish time was treated as unset and replaced by SENS_GPSn_DELAY. An ARK G5 over DroneCAN measures 8.3 to 21.5 ms from epoch to receipt, so 0.4% of its headings were re-stamped 110 ms early; at 20 Hz EKF2 dropped them as out of order, at a lower rate they would have been fused 100 ms late. A stamp meaning unset that crossed a busy bus in more than 10 ms would have been trusted instead.

Unknown is now 0 end to end: the serial driver leaves timestamp_sample at 0, the CAN node sends RelPosHeading's timestamp as UNKNOWN for it, and the autopilot's bridge publishes 0 when the node timestamp can't be used. Any other sample time before the publish time is trusted.

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

* feat(sensors/vehicle_gps_position): derive the GNSS heading baseline from antenna positions

SENS_GPSn_ROT and its Euler angles carried one number: roll never moves a baseline along x, pitch only flagged a vertical one, and the heading model uses the baseline yaw alone. Nothing checked the heading against the installation either, so a receiver that flagged float solutions as valid reset yaw 87 deg wrong at first fix on an ARK G5 moving-base pair.

As in ArduPilot, the baseline now comes from the antenna positions: SENS_GPSn_HDG selects the other receiver's antenna (moving base, from both slots' SENS_GPSn_OFF) or a custom SENS_GPSn_BLX/Y/Z (single dual-antenna receiver), and a heading is used only when the receiver reports a baseline within 20% of it in length and in its vertical component over the sample's attitude. Those float solutions reported 10.9 m and 1.04 m for a 0.347 m baseline. A source is published once it has passed for 1 s: the headings right after the base antenna was re-plugged passed for 0.9 s while up to 25 deg wrong. vehicle_gnss_heading logs the reported baseline length.

A yaw offset can't be turned into a baseline, so GPS_YAW_OFFSET, SEP_YAW_OFFS and EKF2_GPS_YAW_OFF are not migrated; GNSS yaw stays off, with a warning, until SENS_GPSn_HDG is set.

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

* fix(ekf2): stop GNSS yaw on a spoofed or jammed heading receiver

The heading receiver's spoofing and jamming state only kept yaw fusion from starting; a receiver that reported spoofing in flight kept feeding yaw, where position fusion stops. Its samples are now not fused, the fusion stops once none has been for the reset timeout, and a reset to its heading waits for the GNSS health time, as for position.

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

* docs(dronecan): configure the ARK G5 heading baseline on the autopilot

The page still configured the heading offset with the module's SEP_OFFS_YAW, and required GPS blending for the heading to be published, which no longer carries it.

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

* fix(sensors/vehicle_gps_position): drop a mismatched GNSS heading without restarting the settle

Outdoors on an ARK G5 moving-base pair 0.35 m apart, the reported down component of the baseline scattered by up to 0.16 m while the airframe was turned, and 9 cm at rest, against the 7 cm the vertical check allows. The rejected headings were as good as the accepted ones, but every rejection restarted the 1 s settle, so during 720 deg turns a heading was published for 4 to 62% of the time.

A sample that fails the baseline checks is now only dropped; the settle restarts when the receiver reports no heading. Replayed on that log, 85 to 99% of the turns get a heading.

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

* fix(sensors/vehicle_gps_position): drop the GNSS heading baseline's vertical check

The check compared the reported down component of the baseline with the configured baseline rotated by the vehicle attitude, within 20% of the baseline length. On an ARK G5 moving-base pair 0.35 m apart the down component scattered by up to 9 cm at rest and 0.16 m while the airframe was turned, so it rejected good headings: across seven outdoor logs it rejected 184 samples under 5 deg of error and 6 over 10 deg, all of which the EKF innovation gate would handle, and nothing the length check missed on a receiver that withholds float headings.

The length check and the near-vertical check on the reported baseline stay. The sensors module no longer reads the vehicle attitude to check the heading.

* feat(sensors/vehicle_gps_position): SENS_GNSSn_HDG with the auxiliary antenna position

The heading parameters are new, so they take the GNSS name the rest of the SENS_GPS family moves to rather than being renamed again shortly. The setup names what the receiver is: the rover of a moving base pair, or a receiver with two antennas. For the latter the second antenna is given by its position, like the main one's SENS_GPSn_OFF, so every setup derives the baseline from antenna positions.

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

* feat(drivers/septentrio): publish the heading baseline on sensor_gnss_relative

The heading only reached PX4 through sensor_gps, without the baseline the receiver measured, so the sensors module could not check it against the configured one and a heading from float ambiguities, confident on a baseline metres off, was used. AuxAntPositions (dual antenna) or BaseVectorGeod (moving base rover) now go out with the heading of the same epoch on sensor_gnss_relative at EndOfAtt, the heading valid only with fixed ambiguities. Ported from ARK's driver, where it was tested outdoors on mosaic-G5 P3H, P6 and P8.

A receiver that rejects the extra blocks falls back to the previous output without a heading. The heading accuracy is the square root of the reported variance; it was the deg^2 variance scaled as if it were degrees.

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

* refactor(sensors/vehicle_gps_position): take GNSS heading only from sensor_gnss_relative

The sensor_gps fallback carried no reported baseline, so its headings skipped the length check that rejects a wrong ambiguity fix. Every receiver that matters now reports on sensor_gnss_relative: u-blox, Septentrio, the Unicore UM982 (PX4/PX4-GPSDrivers bump) and DroneCAN RelPosHeading. The heading fields of sensor_gps go, with the paths that filled them: NMEA HDT, Trimble MB-Two, Femtomes, SBG and MicroStrain, the heading in DroneCAN Fix2 on both the node and the autopilot, and the RelPosHeading copy into sensor_gps.

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

* docs(gps_compass): configure GNSS heading with SENS_GNSSn_HDG

The heading parameters were renamed and the heading now only comes from receivers that report their baseline, so the Trimble MB-Two and Femtomes pages no longer describe a heading setup. The antenna spacing is the recommended 30 cm rather than the 5 cm the code rejects below.

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

* chore(drivers/gps): point PX4-GPSDrivers at the merged PX4/PX4-GPSDrivers#242

The submodule tracked the PR's branch commit; the squash-merged commit has the same tree.

Assisted-by: Claude:claude-opus-5-5
2026-09-28 17:37:58 -06:00
Andrea Bernasconi b38dcb1f6c fix(navigator): use "Return" instead of "RTL" in user-facing text (#28543) 2026-09-26 12:40:56 +10:00
yannickpoffetandMichael Fritsche 78c5eafa85 feat(new-mode): Add new parking mode (#28469)
* feature(new-mode): Add new parking mode

This mode is an extension of the manual mode.
It is to be used to manoevre platforms precisely in tight spaces, such as when parking rovers or when docking a boat.
It is designed to be used with a joystick and allows for precise control of the vehicle's position and orientation.

* feat(rover): implement manual parking modes and add docs

* fix(rover): move from percent based to normalized max throttle in manual parking mode

* fix(rover): improve parking mode description in docs

---------

Co-authored-by: Michael Fritsche <frimi999@gmail.com>
2026-09-25 13:29:19 -04:00
Silvan 1bcefdd86c feat(docs): improve IC engine docs
- add dedicated page for ICE config and explanation
- update diagrams and screenshots

Signed-off-by: Silvan <silvan@auterion.com>
2026-09-24 12:10:34 +02:00
Silvan 2c5c54a3d5 chore(ice): improve format and description of ICEControl.msg
Signed-off-by: Silvan <silvan@auterion.com>
2026-09-24 12:10:34 +02:00
Silvan 6a63433195 chore(ice): change enum for user_request into bool
Signed-off-by: Silvan <silvan@auterion.com>
2026-09-24 12:10:34 +02:00
Julian Oes e16fbcc2f9 refactor(gimbal): drop unused external manager info topic to fit flash
The ROI forwarding path only needs GIMBAL_MANAGER_STATUS from an external
manager: it provides discovery (manager sysid/compid, gimbal device id) and
control ownership. GIMBAL_MANAGER_INFORMATION only added capability flags and
angle limits, which nothing uses until RC forwarding (deferred).

Carrying the extra uORB topic and its receiver handler pushed the tightest
board variant over its flash budget (ark_pi6x_encrypted_logs overflowed by
500 bytes). Drop the external_gimbal_manager_information topic; discovery and
ownership come from the status topic. It can return with RC, which actually
needs the angle limits.

Signed-off-by: Julian Oes <julian@oes.ch>
2026-09-22 15:15:30 +12:00
Hamish Willee d325e443e2 docs(docs): Uorb topic docs to standard
Co-authored-by: Hamish Willee <hamishwillee@gmail.com>
2026-09-22 15:15:30 +12:00
Hamish Willee ff2817be15 docs(docs): Uorb topic docs to standard
Co-authored-by: Hamish Willee <hamishwillee@gmail.com>
2026-09-22 15:15:30 +12:00