Paparazzi UAS  v5.2.2_stable-0-gd6b9f29
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
pprz_algebra.h File Reference
#include <float.h>
#include <string.h>
#include "std.h"
+ Include dependency graph for pprz_algebra.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define SQUARE(_a)   ((_a)*(_a))
 
#define VECT2_ASSIGN(_a, _x, _y)
 
#define VECT2_COPY(_a, _b)
 
#define VECT2_ADD(_a, _b)
 
#define VECT2_SUB(_a, _b)
 
#define VECT2_SUM(_c, _a, _b)
 
#define VECT2_DIFF(_c, _a, _b)
 
#define VECT2_SMUL(_vo, _vi, _s)
 
#define VECT2_SDIV(_vo, _vi, _s)
 
#define VECT2_STRIM(_v, _min, _max)
 
#define VECT2_DOT_PRODUCT(_so, _v1, _v2)
 
#define VECT3_ASSIGN(_a, _x, _y, _z)
 
#define VECT3_MUL(_v1, _v2)
 
#define VECT3_ASSIGN_ABS(_a, _x, _y, _z)
 
#define VECT3_COPY(_a, _b)
 
#define VECT3_ADD(_a, _b)
 
#define VECT3_SUB(_a, _b)
 
#define VECT3_SUM(_c, _a, _b)
 
#define VECT3_ADD_SCALED(_a, _b, _s)
 
#define VECT3_SUM_SCALED(_c, _a, _b, _s)
 
#define VECT3_DIFF(_c, _a, _b)
 
#define VECT3_SMUL(_vo, _vi, _s)
 
#define VECT3_SDIV(_vo, _vi, _s)
 
#define VECT3_STRIM(_v, _min, _max)
 
#define VECT3_EW_DIV(_vo, _va, _vb)
 
#define VECT3_EW_MUL(_vo, _va, _vb)
 
#define VECT3_BOUND_CUBE(_v, _min, _max)
 
#define VECT3_BOUND_BOX(_v, _v_min, _v_max)
 
#define VECT3_ABS(_vo, _vi)
 
#define VECT3_CROSS_PRODUCT(_vo, _v1, _v2)
 
#define VECT3_DOT_PRODUCT(_so, _v1, _v2)
 
#define VECT3_RATES_CROSS_VECT3(_vo, _r1, _v2)
 
#define EULERS_COPY(_a, _b)
 
#define EULERS_ASSIGN(_e, _phi, _theta, _psi)
 
#define EULERS_ADD(_a, _b)
 
#define EULERS_SUB(_a, _b)
 
#define EULERS_DIFF(_c, _a, _b)
 
#define EULERS_SMUL(_eo, _ei, _s)
 
#define EULERS_SDIV(_eo, _ei, _s)
 
#define EULERS_BOUND_CUBE(_v, _min, _max)
 
#define RATES_ASSIGN(_ra, _p, _q, _r)
 
#define RATES_COPY(_a, _b)
 
#define RATES_ADD(_a, _b)
 
#define RATES_SUB(_a, _b)
 
#define RATES_SUM(_c, _a, _b)
 
#define RATES_SUM_SCALED(_c, _a, _b, _s)
 
#define RATES_DIFF(_c, _a, _b)
 
#define RATES_SMUL(_ro, _ri, _s)
 
#define RATES_SDIV(_ro, _ri, _s)
 
#define RATES_EWMULT_RSHIFT(c, a, b, _s)
 
#define RATES_BOUND_CUBE(_v, _min, _max)
 
#define RATES_BOUND_BOX(_v, _v_min, _v_max)
 
#define MAT33_ELMT(_m, _row, _col)   ((_m).m[(_row)*3+(_col)])
 
#define MAT33_COPY(_mat1, _mat2)
 
#define MAT33_VECT3_MUL(_vout, _mat, _vin)
 
#define MAT33_VECT3_TRANSP_MUL(_vout, _mat, _vin)
 
#define MAT33_INV(_minv, _m)
 
#define MAT33_ROW_VECT3_SMUL(_mat, _row, _vin, _s)
 
#define QUAT_ASSIGN(_q, _i, _x, _y, _z)
 
#define QUAT_DIFF(_qc, _qa, _qb)
 
#define QUAT_COPY(_qo, _qi)
 
#define QUAT_EXPLEMENTARY(b, a)
 
#define QUAT_SMUL(_qo, _qi, _s)
 
#define QUAT_ADD(_qo, _qi)
 
#define QUAT_INVERT(_qo, _qi)
 
#define QUAT_EXTRACT_Q(_vo, _qi)
 
#define QUAT_SDIV(_qo, _qi, _s)
 
#define RMAT_ELMT(_rm, _row, _col)   MAT33_ELMT(_rm, _row, _col)
 
#define RMAT_TRACE(_rm)   (RMAT_ELMT(_rm, 0, 0)+RMAT_ELMT(_rm, 1, 1)+RMAT_ELMT(_rm, 2, 2))
 
#define RMAT_DIFF(_c, _a, _b)
 
#define RMAT_VECT3_MUL(_vout, _rmat, _vin)
 
#define RMAT_VECT3_TRANSP_MUL(_vout, _rmat, _vin)
 
#define RMAT_COPY(_o, _i)   { memcpy(&(_o), &(_i), sizeof(_o));}
 
#define EULERS_FLOAT_OF_BFP(_ef, _ei)
 
#define EULERS_BFP_OF_REAL(_ei, _ef)
 
#define RMAT_BFP_OF_REAL(_ei, _ef)
 
#define RMAT_FLOAT_OF_BFP(_ef, _ei)
 
#define QUAT_FLOAT_OF_BFP(_qf, _qi)
 
#define QUAT_BFP_OF_REAL(_qi, _qf)
 
#define RATES_FLOAT_OF_BFP(_rf, _ri)
 
#define RATES_BFP_OF_REAL(_ri, _rf)
 
#define POSITIONS_FLOAT_OF_BFP(_ef, _ei)
 
#define POSITIONS_BFP_OF_REAL(_ef, _ei)
 
#define SPEEDS_FLOAT_OF_BFP(_ef, _ei)
 
#define SPEEDS_BFP_OF_REAL(_ef, _ei)
 
