Commit Graph
88 Commits
Author SHA1 Message Date
Peter Barker 3708936c62 global: correct shebang lines to refernce python3
also remove the odd encoding line which is not required in Py3
2025-07-22 10:45:57 +10:00
Leonard Hall 816fb9c2e3 AP_Math: Convert copter to radians 2025-07-01 09:06:25 +09:00
Peter BarkerandLeonard Hall bc7fe903b1 AP_Math: correct range of Vector2.angle() method
Prior to this commit, the range of the function was -M_PI/2 to M_PI*3/2 (-90 to 270 degrees).

This adjust the function range to be -M_PI to M_PI (-180 to 180 degrees)

This makes the function consistent with methods such as "get_bearing_cd"

Co-authored-by: Leonard Hall <leonardthall@gmail.com>
2025-06-25 17:27:26 +10:00
Christian Clauss dc9446af62 wscript: Add # flake8: noqa linter directive 2025-06-20 20:30:15 +10:00
muramura 4dd2fb2cb0 AP_Math: Clarify the floating-point value 2025-05-05 21:49:43 +10:00
Andy Piper 14bc825f74 AP_Math: remove new distance to point code 2025-04-09 17:01:04 +01:00
Andy Piper abaa64a754 AP_Math: correct Polygon_closest_distance_point() for use with lat/lng at small distances
add polygon proximity tests
2025-04-09 17:01:04 +01:00
Peter Barker 0ae3e7cdcb AP_Math: allow initial value to be specified for crc8_generic
some crc8's start with a non-zero value
2025-03-05 18:17:28 +11:00
Peter Barker f236a6c6fc AP_Math: tests: we no longer expect an exception when limiting corner case 2025-01-07 16:08:03 +11:00
Peter Barker a968ce8d33 AP_Math: add test for FPE in control code 2025-01-07 16:08:03 +11:00
Peter Barker 3c0c2bfa67 AP_Math: add a test for rand_float 2024-08-27 11:09:13 +10:00
Andrew Tridgell 98733882f5 AP_Math: added comments and a test for euler ordering
our main euler functions did not have a comment on the ordering
convention
2024-07-27 11:14:10 +10:00
Andrew Tridgell 49c3536ca7 AP_Math: added uint64_div1000()
and test suite
2023-12-21 09:09:11 +11:00
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