* sensors: add per-receiver GPS delay parameters
Add SENS_GPS{0,1}_DELAY params to vehicle_gps_position, following the
same device-ID matching pattern used for antenna offsets. Each receiver
can now have its own measurement delay relative to the IMU.
The delay is applied to timestamp_sample before blending. When PPS time
correction is active it takes priority over the parameter-based delay.
When a GPS driver already provides its own timestamp_sample the
per-receiver delay is not applied on top of it.
* fix(ekf2): remove EKF2_GPS_DELAY and perform param transation
* fix(param_translation): fix GPS param migration return values
Add missing return for EKF2_GPS_POS_Z and remove incorrect return for
EKF2_GPS_DELAY (1-to-many migration should not return PARAM_MODIFIED).
* fix(sensors,ekf2): rename pps_compensation and clarify delay default
* fix(ekf2): account for SENS_GPS*_DELAY in observation buffer sizing
* fix(docs): migrate EKF2_GPS_DELAY param
* sensors: move GPS antenna offsets to per-receiver parameters
Move antenna position configuration from the single EKF2_GPS_POS_X/Y/Z
parameter set into per-receiver SENS_GPS{0,1}_OFF{X,Y,Z} parameters in
the sensors module. Each offset slot is matched to a physical receiver
by device ID (SENS_GPS{0,1}_ID), falling back to uORB instance index
when no IDs are configured.
The antenna offset is now carried through the SensorGps uORB message
and blended alongside other GPS states when multi-receiver blending is
active, so EKF2 receives the correct lever arm for whichever receiver
(or weighted combination) is selected.
- Add antenna_offset_{x,y,z} fields to SensorGps.msg
- Remove EKF2_GPS_POS_X/Y/Z params; EKF2 reads offset from gnssSample
- Add SENS_GPS{0,1}_ID and SENS_GPS{0,1}_OFF{X,Y,Z} params (module.yaml)
- Blend antenna offsets in GpsBlending (weighted average)
- Add unit tests for single, blended, and failover antenna offset cases
- Migrate params.c to module.yaml for the vehicle_gps_position module
* sensors: gps_blending: add asymmetric weight and fallthrough offset tests
Add two additional antenna offset test cases:
- dualReceiverAsymmetricWeightAntennaOffset: verify that unequal eph
values produce correctly skewed blend weights (0.8/0.2) and that the
output antenna offset reflects the weighted average
- blendingFallthroughAntennaOffset: verify that when blending is enabled
but can_do_blending evaluates false (eph=0), the non-blending path
correctly assigns the selected receiver's antenna offset
* feat(param_translation): translate EKF2_GPS_POS_ to SENS_GPS0_OFF_
* fix(msgs): proper formatting
* chore(msg): 0 if invalid/unknown
* fix(ROMFS): migrate EKF2_GPS_POS_ params
* fix(docs): migrate EKF2_GPS_POS_ params
* fix(blending): unsigned param
* Update msg/SensorGps.msg
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* fix(sensors/gps): remove 'values:' tag in module.yaml
* fix(sensors/gps): unsigned instance index
* fix(blending): restore const on gps_blend_states()
Move antenna offset blending into blend_gps_data() where the
weights are computed, keeping gps_blend_states() const.
* fix(sensors/gps): fix msg annotation and restore SENS_GPS_PRIME values
Remove incorrect @invalid NaN annotation from antenna offset fields
(0.0 default is correct, not a sentinel). Restore values tag for
SENS_GPS_PRIME so QGC shows a dropdown.
* fix(gps_blending): fix pre-existing bug to clear _gps_updated flags
The loop iterates over i but always clears gps_select_index. The intent is to clear
all updated flags, but only the selected one gets cleared (N times)
* test(gps_blending): add stale update flag regression test
Remove using-declarations for math::constrain, math::max, and
math::min that are never used — all call sites use the fully-qualified
form (e.g. math::constrain()).
Fixes misc-unused-using-decls clang-tidy diagnostic.
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
In cold weather, fuel engines need to be warmed up. Currently, this is done by switching to stabilized mode and throttle up. The issue is that when not using GNSS data, the vehicle is not detected as "at rest" due to vibrations and cannot switch into auto/takeoff modes.
If EKF2_ENGINE_WRM is enabled, and if the vehicle is armed and landed, constant position fusion is enabled.
This allows airspeed and sideslip fusion to start during VTOL front
transition, but not in backtransition or MC. This mitigates issues seen
due to going in and out of airspeed fusion in strong headwinds in MC.
Co-authored-by: bresch <brescianimathieu@gmail.com>
* ekf: always publish baro and gnss bias even if zero
* [SQUASH] ekf2: simplify hgt bias publish
---------
Co-authored-by: Daniel Agar <daniel@agar.ca>
* ekf2: allow manual position reset when horizontal aiding is active
This allows the pilot to override position esitmates manually
* mavlink sim: add support of failure gps struck
* mavlink sim: add GNSS failure "wrong" type
* ekf2-gnss: add reset mode
This allows the user to choose whether the position should immediately
be reset to GNSS on fusion timeout or if the EKF can continue with
velocity dead-reckoning.
* ekf2: fix unit test changes due to GNSS start logic
Especially because the EKF doesn't need to reset the states if the test
ratio is already passing
* rename mode enum
* reset to gps lat lon on init
* remove obsolete reset-condition (handled in #25223)
* WIP try to upgrade compiler externally
---------
Co-authored-by: bresch <brescianimathieu@gmail.com>
Co-authored-by: Niklas Hauser <niklas@auterion.com>
* fix max-hagl restriction to position/altitude control
* max hagl vel restriction in ManAcc position mode
* use interpolate func, change naming
* simplyfied vertical vel limitation
* move velocity-constraint adjustment to StickAccelXY
* uavcan: add GNSS heading from relposheading
* ekf2: new EKF2_GPS_YAW_OFF parameter to configure any offset in GNSS heading
Signed-off-by: dirksavage88 <dirksavage88@gmail.com>
Co-authored-by: Jacob Dahl <dahl.jakejacob@gmail.com>
- replace hardcoded 1000 m/s velocity state constraint with new EKF2_VEL_LIM parameter (default 100 m/s)
- new velocity limit also used for GPS checks and external vision velocity
This is similar to fake pos but is only used when the ekf has an
external information telling it that the vehicle is not changing
position. This information can then be used to keep a valid local
position even when the vehicle isn't exactly at rest.