304 Commits

Author SHA1 Message Date
Daniel Agar
2b8fa62936 ekf2: conditional range aid change height ref 2025-09-25 18:36:13 -04:00
Hamish Willee
cbf39f5ceb
msg: AirspeedValidated - uorb topic to standard (#25579)
* AirspeedValidated - uorb topic to standard

* Apply suggestions from code review

* Update msg/versioned/AirspeedValidated.msg

* Fix up links to renamed uORB constants

---------

Co-authored-by: PX4BuildBot <bot@pixhawk.org>
2025-09-25 11:02:02 +02:00
Louis-max-H
e71faf38a0
Septentrio GNSS resilience reporting (#25012)
Co-authored-by: Tory9 <vvpost05@gmail.com>
2025-09-24 11:08:10 -04:00
bresch
82308da18d ekf2: support heading external update from MAV_CMD_EXTERNAL_ATTITUDE_ESTIMATE 2025-09-18 17:00:16 +02:00
bresch
361d66bb44 ekf2: add reporting of gnss_vel status flag 2025-09-18 17:00:16 +02:00
Jacob Dahl
078e4c911f
ekf: always publish baro and gnss bias even if zero (#25385)
* ekf: always publish baro and gnss bias even if zero

* [SQUASH] ekf2: simplify hgt bias publish

---------

Co-authored-by: Daniel Agar <daniel@agar.ca>
2025-08-08 11:18:50 -08:00
Ian Scholl
4812311c6c
ekf2: Add GPS fix type check bit (#25215) 2025-08-07 21:50:58 -04:00
Marco Hauswirth
c9206d6bd1
EKF2: gnss reset improvements (#25297)
* 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>
2025-07-30 11:39:56 +02:00
bresch
582b8f0a2b ekf2: allow manual position reset when horizontal aiding is active
This allows the pilot to override position esitmates manually
2025-07-29 14:29:19 +02:00
Jacob Dahl
9cd6840695
fix formatting (#25270) 2025-07-23 19:52:16 +12:00
Marco Hauswirth
6e9fb2ca3c
use imu-timestamp instead of hrt_abstime during replay for aid-srcs (#25117) 2025-07-22 22:35:45 -08:00
Jacob Dahl
6a8eea1df9
ekf: update parameter names for consistency (#25137) 2025-07-08 12:11:28 -06:00
Jacob Dahl
95119027a9
ekf2: variable to parameter name consistency (#25042)
Rename various EKF2 variable names to match the PX4 parameter names
2025-06-24 09:15:50 +02:00
bresch
e487d59521 Vehicle_odometry: protect angular_velocity field against aliasing
Accumulate delta-angles between each publication to get the correct
angular velocity between two attitudes
2025-06-04 09:01:33 +02:00
Marco Hauswirth
f0fdf0b53b EKF2: distinguish airspeed source and use synthetic for wind
Enable wind-dead-reckoning with airspeed source to synthetic airspeed
2025-05-02 13:37:18 +02:00
GuillaumeLaine
648e730c4a ev_odom: always convert reference frame enum 2025-04-04 09:12:53 +02:00
bresch
2aaa54037c ekf2: split gnss pos/vel flags
They can be selected independently in the control parameter, so there is
no reason why they should share the same flag.
2025-03-11 14:14:40 +01:00
Marco Hauswirth
4df65c133e
add cs_baro_fault to switch to fallback baro if available (#24260) 2025-01-28 10:37:16 +01:00
bresch
c76e74338b ekf-replay: fix airspeed replay
If available, the EKF uses airspeed_validated, not airspeed
2025-01-26 23:05:39 -05:00
Marco Hauswirth
4a5aa1e947
Fix max-hagl restriction to position/altitude control (#23667)
* 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
2025-01-20 15:50:21 +01:00
Nicolas MARTIN
4fe6d69966
local position acceleration: use mean value between two publications (#24105)
To avoid aliasing on the ned acceleration, add an accumulation of acceleration to improve the downsampling
2025-01-03 12:43:39 +01:00
bresch
b19a6ee3b5 ekf2: store position state as lat/lon/alt
The position error state is still defined in a body-fixed NED frame but the
position state itself is latitude-longitude-altitude.
2024-11-22 15:13:47 +01:00
Andrew Brahim
834af98992
uavcan: support GNSS heading from relposheading with offset configurable in estimator
* 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>
2024-11-08 21:52:55 -05:00
Marco Hauswirth
0c451552c7
EKF2: add validity flags to global pos message (#23787)
Co-authored-by: Mathieu Bresciani <brescianimathieu@gmail.com>
2024-10-23 10:19:04 +02:00
Daniel Agar
9238656a33 ekf2: configurable velocity state constraint (EKF2_VEL_LIM)
- 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
2024-10-07 10:35:48 +02:00
Marco Hauswirth
7d0e93b779
ekf2: always publish global position when origin has been set 2024-10-04 11:41:20 -04:00
bresch
dbf51da99e ekf2: rework amsl to ellipsoid altitude conversion 2024-10-01 10:40:18 -04:00
Marco Hauswirth
22c2878cf8 send acknowledgement after receiving vehicle wind cmd 2024-09-12 09:34:08 +02:00
Marco Hauswirth
7dcea6b2e4
EKF2: range measurement rejection in rain/fog (#23579) 2024-08-30 17:25:56 +02:00
Daniel Agar
5b0014cb06
ekf2: remove legacy accel z bias checks (#23341)
Co-authored-by: Mathieu Bresciani <brescianimathieu@gmail.com>
2024-08-29 11:51:27 -04:00
bresch
bab256bfe6 ekf2: handle external altitude resets 2024-08-28 11:02:26 +02:00
Daniel Agar
6c24413888 ekf2: filter flow vel (used for flow velocity reset)
- individual flow samples can be quite erratic
2024-08-27 10:38:17 -04:00
bresch
1a0f97ebbd ekf2-fake pos: add valid fake position fusion
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.
2024-08-23 11:17:21 +02:00
bresch
aad607e0dd ekf2: send airspeed data to ekf backend regardless of sign
On ground the airspeed can sometimes be slightly negative but the ekf
should still know that airspeed data is flowing regularly
2024-08-13 17:43:45 +02:00
bresch
0b1eba948a ekf2-flow: add param to force using internal gyro
In some cases the vibration environment of the optical flow sensor is
worse than near the autopilot.
2024-07-25 19:54:19 -04:00
Roman Bapst
1b9f1b78e5
Added support for resetting wind states to external observation (#23277)
* added support for resetting wind states to external observation

Signed-off-by: RomanBapst <bapstroman@gmail.com>

* moved wind related functions into separate file

Signed-off-by: RomanBapst <bapstroman@gmail.com>

* added VEHICLE_CMD_EXTERNAL_WIND_ESTIMATE

Signed-off-by: RomanBapst <bapstroman@gmail.com>

* correctly compute variances

Signed-off-by: RomanBapst <bapstroman@gmail.com>

* ekf2: implement wind reset

Signed-off-by: RomanBapst <bapstroman@gmail.com>

* only allow VEHICLE_CMD_EXTERNAL_WIND_ESTIMATE during wind dead-reckoning
and increase horizontal velocity variance to allow velocity states to move
towards solution that is aligned with the newly set wind

Signed-off-by: RomanBapst <bapstroman@gmail.com>

* only reset wind on ground

* still use wind reset using airspeed when it wasn't initialized

* exclude func for rover, change reset interface

* handle wind reset in drag-fusion

* replace state reset with variance reset in sideslip/drag fusion

* remove resetWind function

---------

Signed-off-by: RomanBapst <bapstroman@gmail.com>
Co-authored-by: Marco Hauswirth <marco.hauswirth@auterion.com>
2024-07-19 14:33:08 +02:00
Daniel Agar
ca9948a84d msgs/EstimatorStatus.msg rename mag_test_ratio -> hdg_test_ratio
- this is used for more than just mag
2024-07-18 16:39:18 +02:00
Daniel Agar
eac14b7db2 ekf2/commander: simplify navigation filter preflight checks
- remove commander test ratio "tuning knobs" (COM_ARM_EKF_{HGT,POS,VEL,YAW})
   - these are effectively redundant with the actual tuning (noise & gate)
     in the estimator, plus most users have no idea why they'd be
     adjusting these other than to silence an annoying preflight complaint
 - remove ekf2 "PreFlightChecker" with hard coded innovation limits
 - ekf2 preflight innovation flags are now simply if any active source
   exceeds half the limit preflight
2024-07-18 16:39:18 +02:00
Daniel Agar
48f1687d3a ekf2: cleanup legacy EKF solution_status_flags 2024-07-16 10:11:27 +02:00
Daniel Agar
1cd7d54170
ekf2: consolidate GNSS yaw in gnss_yaw_control.cpp and fix naming (GPS->GNSS)
Co-authored-by: Mathieu Bresciani <brescianimathieu@gmail.com>
2024-07-15 12:50:51 -04:00
Daniel Agar
e03aef616c
ekf2: add terrain/dist_bottom reset deltas (vehicle_local_position/vehicle_global_position) 2024-07-15 10:25:42 -04:00
Daniel Agar
75bb339d94 ekf2: remove warning events logging
- some of these warning flags aren't even being used, and most of the rest we can figure out from other sources
2024-07-10 10:43:55 -04:00
Marco Hauswirth
419652b9fe
EKF2: Spoofing GPS check (#23366)
* estimator gps check fail flag for spoofing

* warn whenever spoofing state changes to true, use default hysteresis to completely stop fusion

* dont introduce more GPS namings, GNSS instead

* flash: exclude mantis for cuav_x7pro
2024-07-09 16:31:11 +02:00
Daniel Agar
5d08b97fd7 ekf2: add vehicle_local_position dist_bottom_var 2024-07-09 10:10:01 -04:00
Daniel Agar
3e3b886b5d ekf2: add terrain estimator_status_flags 2024-07-09 10:10:01 -04:00
Daniel Agar
7047f9441c ekf2: fix calcOptFlowBodyRateComp() gyro bias
- adjust flow sample gyro_rate immediately after popping from ring
   buffer
 - always update flow gyro bias (calcOptFlowBodyRateComp()) regardless
   of flow quality or magnitude
2024-07-09 10:10:01 -04:00
Marco Hauswirth
4bc0286eb8
fix error from refactring commit, fix reset on ground (#23370) 2024-07-08 13:55:05 +02:00
Marco Hauswirth
e04c53241a
EKF2: reset position by fusion (#23279)
* reset position by fusion

* handle local_pos_valid for fixed wing in gnss denied

* [WIP] ekf2: setEkfGlobalOrigin respect current height reference and vertical position aiding

* global origin, also reset vertical pos without gps as ref

* fix wo gnss, that bitcraze ci passes

* revert some changes as requested

* remove duplicate reset messages

* undo unrelated whitespace changes, I'll fix it everywhere in a followup

* [SQUASH] ekf2: add vehicle_command_ack

* resetGlobalPosToExternalObservation consolidate logic

* remove gnss check from local_pos validation check

* reset when  0<accuracy<1, otherwise fuse

* replace gps param with flag

* ekf2: dead reckon time exceeded, respect ZUPT preflight if air data or optical flow expected

* subtract timeout from last inertial dead-reck, change fake pos conditions, save flash

---------

Co-authored-by: Daniel Agar <daniel@agar.ca>
2024-07-07 22:43:55 +02:00
Daniel Agar
30b854da35
ekf2: verbose logging control (new EKF2_LOG_VERBOSE)
- new parameter EKF2_LOG_VERBOSE to enable (currently enabled by default)
 - force advertise topics immediately (based on EKF2_LOG_VERBOSE and per aid source configuration)
 - logger optionally log all estimator topics at minimal rate
2024-06-27 01:10:57 -04:00
Silvan Fuhrer
1ae96d6509 EKF2: fix builds without CONFIG_EKF2_RANGE_FINDER
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2024-06-26 11:05:38 +02:00