Commit Graph

88 Commits

Author SHA1 Message Date
uncrustify 652b490345 uncrustify libraries/AP_Math/vector2.h 2012-08-21 19:03:34 -07:00
uncrustify 97994a4e3a uncrustify libraries/AP_Math/AP_Math.h 2012-08-21 19:03:34 -07:00
uncrustify 7e19ae5868 uncrustify libraries/AP_Math/matrix3.h 2012-08-21 19:03:34 -07:00
uncrustify 9bb0b42f28 uncrustify libraries/AP_Math/rotations.h 2012-08-21 19:03:34 -07:00
uncrustify 57d4db2be4 uncrustify libraries/AP_Math/vector3.h 2012-08-21 19:03:34 -07:00
uncrustify d50c606c97 uncrustify libraries/AP_Math/quaternion.h 2012-08-21 19:03:34 -07:00
uncrustify 9ccb38260d uncrustify libraries/AP_Math/polygon.h 2012-08-21 19:03:34 -07:00
uncrustify 533860dd73 uncrustify libraries/AP_Math/AP_Math.cpp 2012-08-21 19:03:34 -07:00
uncrustify b5bee9deff uncrustify libraries/AP_Math/polygon.cpp 2012-08-21 19:03:34 -07:00
uncrustify a208fbb2d9 uncrustify libraries/AP_Math/vector3.cpp 2012-08-21 19:03:34 -07:00
uncrustify 424baf3f29 uncrustify libraries/AP_Math/quaternion.cpp 2012-08-21 19:03:33 -07:00
uncrustify d6e803fd3c uncrustify libraries/AP_Math/matrix3.cpp 2012-08-21 19:03:33 -07:00
uncrustify 64eaadb332 uncrustify libraries/AP_Math/location.cpp 2012-08-21 19:03:33 -07:00
uncrustify d0d401581f uncrustify libraries/AP_Math/examples/location/location.pde 2012-08-21 19:03:33 -07:00
uncrustify 52dbb56bf0 uncrustify libraries/AP_Math/examples/rotations/rotations.pde 2012-08-21 19:03:33 -07:00
uncrustify 87c263fbb9 uncrustify libraries/AP_Math/examples/polygon/polygon.pde 2012-08-21 19:03:33 -07:00
uncrustify 86627c9a9d uncrustify libraries/AP_Math/examples/eulers/eulers.pde 2012-08-21 19:03:33 -07:00
Andrew Tridgell 6300fa7399 math: more abs() fixes
abs() is 16 bit
2012-08-16 15:17:42 +10:00
Jason Short a66e43aff1 Location Lib : Abs was overflowing causing bad comparison 2012-08-15 22:01:51 -07:00
Jason Short ff38dadd00 Location Lib. Potential fix for bad angle and distance calcs.
last_lat changed to int32_t since it can be negative.
2012-08-15 21:36:55 -07:00
Andrew Tridgell 0ba57d05eb AP_Math: added matrix column extraction functions 2012-08-11 22:06:02 +10:00
Andrew Tridgell 87fca1985f AP_Math: added location_update() and location_offset() functions
these will be used by AHRS dead reckoning
2012-08-11 11:56:54 +10:00
Andrew Tridgell 2a7b298bbc MAVLink: moved mavlink variables back to library
these were moved to the main sketches to allow for compile time
selection of MAVLink 0.9 vs 1.0. We no longer support 0.9, so we can
move it back, which simplifies some test sketches
2012-08-09 12:06:21 +10:00
Andrew Tridgell 8ae35cae1c AP_Math: rename get_bearing() to get_bearing_cd() to make units obvious 2012-08-08 12:12:30 +10:00
Andrew Tridgell a72f6acef6 AP_Math: added get_distance_cm() to return in centimeters 2012-07-11 07:49:05 +10:00
Andrew Tridgell 1cd8c54f21 AP_Math: cope with co-located waypoints in location_passed_point() 2012-07-04 14:24:04 +10:00
Andrew Tridgell 468dfe3faa AP_Math: the windows arduino build is missing acosf() 2012-07-04 14:14:58 +10:00
Andrew Tridgell 0bdce404a5 AP_Math: add include of math.h
this is needed for location.cpp
2012-07-04 13:59:23 +10:00
Andrew Tridgell dd200cba31 Math: added location functions to math library
these do common calculations on struct Location
2012-07-04 12:42:46 +10:00
Andrew Tridgell fe865bc1dc Math: added comment 2012-06-27 16:01:49 +10:00
Andrew Tridgell c30b0d85a3 Math: moved more template functions to the .cpp files
save a bit more code space for larger functions
2012-06-27 16:01:49 +10:00
Andrew Tridgell 22ff8cb197 examples: fixed build of some examples with new AP_Declination code 2012-03-30 14:25:27 +11:00
Andrew Tridgell a6d66dc45b Math: added mul_transpose() operation
this is equivalent to multiplying by m.transposed(), but is more
efficient
2012-03-23 16:48:52 +11:00
Andrew Tridgell fe55a76335 Math: moved matrix multiple operations to .cpp file
this means we only link this in once, rather than for every use of
matrix multiply, which saves us some flash space