#define ACCELS_FLOAT_OF_BFP(_ef, _ei)
 
#define ACCELS_BFP_OF_REAL(_ef, _ei)
 
#define MAGS_FLOAT_OF_BFP(_ef, _ei)
 
#define MAGS_BFP_OF_REAL(_ef, _ei)
 

Macro Definition Documentation

#define ACCELS_BFP_OF_REAL (   _ef,
  _ei 
)
Value:
{ \
(_ef).x = ACCEL_BFP_OF_REAL((_ei).x); \
(_ef).y = ACCEL_BFP_OF_REAL((_ei).y); \
(_ef).z = ACCEL_BFP_OF_REAL((_ei).z); \
}
#define ACCEL_BFP_OF_REAL(_af)

Definition at line 714 of file pprz_algebra.h.

Referenced by gx3_packet_read_message(), stateCalcAccelEcef_i(), stateCalcAccelNed_i(), and UM6_packet_read_message().

#define ACCELS_FLOAT_OF_BFP (   _ef,
  _ei 
)
Value:
{ \
(_ef).x = ACCEL_FLOAT_OF_BFP((_ei).x); \
(_ef).y = ACCEL_FLOAT_OF_BFP((_ei).y); \
(_ef).z = ACCEL_FLOAT_OF_BFP((_ei).z); \
}
#define ACCEL_FLOAT_OF_BFP(_ai)

Definition at line 708 of file pprz_algebra.h.

Referenced by ahrs_float_get_euler_from_accel_mag(), ahrs_float_get_quat_from_accel(), ahrs_propagate(), ahrs_update_accel(), stateCalcAccelEcef_f(), and stateCalcAccelNed_f().

#define EULERS_ADD (   _a,
  _b 
)
Value:
{ \
(_a).phi += (_b).phi; \
(_a).theta += (_b).theta; \
(_a).psi += (_b).psi; \
}

Definition at line 270 of file pprz_algebra.h.

Referenced by ahrs_propagate(), stabilization_attitude_ref_update(), and stabilization_attitude_run().

#define EULERS_ASSIGN (   _e,
  _phi,
  _theta,
  _psi 
)
Value:
{ \
(_e).phi = (_phi); \
(_e).theta = (_theta); \
(_e).psi = (_psi); \
}

Definition at line 263 of file pprz_algebra.h.

Referenced by ahrs_float_get_euler_from_accel_mag(), booz_fms_impl_periodic(), and stabilization_attitude_ref_update().

#define EULERS_BFP_OF_REAL (   _ei,
  _ef 
)
Value:
{ \
(_ei).phi = ANGLE_BFP_OF_REAL((_ef).phi); \
(_ei).theta = ANGLE_BFP_OF_REAL((_ef).theta); \
(_ei).psi = ANGLE_BFP_OF_REAL((_ef).psi); \
}
#define ANGLE_BFP_OF_REAL(_af)

Definition at line 628 of file pprz_algebra.h.

Referenced by orientationCalcEulers_i(), orientationCalcQuat_i(), orientationCalcRMat_i(), and UM6_packet_read_message().

#define EULERS_BOUND_CUBE (   _v,
  _min,
  _max 
)
Value:
{ \
(_v).phi = (_v).phi < (_min) ? (_min) : (_v).phi > (_max) ? (_max) : (_v).phi; \
(_v).theta = (_v).theta < (_min) ? (_min) : (_v).theta > (_max) ? (_max) : (_v).theta; \
(_v).psi = (_v).psi < (_min) ? (_min) : (_v).psi > (_max) ? (_max) : (_v).psi; \
}

Definition at line 306 of file pprz_algebra.h.

Referenced by stabilization_attitude_run().

#define EULERS_COPY (   _a,
  _b 
)
Value:
{ \
(_a).phi = (_b).phi; \
(_a).theta = (_b).theta; \
(_a).psi = (_b).psi; \
}

Definition at line 257 of file pprz_algebra.h.

Referenced by ahrs_align(), orientationSetEulers_f(), orientationSetEulers_i(), and stabilization_attitude_ref_update().

#define EULERS_DIFF (   _c,
  _a,
  _b 
)
Value:
{ \
(_c).phi = (_a).phi - (_b).phi; \
(_c).theta = (_a).theta - (_b).theta; \
(_c).psi = (_a).psi - (_b).psi; \
}

Definition at line 284 of file pprz_algebra.h.

Referenced by ahrs_propagate(), stabilization_attitude_ref_update(), and stabilization_attitude_run().

#define EULERS_FLOAT_OF_BFP (   _ef,
  _ei 
)
Value:
{ \
(_ef).phi = ANGLE_FLOAT_OF_BFP((_ei).phi); \
(_ef).theta = ANGLE_FLOAT_OF_BFP((_ei).theta); \
(_ef).psi = ANGLE_FLOAT_OF_BFP((_ei).psi); \
}
#define ANGLE_FLOAT_OF_BFP(_ai)

Definition at line 622 of file pprz_algebra.h.

Referenced by orientationCalcEulers_f(), orientationCalcQuat_f(), orientationCalcRMat_f(), quat_from_rpy_cmd_i(), and stabilization_attitude_set_rpy_setpoint_i().

#define EULERS_SDIV (   _eo,
  _ei,
  _s 
)
Value:
{ \
(_eo).phi = (_ei).phi / (_s); \
(_eo).theta = (_ei).theta / (_s); \
(_eo).psi = (_ei).psi / (_s); \
}

Definition at line 299 of file pprz_algebra.h.

Referenced by ahrs_align(), and ahrs_propagate().

#define EULERS_SMUL (   _eo,
  _ei,
  _s 
)
Value:
{ \
(_eo).phi = (_ei).phi * (_s); \
(_eo).theta = (_ei).theta * (_s); \
(_eo).psi = (_ei).psi * (_s); \
}

Definition at line 292 of file pprz_algebra.h.

Referenced by UM6_packet_read_message().

#define EULERS_SUB (   _a,
  _b 
)
Value:
{ \
(_a).phi -= (_b).phi; \
(_a).theta -= (_b).theta; \
(_a).psi -= (_b).psi; \
}

Definition at line 277 of file pprz_algebra.h.

