ardupilot
ardupilot copied to clipboard
EKF: cope better with GPS jamming
This is a revival of https://github.com/ArduPilot/ardupilot/pull/23010 re-opened so I can push to it to get it to pass CI
rebaed
I think we should try and get this in the near-ish future. Certainly in enough time that it gets some testing before 4.5.0 beta testing.
@priseborough this is failing the dead-reckoning CI test. The EK3 position is resetting on loss of GPS for some reason. I've put a replay log here: http://uav.tridgell.net/tmp/ArduPlane-DeadreckoningNoAirSpeed-00000003.BIN
@priseborough this is failing the dead-reckoning CI test. The EK3 position is resetting on loss of GPS for some reason. I've put a replay log here: http://uav.tridgell.net/tmp/ArduPlane-DeadreckoningNoAirSpeed-00000003.BIN
The underlying issue is that the EKF in the no airspeed sensor case is not fusing in a synthetic airspeed to constrain along track drift and is falling out of dead reckoning within a few seconds of GPS being lost. Setting FLIGHT_OPTIONS bit 7 will cause the EKF to use a default airspeed halfway between ARSPD_FBW_MAX and ARSPD_FBW_MIN which for SITL is between 30 and 10. I will see if I can adjust the SITL parameters so that the vehicle cruises at 20 m/s with no airspeed sensor and set that bit in FLIGHT_OPTIONS and get the dead reckoning working for the no airspeed sensor case.
Edit: There is a bug in the logic that decides when to use a default or synthesised airspeed value that prevents either being used if there is an airspeed sensor fitted but its use is disabled.
There are multiple contributing issues:
- A bug that prevented synthetic or default airspeed being used for dead reckoning if airspeed data was being received but had been disabled by parameter.
- Synthetic airspeed and sideslip was not constraining velocity drift sufficiently. For the no airspeed sensor use case using wind states learned prior to loss of GPs as a truth 'truth' reference has fixes this.
- Learning wind takes longer if there is no airspeed sensor and the autotest was not allowing sufficient time.
- The GPS jamming was not causing the EKF to stop using the GPS completely, instead because the duration of loss of lock and large errors was relatively short the EKF was instead using the innovation consistency checks to protect against bad estimates. This is actually working, bit not what the autotest was looking for which was a delayed resumption of GPs use while quality checks waited to pass.
There were other issues found:
- Planes might never register the in flight yaw alignment complete if the yaw misalignment was small
- When resuming GPS use wind state learning should be faster
I am currently testing fixes for these and will submit a PR against the branch.
rebased
rebased and cleaned up AP_AHRS options handling code
@priseborough the Deadreckoning test is failing in an interesting way:
rebased on #25676
No pressure but I wonder if we should try and include this in 4.5.0.
I'll pick this up again this week
@tridge, that glitch in height is due to the autotester disarming the plane after the resumption of jamming minimum time test fails. I have determined from dataflash logs that the code is resuming fusion after the gpsGoodToAlign flag goes high, eg:
I've amended the time threshold which allows the dead reckoning test to pass - https://github.com/priseborough/ardupilot/commit/ae2e1bff9ae9fdf2847e41750a02380df9ac2037
@priseborough @tridge, great to see progress on this.
Sorry to be nitpicky but could someone pull in the last commit from this library to fixup the new OPTIONS parameter description? https://github.com/rmackay9/rmackay9-ardupilot/commits/tridge-pr-ekf-gps-check-fix/
I've amended the time threshold which allows the dead reckoning test to pass - priseborough@ae2e1bf
thanks Paul! I've added that commit to this branch and rebased on master
Could we pull in this change to the new EK3_OPTIONS parameter descriptions? I'm sorry to be so persistent. https://github.com/rmackay9/rmackay9-ardupilot/commits/tridge-pr-ekf-gps-check-fix/
applied, sorry for being slow on this!
yeah!! great to see this go in!