We need to be careful not to put large pieces of code in template
headers, as if the operation is used a lot, it costs us a lot of code
space
2012-03-21 10:43:48 +11:00
Andrew Tridgell 17fbb8ea26 Math: fixed the build of the eulers test in SITL 2012-03-21 10:41:55 +11:00
Andrew Tridgell 17f7292fe9 Math: added a test for the rotate() method 2012-03-19 17:29:02 +11:00
Andrew Tridgell c16b353ea7 Math: added rotate() method to Matrix3f
this is the core method used to update the DCM matrix with a gyro
vector. Moving it to AP_Math allows us to have a test for it
2012-03-19 17:29:02 +11:00
Andrew Tridgell 31e566475b Math: added zero() and identity() methods to Matrix3f 2012-03-19 17:29:02 +11:00
Andrew Tridgell d948a28e7c Math: change signs in quaternion library
thanks to Justin for the suggestion
2012-03-19 17:29:02 +11:00
Andrew Tridgell af9ce0cfc9 Math: allow eulers test to build with AP_Declination library 2012-03-19 17:29:02 +11:00
Andrew Tridgell 72a761170b Math: fixed build of eulers test on SITL 2012-03-19 17:29:02 +11:00
Andrew Tridgell 58a68c89d9 Math: added a function to combine standard rotations
this will allow us to have an overall board rotation plus a per-sensor
rotation
2012-03-19 17:29:02 +11:00
Andrew Tridgell 0ec9857689 Math: any euler angle with pitch > 90 is invalid
both DCM and quaternion always return pitch in the range -90 to 90
2012-03-11 15:37:07 +11:00
Andrew Tridgell 4d3789d11c AP_Math: update the test suite 2012-03-11 15:37:07 +11:00
Andrew Tridgell 4422486d44 AP_Math: made rotation matrices more C++
thanks to Adam for the suggestion
2012-03-11 15:37:07 +11:00
Andrew Tridgell 5c6368bad3 AP_Math: allow null pointers in Quaternion::to_euler()
this matches the Matrix3f method
2012-03-11 15:37:07 +11:00
Andrew Tridgell 9f0cb78f08 AP_Math: re-work quaternion functions to be more C++ like
thanks to Adam for the suggestion!
2012-03-11 15:37:07 +11:00
Andrew Tridgell 55aa43a70d Math: added a test suite for the new rotation methods 2012-03-11 15:37:07 +11:00
Andrew Tridgell 289c64c0b9 Math: added vector3.rotate() and matrix3.rotation() methods
these operate on a "enum Rotation" which defines a set of standard
rotations. These are much faster than our previous method, plus use
less memory
2012-03-11 15:37:07 +11:00
Andrew Tridgell a92fb67b70 AP_Math: expanded the math test suite 2012-03-10 10:34:31 +11:00