- updated table to 2 bytes (int16) per element and scaled the inclination/declination/strength tables to use most of the range without being too awkward
- tables have been extended to include the full latitude range
- expanded the API slightly to offer declination/inclination in both degrees/radians and the magnetic strength in Gauss and Tesla
- generated some simple testing that verifies interpolation between points
This workaround should fix the test failure where we disarm before
taking off because we accidentally switched to failsafe mode right
before taking off because we were still in Manual mode and not Hold yet.
When the antennas are not parallel to the x body axis, the GPS message
contains the angular offset but the data is already corrected in the
driver. EKF2 should then not add this offset during the initialisation.
Tests for both of these models did not pass for me locally. Therefore,
I'm removing them for now. It's up to the stakeholders of these models
to add them again.
This fixes the cases where the yaw message from the GNSS receiver would
take more time than the vel/pos. The estimator should wait and not
immediately fall back to an other aiding source after 5sec.
If it never comes, it will never fall back, but this is ok since the
user wants to fly with GPS aiding an not with something else.
If the user selects GPS yaw fusion but that there is no GPS yaw data in
the GPS message or if the fusion is rejected for some time, the GPS yaw
data is declared faulty and the fusion is stopped to allow an other
source of yaw aiding to start.
This is how it is also done in ekf2_main. Otherwise, this leads to
multiple integration of the same IMU data due to asynchronous sensor
updates triggering a prediction step between IMU updates.
Fix unit tests that broke because of this fix
Somehow only subprocess.stdout.readline() works at a time. In order not
to miss out on some of the stdout output, we need to collect it all at
the end. Also, we can stop using readline() for processes that have quit
already.
The `_deadreckon_time_exceeded` flag is used in
`local_position_is_valid()`. This means that
`_params.valid_timeout_max` after startup, in my observed case 5
seconds, the local position switche from valid to invalid and then after
a while back to valid again.
With this fix, the local position is flagged invalid from boot and gets validated after the first aiding event.
Co-authored-by: Julian Oes <julian@oes.ch>
* ekf: disable xy accel bias learning before takeoff
As those biases are usually poorly observable before takeoff because
they are almost perpendicular to the gravity vector, learning is often
driven by noise and numerical issues. This results in incorrect bias
learning before takeoff when the drone is static on ground for a long
period of time.
* ekf: update unit test and change indicator
This is a non-functional change required to select accel bias estimation
per axis selection. The intent is then to disable the learning before
takeoff of the components that are poorly observable.
* Support vision velocity expressed in body frame
* Use switch statement for vision velocity frame
* Robustify vision velocity frame test
* Increase lower bound on vision velocity noise to 0.05 m/s