Commit Graph

168 Commits

Author SHA1 Message Date
Niels Joubert 398f32d538 AP_Math: Comments on WGS coordinate conversions 2014-06-30 10:29:56 +10:00
David Dewey 17374ff5e8 AP_Math: fast_atan2
This is 126us per call vs 199us on the AVR.  it is accurate to about
0.28 degrees

Committed by rmackay9 but contribution is from David Dewey
2014-06-06 18:50:41 +09:00
Andrew Tridgell 7e5a491f14 AP_Math: prevent a floating point exception 2014-04-21 15:37:08 +10:00
Andrew Tridgell e566802bf3 AP_Math: fixed example build 2014-04-07 07:37:34 +10:00
Niels Joubert 879eb5936b AP_MATH: Adding WGS GPS conversions, CRC16 checks, and double-precision Vectors and Matrices 2014-04-05 13:42:23 +11:00
Andrew Tridgell 9278685cdf AP_Math: fixed location build on SITL 2014-04-01 14:20:10 +11:00
Andrew Tridgell acd54d0826 AP_Math: fixed example build 2014-03-19 12:13:48 +09:00
Andrew Tridgell 009913ec60 AP_Math: make is_nan const for quaternion and add .zero() for vector2 2014-02-21 20:24:47 +11:00
Andrew Tridgell 599c3a8abf AP_Math: added more operators to VectorN 2014-02-19 10:14:58 +11:00
Andrew Tridgell 2df314799e AP_Math: added tests for quaternion to/from rotation matrix 2014-02-15 12:20:51 +11:00
Andrew Tridgell 689f230d40 AP_Math: added quaternion.from_rotation_matrix() 2014-02-15 12:20:31 +11:00
Andrew Tridgell c1dff6aa65 AP_Math: fixed example build 2014-02-15 06:39:43 +11:00
Andrew Tridgell 1e0f3f5398 AP_Math: make to_euler() const 2014-02-15 05:27:51 +11:00
Andrew Tridgell 90c41981ac AP_Math: added quaternion normalization 2014-02-15 05:27:51 +11:00
Randy Mackay 37cfbc9ad5 AP_Math: float versions of wrap_360 and wrap_180 2014-02-15 05:27:45 +11:00
Randy Mackay a963ec7e3b AP_Math: bug fix to wrap_360 and wrap_180
angles above 720deg and below 3200deg might not have been properly
wrapped.
wrap_360_cd could return 36000 when really this should be wrapped back
to zero.
2014-02-03 12:56:56 +09:00
Andrew Tridgell 93070a673e AP_Math: fixed example build 2014-01-30 13:33:46 +11:00
Andrew Tridgell 0d174db05b AP_Math: added equality operator for VectorN 2014-01-24 10:37:08 +11:00
Paul Riseborough f2c2811ef3 AP_AHRS & AP_Math: fixed bug in use of AHRS_TRIM parameters 2014-01-19 07:19:43 +11:00
Andrew Tridgell 4c99d09265 AP_Math: fixed build of vectorN class on PX4 2013-12-31 10:28:27 +11:00
Andrew Tridgell 96df09fd08 AP_Math: add const to quaternion API 2013-12-30 14:33:17 +11:00
Andrew Tridgell 2e9744d0b3 AP_Math: prevent transpose usage error in matrix API 2013-12-30 14:33:17 +11:00
Andrew Tridgell 2c1e0ba130 AP_Math: added vectorN class, and index checking 2013-12-30 14:33:17 +11:00
Andrew Tridgell 828eed1984 AP_Math: allow vector3 and matrix3 objects to be used as arrays 2013-12-29 18:39:09 +11:00
Andrew Tridgell 9b5b4ced60 AP_Math: fixed example build 2013-12-17 11:51:37 +11:00
Andrew Tridgell 57d5345774 AP_Math: added M_PI_F define 2013-12-11 10:22:47 +11:00
Andrew Tridgell db400ffa51 AP_Math: added is_zero() method to Vector3 2013-12-09 17:34:06 +11:00
Andrew Tridgell d2deee07df AP_Math: fixed zero function for integer vectors 2013-11-07 12:48:16 +11:00
Andrew Tridgell fb19dbb404 AP_Math: cope with large values passed into the wrap functions
this uses modulus if the function would loop too many times