#define MAGS_BFP_OF_REAL (   _ef,
  _ei 
)
Value:
{ \
(_ef).x = MAG_BFP_OF_REAL((_ei).x); \
(_ef).y = MAG_BFP_OF_REAL((_ei).y); \
(_ef).z = MAG_BFP_OF_REAL((_ei).z); \
}
#define MAG_BFP_OF_REAL(_af)

Definition at line 726 of file pprz_algebra.h.

Referenced by UM6_packet_read_message().

#define MAGS_FLOAT_OF_BFP (   _ef,
  _ei 
)
Value:
{ \
(_ef).x = MAG_FLOAT_OF_BFP((_ei).x); \
(_ef).y = MAG_FLOAT_OF_BFP((_ei).y); \
(_ef).z = MAG_FLOAT_OF_BFP((_ei).z); \
}
#define MAG_FLOAT_OF_BFP(_ai)

Definition at line 720 of file pprz_algebra.h.

Referenced by ahrs_float_get_euler_from_accel_mag(), ahrs_float_get_quat_from_accel_mag(), ahrs_update_mag(), ahrs_update_mag_2d(), ahrs_update_mag_2d_dumb(), and ahrs_update_mag_full().

#define MAT33_COPY (   _mat1,
  _mat2 
)
Value:
{ \
MAT33_ELMT((_mat1),0,0) = MAT33_ELMT((_mat2),0,0); \
MAT33_ELMT((_mat1),0,1) = MAT33_ELMT((_mat2),0,1); \
MAT33_ELMT((_mat1),0,2) = MAT33_ELMT((_mat2),0,2); \
MAT33_ELMT((_mat1),1,0) = MAT33_ELMT((_mat2),1,0); \
MAT33_ELMT((_mat1),1,1) = MAT33_ELMT((_mat2),1,1); \
MAT33_ELMT((_mat1),1,2) = MAT33_ELMT((_mat2),1,2); \
MAT33_ELMT((_mat1),2,0) = MAT33_ELMT((_mat2),2,0); \
MAT33_ELMT((_mat1),2,1) = MAT33_ELMT((_mat2),2,1); \
MAT33_ELMT((_mat1),2,2) = MAT33_ELMT((_mat2),2,2); \
}
#define MAT33_ELMT(_m, _row, _col)
Definition: pprz_algebra.h:415

Definition at line 417 of file pprz_algebra.h.

#define MAT33_ELMT (   _m,
  _row,
  _col 
)    ((_m).m[(_row)*3+(_col)])

Definition at line 415 of file pprz_algebra.h.

#define MAT33_INV (   _minv,
  _m 
)
Value:
{ \
const float m00 = MAT33_ELMT((_m),1,1)*MAT33_ELMT((_m),2,2) - MAT33_ELMT((_m),1,2)*MAT33_ELMT((_m),2,1); \
const float m10 = MAT33_ELMT((_m),0,1)*MAT33_ELMT((_m),2,2) - MAT33_ELMT((_m),0,2)*MAT33_ELMT((_m),2,1); \
const float m20 = MAT33_ELMT((_m),0,1)*MAT33_ELMT((_m),1,2) - MAT33_ELMT((_m),0,2)*MAT33_ELMT((_m),1,1); \
const float m01 = MAT33_ELMT((_m),1,0)*MAT33_ELMT((_m),2,2) - MAT33_ELMT((_m),1,2)*MAT33_ELMT((_m),2,0); \
const float m11 = MAT33_ELMT((_m),0,0)*MAT33_ELMT((_m),2,2) - MAT33_ELMT((_m),0,2)*MAT33_ELMT((_m),2,0); \
const float m21 = MAT33_ELMT((_m),0,0)*MAT33_ELMT((_m),1,2) - MAT33_ELMT((_m),0,2)*MAT33_ELMT((_m),1,0); \
const float m02 = MAT33_ELMT((_m),1,0)*MAT33_ELMT((_m),2,1) - MAT33_ELMT((_m),1,1)*MAT33_ELMT((_m),2,0); \
const float m12 = MAT33_ELMT((_m),0,0)*MAT33_ELMT((_m),2,1) - MAT33_ELMT((_m),0,1)*MAT33_ELMT((_m),2,0); \
const float m22 = MAT33_ELMT((_m),0,0)*MAT33_ELMT((_m),1,1) - MAT33_ELMT((_m),0,1)*MAT33_ELMT((_m),1,0); \
const float det = MAT33_ELMT((_m),0,0)*m00 - MAT33_ELMT((_m),1,0)*m10 + MAT33_ELMT((_m),2,0)*m20; \
if (fabs(det) > FLT_EPSILON) { \
MAT33_ELMT((_minv),0,0) = m00 / det; \
MAT33_ELMT((_minv),1,0) = -m01 / det; \
MAT33_ELMT((_minv),2,0) = m02 / det; \
MAT33_ELMT((_minv),0,1) = -m10 / det; \
MAT33_ELMT((_minv),1,1) = m11 / det; \
MAT33_ELMT((_minv),2,1) = -m12 / det; \
MAT33_ELMT((_minv),0,2) = m20 / det; \
MAT33_ELMT((_minv),1,2) = -m21 / det; \
MAT33_ELMT((_minv),2,2) = m22 / det; \
} \
}
if(PrimarySpektrumState.SpektrumTimer)--PrimarySpektrumState.SpektrumTimer
#define MAT33_ELMT(_m, _row, _col)
Definition: pprz_algebra.h:415

Definition at line 457 of file pprz_algebra.h.

#define MAT33_ROW_VECT3_SMUL (   _mat,
  _row,
  _vin,
  _s 
)
Value:
{ \
MAT33_ELMT((_mat), _row, 0) = (_vin).x * (_s); \
MAT33_ELMT((_mat), _row, 1) = (_vin).y * (_s); \
MAT33_ELMT((_mat), _row, 2) = (_vin).z * (_s); \
}
#define MAT33_ELMT(_m, _row, _col)
Definition: pprz_algebra.h:415

Definition at line 482 of file pprz_algebra.h.

Referenced by float_rmat_reorthogonalize().

