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
12 years ago
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>
12 years ago
Randy Mackay
8b87849acd
Math: add wrap_PI
12 years ago
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
e1f9297551
AP_Math: move print_latlon() to location.cpp
12 years ago
Andrew Tridgell
8b119934ea
AP_Math: fixed grammar error
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
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
d8bed0c2aa
AP_Math: fixed get_distance() function
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
uncrustify
64eaadb332
uncrustify libraries/AP_Math/location.cpp
13 years ago
Jason Short
a66e43aff1
Location Lib : Abs was overflowing causing bad comparison
13 years ago
Jason Short
ff38dadd00
Location Lib. Potential fix for bad angle and distance calcs.
...
last_lat changed to int32_t since it can be negative.
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
1cd8c54f21
AP_Math: cope with co-located waypoints in location_passed_point()
13 years ago
Andrew Tridgell
dd200cba31
Math: added location functions to math library
...
these do common calculations on struct Location
13 years ago