mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-11-22 14:19:57 +08:00
* 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
18 lines
1.3 KiB
Plaintext
18 lines
1.3 KiB
Plaintext
# GNSS heading from a dual-antenna or moving-baseline receiver
|
|
#
|
|
# Published by the sensors module from sensor_gnss_relative. Consumed by EKF2 independently from position and velocity.
|
|
|
|
uint64 timestamp # time since system start (microseconds)
|
|
uint64 timestamp_sample # time since system start (microseconds) - actual measurement time
|
|
|
|
uint32 device_id # unique device ID for the sensor that does not change between power cycles
|
|
|
|
float32 heading # body-frame heading rel to NED from dual antenna array (rad, [-PI, PI])
|
|
float32 heading_accuracy # 1-sigma heading accuracy (rad)
|
|
float32 heading_offset # yaw of the configured antenna baseline in the body frame; heading + heading_offset is the measured baseline heading (rad, [-PI, PI])
|
|
float32 baseline_length # antenna baseline length reported by the receiver, NaN if it doesn't report one (m)
|
|
|
|
uint8 jamming_state # jamming_state of the receiver providing the heading, values as in SensorGnss (0: Unknown, 1: OK, 2: Mitigated, 3: Detected)
|
|
uint8 spoofing_state # spoofing_state of the receiver providing the heading, values as in SensorGnss (0: Unknown, 1: OK, 2: Mitigated, 3: Detected)
|
|
bool usable # heading may be used: its receiver reports no spoofing or jamming that the enabled checks reject
|