#define MAT33_VECT3_MUL (   _vout,
  _mat,
  _vin 
)
Value:
{ \
(_vout).x = MAT33_ELMT((_mat), 0, 0) * (_vin).x + \
MAT33_ELMT((_mat), 0, 1) * (_vin).y + \
MAT33_ELMT((_mat), 0, 2) * (_vin).z; \
(_vout).y = MAT33_ELMT((_mat), 1, 0) * (_vin).x + \
MAT33_ELMT((_mat), 1, 1) * (_vin).y + \
MAT33_ELMT((_mat), 1, 2) * (_vin).z; \
(_vout).z = MAT33_ELMT((_mat), 2, 0) * (_vin).x + \
MAT33_ELMT((_mat), 2, 1) * (_vin).y + \
MAT33_ELMT((_mat), 2, 2) * (_vin).z; \
}
#define MAT33_ELMT(_m, _row, _col)
Definition: pprz_algebra.h:415

Definition at line 431 of file pprz_algebra.h.

Referenced by enu_of_ecef_point_d(), enu_of_ecef_point_f(), enu_of_ecef_vect_d(), and enu_of_ecef_vect_f().

#define MAT33_VECT3_TRANSP_MUL (   _vout,
  _mat,
  _vin 
)
Value:
{ \
(_vout).x = MAT33_ELMT((_mat), 0, 0) * (_vin).x + \
MAT33_ELMT((_mat), 1, 0) * (_vin).y + \
MAT33_ELMT((_mat), 2, 0) * (_vin).z; \
(_vout).y = MAT33_ELMT((_mat), 0, 1) * (_vin).x + \
MAT33_ELMT((_mat), 1, 1) * (_vin).y + \
MAT33_ELMT((_mat), 2, 1) * (_vin).z; \
(_vout).z = MAT33_ELMT((_mat), 0, 2) * (_vin).x + \
MAT33_ELMT((_mat), 1, 2) * (_vin).y + \
MAT33_ELMT((_mat), 2, 2) * (_vin).z; \
}
#define MAT33_ELMT(_m, _row, _col)
Definition: pprz_algebra.h:415

Definition at line 444 of file pprz_algebra.h.

Referenced by ecef_of_enu_point_d(), ecef_of_enu_point_f(), ecef_of_enu_vect_d(), and ecef_of_enu_vect_f().

#define POSITIONS_BFP_OF_REAL (   _ef,
  _ei 
)
Value:
{ \
(_ef).x = POS_BFP_OF_REAL((_ei).x); \
(_ef).y = POS_BFP_OF_REAL((_ei).y); \
(_ef).z = POS_BFP_OF_REAL((_ei).z); \
}
#define POS_BFP_OF_REAL(_af)

Definition at line 690 of file pprz_algebra.h.

#define POSITIONS_FLOAT_OF_BFP (   _ef,
  _ei 
)
Value:
{ \
(_ef).x = POS_FLOAT_OF_BFP((_ei).x); \
(_ef).y = POS_FLOAT_OF_BFP((_ei).y); \
(_ef).z = POS_FLOAT_OF_BFP((_ei).z); \
}
#define POS_FLOAT_OF_BFP(_ai)

Definition at line 684 of file pprz_algebra.h.

#define QUAT_ADD (   _qo,
  _qi 
)
Value:
{ \
(_qo).qi += (_qi).qi; \
(_qo).qx += (_qi).qx; \
(_qo).qy += (_qi).qy; \
(_qo).qz += (_qi).qz; \
}

Definition at line 535 of file pprz_algebra.h.

Referenced by stabilization_attitude_ref_update().

#define QUAT_ASSIGN (   _q,
  _i,
  _x,
  _y,
  _z 
)
Value:
{ \
(_q).qi = (_i); \
(_q).qx = (_x); \
(_q).qy = (_y); \
(_q).qz = (_z); \
}

Definition at line 496 of file pprz_algebra.h.

Referenced by ahrs_float_get_quat_from_accel(), ahrs_float_get_quat_from_accel_mag(), and quat_from_earth_cmd_f().

#define QUAT_BFP_OF_REAL (   _qi,
  _qf 
)
#define QUAT_COPY (   _qo,
  _qi 
)
#define QUAT_DIFF (   _qc,
  _qa,
  _qb 
)
Value:
{ \
(_qc).qi = (_qa).qi - (_qb).qi; \
(_qc).qx = (_qa).qx - (_qb).qx; \
(_qc).qy = (_qa).qy - (_qb).qy; \
(_qc).qz = (_qa).qz - (_qb).qz; \
}

Definition at line 504 of file pprz_algebra.h.

#define QUAT_EXPLEMENTARY (   b,
 
)
Value:
{ \
(b).qi = -(a).qi; \
(b).qx = -(a).qx; \
(b).qy = -(a).qy; \
(b).qz = -(a).qz; \
}

Definition at line 519 of file pprz_algebra.h.

#define QUAT_EXTRACT_Q (   _vo,
  _qi 
)
Value:
{ \
(_vo).x=(_qi).qx; \
(_vo).y=(_qi).qy; \
(_vo).z=(_qi).qz; \
}

Definition at line 551 of file pprz_algebra.h.

#define QUAT_FLOAT_OF_BFP (   _qf,
  _qi 
)
Value:
{ \
(_qf).qi = QUAT1_FLOAT_OF_BFP((_qi).qi); \
(_qf).qx = QUAT1_FLOAT_OF_BFP((_qi).qx); \
(_qf).qy = QUAT1_FLOAT_OF_BFP((_qi).qy); \
(_qf).qz = QUAT1_FLOAT_OF_BFP((_qi).qz); \
}
#define QUAT1_FLOAT_OF_BFP(_qi)

Definition at line 658 of file pprz_algebra.h.

Referenced by orientationCalcEulers_f(), orientationCalcQuat_f(), and orientationCalcRMat_f().

#define QUAT_INVERT (   _qo,
  _qi 
)
Value:
{ \
(_qo).qi = (_qi).qi; \
(_qo).qx = -(_qi).qx; \
(_qo).qy = -(_qi).qy; \
(_qo).qz = -(_qi).qz; \
}

Definition at line 543 of file pprz_algebra.h.

