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
3 years ago
Peter Barker
d9f819085c
AP_Math: add specialisation for sq(float)
...
avoids conversion to double
3 years ago
Andy Piper
87a369727a
AP_Math: specialize float and double functions to use fabsf() and simple comparison otherwise
3 years ago
Andrew Tridgell
319592a148
AP_Math: added degF_to_Kelvin()
3 years ago
Peter Barker
2205b95c99
AP_Math: create double versions of is_zero, is_positive and is_negative
...
Seeks to prevent
Thread 1 "ardurover" received signal SIGFPE, Arithmetic exception.
is_positive<double> (fVal1=9.6315720352771873e+44)
at ../../libraries/AP_Math/AP_Math.h:66
66 return (static_cast<float>(fVal1) >= FLT_EPSILON);
3 years ago
Buzz
adaccdf0ba
AP_Math: esp32 with esp_idf have MIN and MAX defined to something else.
...
Author: Charles Villard <charlesvillard10@gmail.com>
Author: Buzz <davidbuzz@gmail.com>
3 years ago
Andrew Tridgell
c5ef672fb5
AP_Math: fixed expo_curve()
...
doesn't make sense as constexpr
4 years ago
Andrew Tridgell
d91397f2f2
AP_Math: change wrap_PI to ftype
...
prevent loss of precision
4 years ago
Andrew Tridgell
afb928081a
AP_Math: use ftype for a few internal trig fns
4 years ago
Andrew Tridgell
0f2f0d4cb2
AP_Math: allow for double EKF build
4 years ago
Andrew Tridgell
154ae64e63
AP_Math: support either polarity in linear_interpolate()
4 years ago
Tom Pittenger
ba6bb21560
AP_Math: added helper for16bit float conversions
4 years ago
Andrew Tridgell
e884e4c5ac
AP_Math: added fixedwing_turn_rate() helper
4 years ago
Andrew Tridgell
999268cbba
AP_Math: fixup matrix algorithms to be in cpp file
...
this fixes an issue where optimize O2 was forced on any file that
included AP_Math.h. It also fixes the test suite for matrix_alg, and
fixes the type handling to be consistent
4 years ago
bugobliterator
3b3e2c01f8
AP_Math: templatize matrix_alg methods
4 years ago
Andrew Tridgell
720f9a1de0
AP_Math: cleanup maths functions
...
use class template instantiation, and cleanup const in matrix code
4 years ago
Leonard Hall
1e38440c83
AP_Math: add control common functions
4 years ago
Andrew Tridgell
d9dbcb17c4
AP_Math: enable constrain value with line numbers on all boards
4 years ago
Andrew Tridgell
cdcf32d22c
AP_Math: added calc_lowpass_alpha_dt()
...
used in several places
4 years ago
Michael du Breuil
051640e2b2
AP_Math: Log line numbers on constrain_nan's for constrain float
4 years ago
Tom Pittenger
787d7f5254
Revert "AP_Math: add function to convert any base to any base"
...
This reverts commit 935cb39dff
.
4 years ago
Tom Pittenger
935cb39dff
AP_Math: add function to convert any base to any base
...
Example: convert dec 12345 to 0x12345 or dec 1200 to octal 1200
4 years ago
Randy Mackay
bdb67532b0
AP_Math: clarify get_vel_correction_for_sensor_offset comment
5 years ago
Randy Mackay
4639e8a698
AP_Math: add get_vel_correction_for_sensor_offset
5 years ago
Patrick José Pereira
1635054c4f
AP_Math: Add missing constexpr
...
Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
5 years ago
Andrew Tridgell
66b4e92444
AP_Math: make fill_nanf() use a signalling NaN
...
we want use of these values to trigger a FPE
5 years ago
Peter Barker
6fe09b6120
AP_Math: move is_valid_octal into adsb
...
This doesn't ensure the value is octal digits - there's more magic in
it.
5 years ago
Peter Barker
975804fa35
AP_Math: remove unit_mod concept from wrap functions
...
devcall decided it would be clearer to have non-shared implementation
for the _cd variants
5 years ago
Andrew Tridgell
9b746b89db
AP_Math: added fill_nanf()
...
used in SITL to invalidate memory
5 years ago
Peter Barker
5692f3d79e
AP_Math: stop returning float for integer wrap_180/wrap_360 etc
5 years ago
Peter Barker
4c434c2df9
AP_Math: add WARN_IF_UNUSED to bool methods
6 years ago
murata
c6bcb1d54c
AP_Math: Collect CRC16 into CRC file
...
AP_Math: Collect CRC16 into CRC file
6 years ago
Mark Whitehorn
b515431008
AP_Math: add expo and throttle_curve functions
6 years ago
Pierre Kancir
f6941beeb9
AP_Math: fix circulary inclusion error
6 years ago
Andrew Tridgell
ecbe67a0fe
AP_Math: fixed inefficient sq() function
6 years ago
Andrew Tridgell
d4eaf09baf
AP_Math: added rotation_equal()
6 years ago
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
7 years ago
Tom Pittenger
3653ba61d7
AP_Math: add is_valid_octal helper function.
...
returns true if valid
7 years ago
bnsgeyer
600e0dac92
AP_Math: added support for cubic spline interpolation
7 years ago
Peter Barker
1ca76173a5
AP_Math: set radians(...) and degrees(...) as constexpr
7 years ago
Miguel Arroyo
7cea21afa2
AP_Math: Moves rand_vec3f from SITL_State.
8 years ago
Francisco Ferreira
da5060964b
AP_Math: uniformize template type parameter keyword
...
Use typename everywhere instead of class
8 years ago
Francisco Ferreira
7b98f41947
AP_Math: correct norm to need two arguments
...
Correctly use sqrtf instead of the double version
Stop casting to float since sq already returns one
8 years ago
Michael du Breuil
2cd6ff6dd5
AP_Math: Accept float epsilon in is_positive is_negative as a valid result
8 years ago
Michael du Breuil
5a15413513
AP_Math: Add is_negative and is_positive helpers
8 years ago
Andrew Tridgell
607220d12b
AP_Math: rename macros to avoid conflicts
...
these macros were also defined in NuttX in clock.h
8 years ago
Andrew Tridgell
2fcecaa7c5
AP_Math: added rand_float()
8 years ago
Pierre Kancir
da49149d19
AP_Math: is_equal correct comparison for integer as epsilon doesn't exist.
...
Credit to Kwikius for the right solution
8 years ago
Pierre Kancir
ce734b5f7b
AP_Math: Remove unecessary check
8 years ago
Andrew Tridgell
a8d10e8c2c
AP_Math: added get_random16()
8 years ago