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.
12 years ago
Andrew Tridgell
ba83950fc4
libraries: replace constrain() with constrain_float()
...
this makes the type much more obvious. Thanks to Tobias for the
suggestion.
12 years ago
Andrew Tridgell
e1f9297551
AP_Math: move print_latlon() to location.cpp
12 years ago
Andrew Tridgell
78eb12a4ac
AP_Math: added RadiansToCentiDegrees and RADIUS_OF_EARTH
12 years ago
tobias
217b8d7a59
cleanup: use const for struct Location pointers and references
...
this allows the compiler to generate more efficient code
12 years ago
Andrew Tridgell
091b474a1d
AP_Math: added wrap_360_cd() and wrap_180_cd()
...
moved from per-vehicle code
12 years ago
Randy Mackay
7729ec950e
AP_Math: longitude_scale function made public
...
Added LATLON_TO_M and LATLON_TO_CM #defines
12 years ago
Randy Mackay
d2767b911c
AP_Math: switch get_distance_cm to return uint32_t
...
Includes changes required on ArduCopter and ArduPlane side as well
12 years ago
James Bielman
4fa7bb1486
Add AVR compatibility header for missing math.h definitions.
...
- Define float versions of math functions to the double versions
on AVR (eg. #define sinf sin).
- These macros appear to be missing in older versions of avr-libs.
- Include AP_Math.h rather than math.h to get these definitions.
12 years ago
James Bielman
5631f865b2
Update floating point calculations to use floats instead of doubles.
...
- Allows use of hardware floating point on the Cortex-M4.
- Added "f" suffix to floating point literals.
- Call floating point versions of stdlib math functions.
12 years ago
Andrew Tridgell
38062bbb6d
AP_Math: support some more rotation combinations
12 years ago
Andrew Tridgell
eb74fddd9f
AP_Math: added global GRAVITY_MSS define
12 years ago
Andrew Tridgell
e7b915b0f4
AP_Math: fixed error comment
12 years ago
Andrew Tridgell
a072afa223
AP_Math: expand some macros into functions
...
this saves some flash
12 years ago
Pat Hickey
7dbe198e5c
AP_Math: port to work on coreless arduino (AP_HAL)
12 years ago
Pat Hickey
3f1d9d7f69
AP_Param: #include <AP_Param.h> fixups for libraries & sketches
...
* I mostly went through with grep and added an #include <AP_Param.h> below
every #include <AP_Common.h>. Not all of these example sketches might
strictly need AP_Param.
12 years ago
uncrustify
97994a4e3a
uncrustify libraries/AP_Math/AP_Math.h
13 years ago
Andrew Tridgell
87fca1985f
AP_Math: added location_update() and location_offset() functions
...
these will be used by AHRS dead reckoning
13 years ago
Andrew Tridgell
8ae35cae1c
AP_Math: rename get_bearing() to get_bearing_cd() to make units obvious
13 years ago
Andrew Tridgell
a72f6acef6
AP_Math: added get_distance_cm() to return in centimeters
13 years ago
Andrew Tridgell
468dfe3faa
AP_Math: the windows arduino build is missing acosf()
13 years ago
Andrew Tridgell
0bdce404a5
AP_Math: add include of math.h
...
this is needed for location.cpp
13 years ago
Andrew Tridgell
dd200cba31
Math: added location functions to math library
...
these do common calculations on struct Location
13 years ago
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
13 years ago
Andrew Tridgell
4422486d44
AP_Math: made rotation matrices more C++
...
thanks to Adam for the suggestion
13 years ago
Andrew Tridgell
9f0cb78f08
AP_Math: re-work quaternion functions to be more C++ like
...
thanks to Adam for the suggestion!
13 years ago
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
13 years ago
Andrew Tridgell
4d65cda0ea
AP_Math: added quaternion->matrix and earth frame routines
...
this will be used for 3d acceleration
13 years ago
Andrew Tridgell
c7d5f06b21
AP_Math: added quaternion helper functions and a test suite
13 years ago
Andrew Tridgell
16ed8bc8f6
AP_Math: added rotmat <-> euler functions
...
these will make the dcm matrix manipulation easier to understand
13 years ago
Andrew Tridgell
17d16bc8c6
AP_Math: added safe_sqrt() function
...
this function will never return NAN. It will return zero for negative
numbers.
13 years ago
Andrew Tridgell
502fbf6e17
AP_Math: added a safe_asin() function
...
this adds range checking to asin()
13 years ago
Andrew Tridgell
882cd4ea83
AP_Param: moved AP_Vector3f and AP_Matrix3f declarations to AP_Math.h
...
this avoids us needing AP_Math.h in every utility sketch and example
13 years ago
Andrew Tridgell
62e92f406e
AP_Math: make out vector and matrix elements used types with fixed sizes
...
this prevents differences between CPU types
13 years ago
Andrew Tridgell
117a98f9a2
AP_Math: added a Polygon_outside() function
...
this tests if a point is outside of a polygon. This will be used as
part of our geo-fencing support, and also for a new 'fenced mode'
13 years ago
DrZiplok@gmail.com
097161cd8d
Beginnings of a math library for ArduPilot(Mega) systems.
...
15 years ago