#define QUAT_SDIV (   _qo,
  _qi,
  _s 
)
Value:
{ \
(_qo).qi = (_qi).qi / _s; \
(_qo).qx = (_qi).qx / _s; \
(_qo).qy = (_qi).qy / _s; \
(_qo).qz = (_qi).qz / _s; \
}

Definition at line 558 of file pprz_algebra.h.

#define QUAT_SMUL (   _qo,
  _qi,
  _s 
)
Value:
{ \
(_qo).qi = (_qi).qi * (_s); \
(_qo).qx = (_qi).qx * (_s); \
(_qo).qy = (_qi).qy * (_s); \
(_qo).qz = (_qi).qz * (_s); \
}

Definition at line 527 of file pprz_algebra.h.

Referenced by stabilization_attitude_ref_update().

#define RATES_ADD (   _a,
  _b 
)
Value:
{ \
(_a).p += (_b).p; \
(_a).q += (_b).q; \
(_a).r += (_b).r; \
}
static float p[2][2]

Definition at line 333 of file pprz_algebra.h.

Referenced by ahrs_aligner_run(), ahrs_propagate(), imu_krooz_event(), on_gyro_event(), stabilization_attitude_ref_update(), and stabilization_rate_run().

#define RATES_ASSIGN (   _ra,
  _p,
  _q,
  _r 
)
#define RATES_BFP_OF_REAL (   _ri,
  _rf 
)
Value:
{ \
(_ri).p = RATE_BFP_OF_REAL((_rf).p); \
(_ri).q = RATE_BFP_OF_REAL((_rf).q); \
(_ri).r = RATE_BFP_OF_REAL((_rf).r); \
}
static float p[2][2]
#define RATE_BFP_OF_REAL(_af)

Definition at line 678 of file pprz_algebra.h.

Referenced by stateCalcBodyRates_i(), and UM6_packet_read_message().

#define RATES_BOUND_BOX (   _v,
  _v_min,
  _v_max 
)
Value:
{ \
if ((_v).p > (_v_max).p) (_v).p = (_v_max).p; else if ((_v).p < (_v_min).p) (_v).p = (_v_min).p; \
if ((_v).q > (_v_max).q) (_v).q = (_v_max).q; else if ((_v).q < (_v_min).q) (_v).q = (_v_min).q; \
if ((_v).r > (_v_max).r) (_v).r = (_v_max).r; else if ((_v).r < (_v_min).r) (_v).r = (_v_min).r; \
}
if(PrimarySpektrumState.SpektrumTimer)--PrimarySpektrumState.SpektrumTimer
static float p[2][2]

Definition at line 396 of file pprz_algebra.h.

Referenced by stabilization_attitude_ref_update().

#define RATES_BOUND_CUBE (   _v,
  _min,
  _max 
)
Value:
{ \
(_v).p = (_v).p < (_min) ? (_min) : (_v).p > (_max) ? (_max) : (_v).p; \
(_v).q = (_v).q < (_min) ? (_min) : (_v).q > (_max) ? (_max) : (_v).q; \
(_v).r = (_v).r < (_min) ? (_min) : (_v).r > (_max) ? (_max) : (_v).r; \
}
static float p[2][2]

Definition at line 390 of file pprz_algebra.h.

Referenced by stabilization_rate_run().

#define RATES_DIFF (   _c,
  _a,
  _b 
)
Value:
{ \
(_c).p = (_a).p - (_b).p; \
(_c).q = (_a).q - (_b).q; \
(_c).r = (_a).r - (_b).r; \
}
static float p[2][2]

Definition at line 361 of file pprz_algebra.h.

Referenced by ahrs_propagate(), invariant_model(), stabilization_attitude_run(), and stabilization_rate_run().

#define RATES_EWMULT_RSHIFT (   c,
  a,
  b,
  _s 
)
Value:
{ \
(c).p = ((a).p * (b).p) >> (_s); \
(c).q = ((a).q * (b).q) >> (_s); \
(c).r = ((a).r * (b).r) >> (_s); \
}
static float p[2][2]

Definition at line 382 of file pprz_algebra.h.

Referenced by stabilization_rate_run().

#define RATES_FLOAT_OF_BFP (   _rf,
  _ri 
)
Value:
{ \
(_rf).p = RATE_FLOAT_OF_BFP((_ri).p); \
(_rf).q = RATE_FLOAT_OF_BFP((_ri).q); \
(_rf).r = RATE_FLOAT_OF_BFP((_ri).r); \
}
#define RATE_FLOAT_OF_BFP(_ai)
static float p[2][2]

Definition at line 672 of file pprz_algebra.h.

Referenced by ahrs_align(), ahrs_propagate(), propagate_ref(), and stateCalcBodyRates_f().

#define RATES_SDIV (   _ro,
  _ri,
  _s 
)
Value:
{ \
(_ro).p = (_ri).p / (_s) ; \
(_ro).q = (_ri).q / (_s); \
(_ro).r = (_ri).r / (_s); \
}
static float p[2][2]

Definition at line 375 of file pprz_algebra.h.

Referenced by ahrs_aligner_run(), ahrs_propagate(), on_gyro_event(), and stabilization_rate_run().

#define RATES_SMUL (   _ro,
  _ri,
  _s 
)
Value:
{ \
(_ro).p = (_ri).p * (_s); \
(_ro).q = (_ri).q * (_s); \
(_ro).r = (_ri).r * (_s); \
}
static float p[2][2]

Definition at line 368 of file pprz_algebra.h.

Referenced by ahrs_propagate(), stabilization_attitude_ref_update(), and UM6_packet_read_message().

#define RATES_SUB (   _a,
  _b 
)
Value:
{ \
(_a).p -= (_b).p; \
(_a).q -= (_b).q; \
(_a).r -= (_b).r; \
}
static float p[2][2]

Definition at line 340 of file pprz_algebra.h.

Referenced by ahrs_propagate(), and propagate_ref().

#define RATES_SUM (   _c,
  _a,
  _b 
)
Value:
{ \
(_c).p = (_a).p + (_b).p; \
(_c).q = (_a).q + (_b).q; \
(_c).r = (_a).r + (_b).r; \
}
static float p[2][2]

Definition at line 347 of file pprz_algebra.h.