Pair-Programmed-With: Randy Mackay <rmackay9@yahoo.com>
2013-10-03 12:21:07 +10:00
Andrew Tridgell 18896d9c9b AP_Math: fixed DOS CR/LF errors 2013-09-19 16:26:32 +10:00
Andrew Tridgell 84ed2141a0 AP_Math: fixed float rounding in location_offset()
this prevents rounding of positions in the rover code
2013-09-16 11:38:55 +10:00
Andrew Tridgell 97b7130bb9 libraries: update license header to GPLv3
we switched to GPLv3 a long time ago, but neglected to update the
per-file license headers
2013-08-30 13:01:39 +10:00
Andrew Tridgell 873e54deb1 AP_Math: fixed example build 2013-08-30 13:01:39 +10:00
Andrew Tridgell 4c752e4a94 AP_Math: simplify rotations test code 2013-08-30 13:01:34 +10:00
Andrew Tridgell e2b0e07973 AP_Math: removed unused matrix rotation code
we only need to rotate vectors
2013-08-30 13:01:34 +10:00
Andrew Tridgell a295a01bbc AP_Math: added missing 90 degree rotations
this ensures we can handle all 90 degree rotations of the compass and
main board. A test in examples/rotations shows that we have them all.
2013-08-30 13:01:33 +10:00
Andrew Tridgell 2b1fcc964f AP_Math: added a quick test of floating point location accuracy
just confirming some maths ...
2013-08-30 13:01:32 +10:00
Andrew Tridgell 5434b2c017 AP_Math: update location code to avoid float rounding
this avoids manipulating global coordinates as float variables. Using
a float reduces our precision from 1cm to about 70cm.

This also adds location_diff() which will be used in the L1 controller
to avoid global positions in floats
2013-08-13 12:07:34 +10:00
Andrew Tridgell 9cb6c987d4 AP_Math: fixed example build 2013-08-05 12:37:51 +10:00
Andrew Tridgell 1d75b52411 AP_Math: use const references not pointers for location functions
this makes life a bit easier for the new AP_Mission library

Pair-Programmed-With: Brandon Jones <brnjones@gmail.com>
2013-08-05 10:23:40 +10:00
Andrew Tridgell 468e55d425 AP_Math: added two new vector/matrix ops for kalman airspeed filter 2013-07-22 12:50:00 +10:00
Randy Mackay 540ca25b84 AP_Math: add rotateXY 2013-07-20 17:59:06 +09:00
Randy Mackay bd6a60f28b AP_Math: add M_PI_2 definition
Required when building under arduino
2013-07-14 15:57:26 +09:00
Andrew Tridgell 8c49ed78a5 AP_Math: make the rotation numbers easier to find 2013-07-08 12:17:59 +10:00
Randy Mackay 8b87849acd Math: add wrap_PI 2013-06-01 18:21:29 +09:00
Randy Mackay d81b7b507d Math: add Leonard's fast tan function 2013-05-30 18:24:32 +09:00
Andrew Tridgell 5024da2695 AP_Math: fixed indent-tabs-mode 2013-05-30 09:51:51 +10:00
Randy Mackay 7c9d9b9800 AP_Math: use DEG_TO_RAD in longitude_scale
Also increased accuracy of RadiansToCentiDegrees although it is like the
compiler will throw away the extra digits anyway.
2013-05-05 14:31:24 +09:00
Andrew Tridgell 737f0305ef AP_Math: implement vector2 cross product
useful in DCM for faster yaw correction
2013-05-05 13:47:51 +10:00
Andrew Tridgell f4189e083b AP_Math: added mulXY() for matrix3 and vector3
returns the XY components of the product
2013-05-05 13:47:23 +10:00