Commit Graph

75 Commits

Author SHA1 Message Date
Andrew Tridgell e97f5d8012 AP_Math: mark test_math_double.cpp as double precision source
fixed test_math_double
the wrap check needs to be wrap_PI() as otherwise rounding of 2*PI if
just over 6.28 will give a large error
ensure double tests are double
test_vector2
2023-08-02 16:22:59 +01:00
Peter Barker c463b0d154 AP_Math: add alternate implementation of parity for AP_Periph
the __builtin_parity methods hardfault on AP_Periph builds
2023-06-07 21:41:14 +10:00
Pierre Kancir cdfbadbfb6 AP_Math: add test_rotations for custom rotations testing 2023-05-24 17:56:58 +10:00
Leonard Hall aeb25ca20a AP_Math: extend the control.cpp test suite 2022-12-30 20:25:58 +09:00
Andrew Tridgell f0d8a383d1 AP_Math: added a control.cpp test suite 2022-12-30 20:25:58 +09:00
Leonard Hall 1382923db0 AP_Math: Support changing update period 2022-12-13 17:10:06 +11:00
Iampete1 d62508b273 AP_Math: tests: params always use set method 2022-08-03 13:43:48 +01:00
Mark Whitehorn 6f789ead55 AP_Math: add unit test for rc_input_to_roll_pitch 2022-05-31 08:08:17 +09:00
Andrew Tridgell a95b429acc AP_Math: added unsigned versions of constrain functions
sometimes it really does matter that we use constrain_uint32() instead
of constrain_int32(). For example, if we have a value like 0xFFFFFFFF
then the result will be very different

we should use unsigned constrain when dealing with unsigned values
2022-04-05 17:46:52 +10:00
Peter Barker d9f819085c AP_Math: add specialisation for sq(float)
avoids conversion to double
2022-03-30 08:44:19 +11:00
xianglunkai abb0bf34d2 test_3d_lines:fix test result for test_3d_lines 2022-03-29 08:26:39 +09:00
Leonard Hall a8b86e9c45 AP_Math: Convert S-Curves to use maximum Snap to remove minimum time between waypoints 2022-03-05 11:34:40 +09:00
Iampete1 15326a8d90 AP_Math: tests: define hal where requirerd for custom rotaitons 2022-03-02 18:16:42 +11:00
Iampete1 7a6f57ccf1 AP_Math: add support for AP_CustomRotations 2022-03-02 18:16:42 +11:00
Joshua Henderson 4e3a66a4d3 AP_Math: quaternion add is_zero() & zero()
& length_squared() &  add unit tests
2022-01-19 18:03:17 +11:00
Josh Henderson 0125ae26ac AP_Math: enable SITL unit testing 2021-09-28 09:11:48 +10:00
Iampete1 22100dd37c AP_Math: move to 32 digit rotation constants 2021-07-28 18:09:05 +10:00
Iampete1 f8220a8adf AP_Math: tests: test quaternion rotation is the same as vector 2021-07-28 18:09:05 +10:00
Iampete1 6c5424aad6 AP_Math: add roll +- 45 rotations 2021-07-28 18:09:05 +10:00
Andrew Tridgell 75411afd21 AP_Math: added test for SCurve::calculate_path
this was the values shown in the core dump for failing guided mode
test in CI
2021-07-10 10:34:01 +09:00
Andrew Tridgell 168e860f70 AP_Math: fixed a few more single precision calls 2021-07-10 07:20:41 +10:00
Andrew Tridgell 31a6663797 AP_Math: fixed vel correction test build 2021-07-10 07:20:41 +10:00
Andrew Tridgell 0f2f0d4cb2 AP_Math: allow for double EKF build 2021-07-10 07:20:41 +10:00
Rishabh b9fbf1a661 AP_Math: Update segment_to_segment_dis test 2021-06-12 13:31:52 +09:00
Pierre Kancir 519b1a6913 AP_Math: correct and increase unit test coverage
AP_Math: correct some tests

AP_Math: more vector2 tests

AP_Math: make test_vector2 complete