Referenced by ahrs_propagate(), and stabilization_attitude_ref_update().

#define RATES_SUM_SCALED (   _c,
  _a,
  _b,
  _s 
)
Value:
{ \
(_c).p = (_a).p + (_s)*(_b).p; \
(_c).q = (_a).q + (_s)*(_b).q; \
(_c).r = (_a).r + (_s)*(_b).r; \
}
static float p[2][2]

Definition at line 354 of file pprz_algebra.h.

Referenced by ahrs_propagate().

#define RMAT_BFP_OF_REAL (   _ei,
  _ef 
)
Value:
{ \
(_ei).m[0] = TRIG_BFP_OF_REAL((_ef).m[0]); \
(_ei).m[1] = TRIG_BFP_OF_REAL((_ef).m[1]); \
(_ei).m[2] = TRIG_BFP_OF_REAL((_ef).m[2]); \
(_ei).m[3] = TRIG_BFP_OF_REAL((_ef).m[3]); \
(_ei).m[4] = TRIG_BFP_OF_REAL((_ef).m[4]); \
(_ei).m[5] = TRIG_BFP_OF_REAL((_ef).m[5]); \
(_ei).m[6] = TRIG_BFP_OF_REAL((_ef).m[6]); \
(_ei).m[7] = TRIG_BFP_OF_REAL((_ef).m[7]); \
(_ei).m[8] = TRIG_BFP_OF_REAL((_ef).m[8]); \
}
#define TRIG_BFP_OF_REAL(_tf)

Definition at line 634 of file pprz_algebra.h.

Referenced by orientationCalcEulers_i(), orientationCalcQuat_i(), and orientationCalcRMat_i().

#define RMAT_COPY (   _o,
  _i 
)    { memcpy(&(_o), &(_i), sizeof(_o));}

Definition at line 617 of file pprz_algebra.h.

Referenced by orientationSetRMat_f(), and orientationSetRMat_i().

#define RMAT_DIFF (   _c,
  _a,
  _b 
)
Value:
{ \
(_c).m[0] = (_a).m[0] - (_b).m[0]; \
(_c).m[1] = (_a).m[1] - (_b).m[1]; \
(_c).m[2] = (_a).m[2] - (_b).m[2]; \
(_c).m[3] = (_a).m[3] - (_b).m[3]; \
(_c).m[4] = (_a).m[4] - (_b).m[4]; \
(_c).m[5] = (_a).m[5] - (_b).m[5]; \
(_c).m[6] = (_a).m[6] - (_b).m[6]; \
(_c).m[7] = (_a).m[7] - (_b).m[7]; \
(_c).m[8] = (_a).m[8] - (_b).m[8]; \
}

Definition at line 579 of file pprz_algebra.h.

#define RMAT_ELMT (   _rm,
  _row,
  _col 
)    MAT33_ELMT(_rm, _row, _col)
#define RMAT_FLOAT_OF_BFP (   _ef,
  _ei 
)
Value:
{ \
(_ef).m[0] = TRIG_FLOAT_OF_BFP((_ei).m[0]); \
(_ef).m[1] = TRIG_FLOAT_OF_BFP((_ei).m[1]); \
(_ef).m[2] = TRIG_FLOAT_OF_BFP((_ei).m[2]); \
(_ef).m[3] = TRIG_FLOAT_OF_BFP((_ei).m[3]); \
(_ef).m[4] = TRIG_FLOAT_OF_BFP((_ei).m[4]); \
(_ef).m[5] = TRIG_FLOAT_OF_BFP((_ei).m[5]); \
(_ef).m[6] = TRIG_FLOAT_OF_BFP((_ei).m[6]); \
(_ef).m[7] = TRIG_FLOAT_OF_BFP((_ei).m[7]); \
(_ef).m[8] = TRIG_FLOAT_OF_BFP((_ei).m[8]); \
}
#define TRIG_FLOAT_OF_BFP(_ti)

Definition at line 646 of file pprz_algebra.h.

Referenced by orientationCalcEulers_f(), orientationCalcQuat_f(), and orientationCalcRMat_f().

#define RMAT_TRACE (   _rm)    (RMAT_ELMT(_rm, 0, 0)+RMAT_ELMT(_rm, 1, 1)+RMAT_ELMT(_rm, 2, 2))

Definition at line 576 of file pprz_algebra.h.

#define RMAT_VECT3_MUL (   _vout,
  _rmat,
  _vin 
)
Value:
{ \
(_vout).x = RMAT_ELMT((_rmat), 0, 0) * (_vin).x + \
RMAT_ELMT((_rmat), 0, 1) * (_vin).y + \
RMAT_ELMT((_rmat), 0, 2) * (_vin).z; \
(_vout).y = RMAT_ELMT((_rmat), 1, 0) * (_vin).x + \
RMAT_ELMT((_rmat), 1, 1) * (_vin).y + \
RMAT_ELMT((_rmat), 1, 2) * (_vin).z; \
(_vout).z = RMAT_ELMT((_rmat), 2, 0) * (_vin).x + \
RMAT_ELMT((_rmat), 2, 1) * (_vin).y + \
RMAT_ELMT((_rmat), 2, 2) * (_vin).z; \
}
#define RMAT_ELMT(_rm, _row, _col)
Definition: pprz_algebra.h:573

Definition at line 592 of file pprz_algebra.h.

#define RMAT_VECT3_TRANSP_MUL (   _vout,
  _rmat,
  _vin 
)
Value:
{ \
(_vout).x = RMAT_ELMT((_rmat), 0, 0) * (_vin).x + \
RMAT_ELMT((_rmat), 1, 0) * (_vin).y + \
RMAT_ELMT((_rmat), 2, 0) * (_vin).z; \
(_vout).y = RMAT_ELMT((_rmat), 0, 1) * (_vin).x + \
RMAT_ELMT((_rmat), 1, 1) * (_vin).y + \
RMAT_ELMT((_rmat), 2, 1) * (_vin).z; \
(_vout).z = RMAT_ELMT((_rmat), 0, 2) * (_vin).x + \
RMAT_ELMT((_rmat), 1, 2) * (_vin).y + \
RMAT_ELMT((_rmat), 2, 2) * (_vin).z; \
}
#define RMAT_ELMT(_rm, _row, _col)
Definition: pprz_algebra.h:573

