IMU - increase gain on large Course over ground error (#12792)
commit5eaab0226d3dd82a0c72508c34a89e06df7ef990
authorPetr Ledvina <ledvinap@gmail.com>
Sun, 18 Jun 2023 23:30:45 +0000 (19 01:30 +0200)
committerGitHub <noreply@github.com>
Sun, 18 Jun 2023 23:30:45 +0000 (19 09:30 +1000)
tree63c0f22d2067bf086a2e94b4b63ae74b5824f70b
parenta98364fa558460a6948db9c7248177071915448e
IMU - increase gain on large Course over ground error (#12792)

* IMU - increase gain on large Course over ground error
* Fix Cog calculation in IMU

Old code did align CoG antiparallel to Yaw. Cross product stays the
same, but dot product is inverted.

@iNav - this is probably reason for magic numbers in iNav IMU
rewrite (especially wind compensation)

* Update gtest

Copy of debian/stable libgtest-dev

* Add unittest for IMU CoG

Work in progress

* IMU - convert compass to new alignment calculation

* IMU Unittests

- new wrapped EXPECT_NEAR_DEG / EXPECT_NEAR_RAD
- magnetometer testing

* IMU - CoG evaluation based on thrust vector

---------

Co-authored-by: Petr Ledvina <ledvinap@hp124.ekotip.cz>
src/main/common/maths.h
src/main/common/vector.h [new file with mode: 0644]
src/main/flight/imu.c
src/test/unit/flight_imu_unittest.cc