feat(sensors/vehicle_gps_position): per-receiver baseline rotation SENS_GPSn_ROT - #28653
Closed
dakejahl wants to merge 3 commits into
Closed
feat(sensors/vehicle_gps_position): per-receiver baseline rotation SENS_GPSn_ROT#28653dakejahl wants to merge 3 commits into
dakejahl wants to merge 3 commits into
Conversation
…opic 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.
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.
…NS_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.
dakejahl
marked this pull request as draft
September 10, 2026 04:37
Contributor
🔎 FLASH Analysispx4_fmu-v5x [Total VM Diff: 2440 byte (0.12 %)]px4_fmu-v6x [Total VM Diff: 2064 byte (0.11 %)]Updated: 2026-09-10T04:39:48 |
Contributor
|
No broken links found in changed files. |
Contributor
Author
|
Folded into #27102. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replaces
GPS_YAW_OFFSET,SEP_YAW_OFFS,SEP_PITCH_OFFSandEKF2_GPS_YAW_OFFwith a per-receiver baseline rotationSENS_GPSn_ROT(the standard sensorRotationenum, custom Euler viaSENS_GPSn_ROLL/PITCH/YAW) next to the existingSENS_GPSn_ID,SENS_GPSn_OFFX/Y/ZandSENS_GPSn_DELAY. Stacked on #27102; the first two commits are that PR. Bumps PX4-GPSDrivers to PX4/PX4-GPSDrivers#240.Problem
The antenna baseline orientation lived in three places depending on the transport: in the serial driver (
GPS_YAW_OFFSET, subtracted before publish), inside the Septentrio receiver (SEP_YAW_OFFS,SEP_PITCH_OFFS), and in EKF2 for everything that arrived with a NaN offset, in practice CAN receivers (EKF2_GPS_YAW_OFF). A CAN receiver needed the node'sGPS_YAW_OFFSETand the autopilot'sEKF2_GPS_YAW_OFFto agree, and a second receiver with a different baseline had no parameter at all. u-blox stampedsensor_gnss_relativewith a parse-timetimestamp_sampleand an iTOWtime_utc_usec, so the relative position could not be delay-compensated or PPS-aligned.Solution
Drivers publish the raw baseline heading with
heading_offset = NaN; a driver that already reports a body-frame heading keeps a finiteheading_offsetand is left alone.vehicle_gps_positionresolves the receiver's slot by device_id, rotates the baseline into the body frame before blending and before publishingvehicle_gnss_heading, and hands the offset to EKF2 through the message. The baseline yaw is the yaw of the rotated x-axis; a vertical baseline yields no heading. Septentrio receivers get their attitude offsets zeroed. With a realtime_utc_useconsensor_gnss_relative, PPS correction now applies on the relative-position path as well.Behavior change for CAN nodes running older firmware: they still apply their own
GPS_YAW_OFFSET, which must be 0 whenSENS_GPSn_ROTis set.