Definition at line 604 of file pprz_algebra.h.

#define SPEEDS_BFP_OF_REAL (   _ef,
  _ei 
)
Value:
{ \
(_ef).x = SPEED_BFP_OF_REAL((_ei).x); \
(_ef).y = SPEED_BFP_OF_REAL((_ei).y); \
(_ef).z = SPEED_BFP_OF_REAL((_ei).z); \
}
#define SPEED_BFP_OF_REAL(_af)

Definition at line 702 of file pprz_algebra.h.

Referenced by stateCalcHorizontalSpeedDir_i(), stateCalcSpeedEcef_i(), stateCalcSpeedEnu_i(), and stateCalcSpeedNed_i().

#define SPEEDS_FLOAT_OF_BFP (   _ef,
  _ei 
)
Value:
{ \
(_ef).x = SPEED_FLOAT_OF_BFP((_ei).x); \
(_ef).y = SPEED_FLOAT_OF_BFP((_ei).y); \
(_ef).z = SPEED_FLOAT_OF_BFP((_ei).z); \
}
#define SPEED_FLOAT_OF_BFP(_ai)

Definition at line 696 of file pprz_algebra.h.

Referenced by stateCalcHorizontalSpeedDir_f(), stateCalcHorizontalSpeedNorm_f(), stateCalcSpeedEcef_f(), stateCalcSpeedEnu_f(), and stateCalcSpeedNed_f().

#define SQUARE (   _a)    ((_a)*(_a))

Definition at line 30 of file pprz_algebra.h.

Referenced by ahrs_float_get_quat_from_accel_mag().

#define VECT2_ADD (   _a,
  _b 
)
Value:
{ \
(_a).x += (_b).x; \
(_a).y += (_b).y; \
}

Definition at line 56 of file pprz_algebra.h.

Referenced by gh_update_ref_from_pos_sp(), gh_update_ref_from_speed_sp(), and nav_survey_zamboni_run().

#define VECT2_ASSIGN (   _a,
  _x,
  _y 
)
Value:
{ \
(_a).x = (_x); \
(_a).y = (_y); \
}

Definition at line 44 of file pprz_algebra.h.

Referenced by ins_update_gps(), and nav_circle().

#define VECT2_DOT_PRODUCT (   _so,
  _v1,
  _v2 
)
Value:
{ \
(_so) = (_v1).x*(_v2).x + (_v1).y*(_v2).y + (_v1).z*(_v2).z; \
}

Definition at line 98 of file pprz_algebra.h.

#define VECT2_SDIV (   _vo,
  _vi,
  _s 
)
Value:
{ \
(_vo).x = (_vi).x / (_s); \
(_vo).y = (_vi).y / (_s); \
}

Definition at line 86 of file pprz_algebra.h.

Referenced by ins_update_gps(), and nav_advance_carrot().

#define VECT2_SMUL (   _vo,
  _vi,
  _s 
)
Value:
{ \
(_vo).x = (_vi).x * (_s); \
(_vo).y = (_vi).y * (_s); \
}

Definition at line 80 of file pprz_algebra.h.

Referenced by gh_update_ref_from_pos_sp(), gh_update_ref_from_speed_sp(), lla_of_utm_d(), nav_advance_carrot(), nav_approaching_from(), nav_route(), and nav_survey_zamboni_setup().

#define VECT2_STRIM (   _v,
  _min,
  _max 
)
Value:
{ \
(_v).x = (_v).x < _min ? _min : (_v).x > _max ? _max : (_v).x; \
(_v).y = (_v).y < _min ? _min : (_v).y > _max ? _max : (_v).y; \
}

Definition at line 92 of file pprz_algebra.h.

Referenced by guidance_h_traj_run(), and nav_advance_carrot().

#define VECT2_SUB (   _a,
  _b 
)
Value:
{ \
(_a).x -= (_b).x; \
(_a).y -= (_b).y; \
}

Definition at line 62 of file pprz_algebra.h.

Referenced by lla_of_utm_d().

#define VECT2_SUM (   _c,
  _a,
  _b 
)
Value:
{ \
(_c).x = (_a).x + (_b).x; \
(_c).y = (_a).y + (_b).y; \
}

Definition at line 68 of file pprz_algebra.h.

Referenced by gh_update_ref_from_pos_sp(), nav_advance_carrot(), nav_approaching_from(), nav_circle(), nav_route(), nav_survey_polygon_run(), and nav_survey_zamboni_setup().

#define VECT3_ABS (   _vo,
  _vi 
)
Value:
{ \
(_vo).x = ABS((_vi).x); \
(_vo).y = ABS((_vi).y); \
(_vo).z = ABS((_vi).z); \
}

Definition at line 227 of file pprz_algebra.h.

#define VECT3_ADD (   _a,
  _b 
)
Value:
{ \
(_a).x += (_b).x; \
(_a).y += (_b).y; \
(_a).z += (_b).z; \
}

Definition at line 136 of file pprz_algebra.h.

Referenced by ahrs_aligner_run(), ahrs_update_accel(), ecef_of_enu_point_d(), imu_krooz_event(), imu_periodic(), and on_gyro_event().

#define VECT3_ADD_SCALED (   _a,
  _b,
  _s 
)
Value:
{ \
(_a).x += ((_b).x * (_s)); \
(_a).y += ((_b).y * (_s)); \
(_a).z += ((_b).z * (_s)); \
}

Definition at line 157 of file pprz_algebra.h.

#define VECT3_ASSIGN_ABS (   _a,
  _x,
  _y,
  _z 
)
Value:
{ \
(_a).x = ABS(_x); \
(_a).y = ABS(_y); \
(_a).z = ABS(_z); \
}

Definition at line 122 of file pprz_algebra.h.

#define VECT3_BOUND_BOX (   _v,
  _v_min,
  _v_max 
)
Value:
{ \
if ((_v).x > (_v_max).x) (_v).x = (_v_max).x; else if ((_v).x < (_v_min).x) (_v).x = (_v_min).x; \
if ((_v).y > (_v_max).y) (_v).y = (_v_max).y; else if ((_v).y < (_v_min).y) (_v).y = (_v_min).z; \
if ((_v).z > (_v_max).y) (_v).z = (_v_max).z; else if ((_v).z < (_v_min).z) (_v).z = (_v_min).z; \
}
if(PrimarySpektrumState.SpektrumTimer)--PrimarySpektrumState.SpektrumTimer

