Convert most type specific macros to functions and general cleanup.
This should make the code easier to use, debug and wrap externally. Additionally code size probably reduces since it's not all inline anymore...
Also cleaned up all the headers and added extern "C" to all the header files the math lib can easier be used in C++ applications.
So far the macros still exist and call the respective functions for backwards compatibility.
Merging pull request #819
* math_functions: (32 commits)
[math][ins] rewrite/move some math to ins_float_invariant
[airborne] use math functions instead of macros
[math] some dox updates
[math] more cleanup, e.g. rmat_[transp]_vmult
[math] rmat|quat_identity functions
[math] add double versions for vect3/quat norm
[math] VECTx_NORM updates
[math] int32_rmat_*mult functions
[math] algebra: remove some more type specific macros
[math] more x_integrate_fi functions
[math] fix code style
[math] geodetic: RMat instead of Mat33 for ltp_of_ecef
[math] remove some unused or type specifc VECTx macros
[math] add float_quat_integrate_fi
[math] set default PAPARAZZI_SRC
[test] add math c files
[math] add missing alias
[math] wgs84_ellipsoid_to_geoid as function
[math] use math functions in orientation conversion
[misc] fix natnet2ivy compilation
...
Pass dt to ahrs/ins propagation and updates instead of using the defines in the implementations.
The fixedwing ins_alt_float now uses the real dt for alt_kalman update from baro or gps.
For the AHRS: If the frequencies are not defines or USE_AUTO_AHRS_FREQ is TRUE, the dt is calculated from the system time.
Should be cleaner like this and less prone to misconfiguration, possible drawback however is that you get some more jitter on the DT.
The complementary filters now don't use the AHRS_x_FREQUENCY defines for calculation of the gains anymore and instead count the number of propagations since last update.
Not so sure passing dt to the update functions is the best way to go...
Is only used to update the gains of the cmpl filters right now.
But it makes it possible to properly compute the gains and avoids having a dependency on sys_time in the AHRS.
sed to the rescue:
find sw -path sw/airborne/math -prune -o -name "*.[ch]" -exec sed -i 's/\([ ]*[A-Z0-9_]*QUAT_OF[A-Z0-9_]*(\)\([a-zA-Z0-9_]*,[ ]*\)\([a-zA-Z0-9_]*)\)/\L\1\E\&\2\&\3/g' {} +
and so on...