AP_Math: add initial unittest for vector3
2021-06-09 18:06:18 +10:00
Peter Barker d77d258442 AP_Math: add tests for the sqrt_controller 2021-06-04 23:00:19 +10:00
hs293go 93a13bbf0e AP_Math: Implement tests for the Quaternion class
These tests cover Quaternion multiplication, conversion to rotation
matrix, and the optimized rotation operator
2021-04-19 15:34:45 +10:00
Rishabh f3d825bebe AP_Math: Add unit tests for 3-D lines 2021-02-01 14:34:13 +09:00
Peter Barker c81df7b5ad AP_Math: add tests for circle-segment-intersection 2021-01-04 13:58:42 +11:00
Andrew Tridgell b6a5509409 AP_Math: added test for vector2f rotate 2020-07-06 14:46:48 +10:00
Andrew Tridgell 3e853344f3 AP_Math: avoid build warnings 2020-05-10 15:11:22 +10:00
Peter Barker 84d999142f AP_Math: add more tests for wrap functions 2019-09-18 12:57:02 +10:00
Peter Barker da5d5c9203 AP_Math: add tests for Vector2 2019-06-13 19:36:49 +10:00
Peter Barker e4de5a17d1 AP_Math: add pitch-7 to rotation tests 2019-05-29 17:12:32 +10:00
Peter Barker 977fe09276 AP_Math: add a more complex polygon for Polygon_outside tests 2019-05-29 15:34:02 +10:00
Peter Barker d3971c18fa AP_Math: more tests for closed-vs-open polygons 2019-05-29 15:34:02 +10:00
Peter Barker d74e6db12e AP_Math: add more tests for Polygon_outside 2019-05-29 15:34:02 +10:00
Peter Barker 36fe9a18a0 AP_Math: make Polygon_outside cope with being passed unclosed polygons 2019-05-29 15:34:02 +10:00
Peter Barker 64aafb2af2 AP_Math: add Polygon_outside tests for long template instantiation 2019-05-28 09:08:07 +10:00
Peter Barker b35b65eed1 AP_Math: add GTEST suite for Polygon_outside 2019-05-28 09:08:07 +10:00
Andrew Tridgell 85ce10adfd AP_Math: fixed test build 2019-05-15 15:33:48 +10:00
Peter Barker dc14d7bce4 AP_Math: add another test for wrap_360_cd 2018-10-16 10:29:24 +11:00
Peter Barker 43f3d611b2 AP_Math: pragma away the float-equal test for the maths tests
There are legitimate reasons for doing direct equivalence in these files
2018-08-28 09:54:47 +10:00
Peter Barker 626467db14 AP_Math: add tests for line intersection 2018-08-14 19:41:45 +10:00
Peter Barker 6af0dcfed0 AP_Math: create a constrain_int64
The template system doesn't work across 32/64 bit builds (SITL
vs fmuv4), probably because int is typedef'd to int64
2018-06-15 08:01:22 +10:00
Jacob Walser e738f33770 AP_Math: Add ROTATION_PITCH_315 and ROTATION_ROLL_90_PITCH_315 2018-04-24 13:04:37 +01:00
Francisco Ferreira 1ffe12008c AP_Math: adapt test for new norm method API 2017-06-21 18:19:31 +09:00
Lucas De Marchi 2b9478f430 AP_Math: tests: make both arguments double
libraries/AP_Math/tests/test_math.cpp.3.o: In function `MathTest_IsEqual_Test::TestBody()':
test_math.cpp:(.text._ZN21MathTest_IsEqual_Test8TestBodyEv+0x1a0): undefined reference to `std::enable_if<std::is_floating_point<std::common_type<float, double>::type>::value, bool>::type is_equal<float, double>(float, double)'
collect2: error: ld returned 1 exit status
2017-02-06 09:27:22 -08:00
Lucas De Marchi 87c82ce0c6 AP_Math: add some more tests for constrain_value() 2017-01-27 12:15:20 -08:00
Lucas De Marchi 69a9cd3625 AP_Math: add tests to is_equal()
Contemplate the use of double values.
2017-01-27 12:15:19 -08:00