Definition at line 220 of file pprz_algebra.h.

Referenced by vi_update_wp().

#define VECT3_BOUND_CUBE (   _v,
  _min,
  _max 
)
Value:
{ \
if ((_v).x > (_max)) (_v).x = (_max); else if ((_v).x < (_min)) (_v).x = (_min); \
if ((_v).y > (_max)) (_v).y = (_max); else if ((_v).y < (_min)) (_v).y = (_min); \
if ((_v).z > (_max)) (_v).z = (_max); else if ((_v).z < (_min)) (_v).z = (_min); \
}
if(PrimarySpektrumState.SpektrumTimer)--PrimarySpektrumState.SpektrumTimer

Definition at line 213 of file pprz_algebra.h.

#define VECT3_CROSS_PRODUCT (   _vo,
  _v1,
  _v2 
)
Value:
{ \
(_vo).x = (_v1).y*(_v2).z - (_v1).z*(_v2).y; \
(_vo).y = (_v1).z*(_v2).x - (_v1).x*(_v2).z; \
(_vo).z = (_v1).x*(_v2).y - (_v1).y*(_v2).x; \
}

Definition at line 233 of file pprz_algebra.h.

Referenced by quat_from_earth_cmd_f().

#define VECT3_DIFF (   _c,
  _a,
  _b 
)
Value:
{ \
(_c).x = (_a).x - (_b).x; \
(_c).y = (_a).y - (_b).y; \
(_c).z = (_a).z - (_b).z; \
}

Definition at line 171 of file pprz_algebra.h.

Referenced by ahrs_update_accel(), enu_of_ecef_point_d(), enu_of_ecef_point_f(), enu_of_ecef_point_i(), and update_state().

#define VECT3_DOT_PRODUCT (   _so,
  _v1,
  _v2 
)
Value:
{ \
(_so) = (_v1).x*(_v2).x + (_v1).y*(_v2).y + (_v1).z*(_v2).z; \
}

Definition at line 239 of file pprz_algebra.h.

#define VECT3_EW_DIV (   _vo,
  _va,
  _vb 
)
Value:
{ \
(_vo).x = (_va).x / (_vb).x; \
(_vo).y = (_va).y / (_vb).y; \
(_vo).z = (_va).z / (_vb).z; \
}

Definition at line 199 of file pprz_algebra.h.

#define VECT3_EW_MUL (   _vo,
  _va,
  _vb 
)
Value:
{ \
(_vo).x = (_va).x * (_vb).x; \
(_vo).y = (_va).y * (_vb).y; \
(_vo).z = (_va).z * (_vb).z; \
}

Definition at line 206 of file pprz_algebra.h.

#define VECT3_MUL (   _v1,
  _v2 
)
Value:
{ \
(_v1).x = (_v1).x * (_v2).x; \
(_v1).y = (_v1).y * (_v2).y; \
(_v1).z = (_v1).z * (_v2).z; \
}

Definition at line 115 of file pprz_algebra.h.

#define VECT3_RATES_CROSS_VECT3 (   _vo,
  _r1,
  _v2 
)
Value:
{ \
(_vo).x = (_r1).q*(_v2).z - (_r1).r*(_v2).y; \
(_vo).y = (_r1).r*(_v2).x - (_r1).p*(_v2).z; \
(_vo).z = (_r1).p*(_v2).y - (_r1).q*(_v2).x; \
}

Definition at line 243 of file pprz_algebra.h.

Referenced by ahrs_update_accel().

#define VECT3_SDIV (   _vo,
  _vi,
  _s 
)
Value:
{ \
(_vo).x = (_vi).x / (_s); \
(_vo).y = (_vi).y / (_s); \
(_vo).z = (_vi).z / (_s); \
}

Definition at line 185 of file pprz_algebra.h.

Referenced by ahrs_aligner_run(), ahrs_update_accel(), enu_of_ecef_pos_i(), imu_periodic(), navigation_update_wp_from_speed(), and on_gyro_event().

#define VECT3_SMUL (   _vo,
  _vi,
  _s 
)
Value:
{ \
(_vo).x = (_vi).x * (_s); \
(_vo).y = (_vi).y * (_s); \
(_vo).z = (_vi).z * (_s); \
}

Definition at line 178 of file pprz_algebra.h.

Referenced by ahrs_update_accel(), ecef_of_enu_pos_i(), gx3_packet_read_message(), imu_periodic(), and UM6_packet_read_message().

#define VECT3_STRIM (   _v,
  _min,
  _max 
)
Value:
{ \
(_v).x = (_v).x < _min ? _min : (_v).x > _max ? _max : (_v).x; \
(_v).y = (_v).y < _min ? _min : (_v).y > _max ? _max : (_v).y; \
(_v).z = (_v).z < _min ? _min : (_v).z > _max ? _max : (_v).z; \
}

Definition at line 192 of file pprz_algebra.h.

#define VECT3_SUB (   _a,
  _b 
)
Value:
{ \
(_a).x -= (_b).x; \
(_a).y -= (_b).y; \
(_a).z -= (_b).z; \
}

Definition at line 143 of file pprz_algebra.h.

#define VECT3_SUM (   _c,
  _a,
  _b 
)
Value:
{ \
(_c).x = (_a).x + (_b).x; \
(_c).y = (_a).y + (_b).y; \
(_c).z = (_a).z + (_b).z; \
}

Definition at line 150 of file pprz_algebra.h.

#define VECT3_SUM_SCALED (   _c,
  _a,
  _b,
  _s 
)
Value:
{ \
(_c).x = (_a).x + (_s)*(_b).x; \
(_c).y = (_a).y + (_s)*(_b).y; \
(_c).z = (_a).z + (_s)*(_b).z; \
}

Definition at line 164 of file pprz_algebra.h.

Referenced by ahrs_update_accel(), and float_rmat_reorthogonalize().