Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
Fixed Point Algebra
+ Collaboration diagram for Fixed Point Algebra:

Data Structures

struct  Uint8Vect3
 
struct  Int8Vect3
 
struct  Uint16Vect3
 
struct  Int16Vect3
 
struct  Int32Vect2
 
struct  Int32Vect3
 
struct  Int32Quat
 Rotation quaternion. More...
 
struct  Int64Quat
 
struct  Int16Eulers
 
struct  Int32Eulers
 euler angles More...
 
struct  Int32RMat
 rotation matrix More...
 
struct  Int32Mat33
 
struct  Int16Rates
 
struct  Int32Rates
 angular rates More...
 
struct  Int64Rates
 
struct  Int64Vect2
 
struct  Int64Vect3
 

Macros

#define INT32_POS_FRAC   8
 
#define INT32_POS_OF_CM   2.56
 
#define INT32_POS_OF_CM_NUM   64
 
#define INT32_POS_OF_CM_DEN   25
 
#define INT32_SPEED_FRAC   19
 
#define INT32_SPEED_OF_CM_S   5242.88
 
#define INT32_SPEED_OF_CM_S_NUM   41943
 
#define INT32_SPEED_OF_CM_S_DEN   8
 
#define INT32_ACCEL_FRAC   10
 
#define INT32_MAG_FRAC   11
 
#define INT32_PERCENTAGE_FRAC   10
 
#define INT32_QUAT_FRAC   15
 
#define INT32_ANGLE_FRAC   12
 
#define INT32_RATE_FRAC   12
 
#define INT32_ANGLE_PI_4   (int32_t)ANGLE_BFP_OF_REAL( 0.7853981633974483096156608458198757)
 
#define INT32_ANGLE_PI_2   (int32_t)ANGLE_BFP_OF_REAL( 1.5707963267948966192313216916397514)
 
#define INT32_ANGLE_PI   (int32_t)ANGLE_BFP_OF_REAL( 3.1415926535897932384626433832795029)
 
#define INT32_ANGLE_2_PI   (int32_t)ANGLE_BFP_OF_REAL(2.*3.1415926535897932384626433832795029)
 
#define INT32_RAD_OF_DEG(_deg)   (int32_t)(((int64_t)(_deg) * 14964008)/857374503)
 
#define INT32_DEG_OF_RAD(_rad)   (int32_t)(((int64_t)(_rad) * 857374503)/14964008)
 
#define INT32_ANGLE_NORMALIZE(_a)
 
#define INT32_COURSE_NORMALIZE(_a)
 
#define INT32_TRIG_FRAC   14
 
#define LBFP_OF_REAL(_vr, _frac)   ((_vr)*(1LL<<(_frac)))
 
#define BFP_OF_REAL(_vr, _frac)   ((_vr)*(1<<(_frac)))
 
#define FLOAT_OF_BFP(_vbfp, _frac)   ((float)(_vbfp)/(1<<(_frac)))
 
#define DOUBLE_OF_BFP(_vbfp, _frac)   ((double)(_vbfp)/(1<<(_frac)))
 
#define RATE_BFP_OF_REAL(_af)   BFP_OF_REAL((_af), INT32_RATE_FRAC)
 
#define RATE_FLOAT_OF_BFP(_ai)   FLOAT_OF_BFP((_ai), INT32_RATE_FRAC)
 
#define ANGLE_BFP_OF_REAL(_af)   BFP_OF_REAL((_af), INT32_ANGLE_FRAC)
 
#define ANGLE_FLOAT_OF_BFP(_ai)   FLOAT_OF_BFP((_ai), INT32_ANGLE_FRAC)
 
#define QUAT1_BFP_OF_REAL(_qf)   BFP_OF_REAL((_qf), INT32_QUAT_FRAC)
 
#define QUAT1_FLOAT_OF_BFP(_qi)   FLOAT_OF_BFP((_qi), INT32_QUAT_FRAC)
 
#define TRIG_BFP_OF_REAL(_tf)   BFP_OF_REAL((_tf), INT32_TRIG_FRAC)
 
#define TRIG_FLOAT_OF_BFP(_ti)   FLOAT_OF_BFP((_ti),INT32_TRIG_FRAC)
 
#define POS_BFP_OF_REAL(_af)   BFP_OF_REAL((_af), INT32_POS_FRAC)
 
#define POS_FLOAT_OF_BFP(_ai)   FLOAT_OF_BFP((_ai), INT32_POS_FRAC)
 
#define SPEED_BFP_OF_REAL(_af)   BFP_OF_REAL((_af), INT32_SPEED_FRAC)
 
#define SPEED_FLOAT_OF_BFP(_ai)   FLOAT_OF_BFP((_ai), INT32_SPEED_FRAC)
 
#define ACCEL_BFP_OF_REAL(_af)   BFP_OF_REAL((_af), INT32_ACCEL_FRAC)
 
#define ACCEL_FLOAT_OF_BFP(_ai)   FLOAT_OF_BFP((_ai), INT32_ACCEL_FRAC)
 
#define MAG_BFP_OF_REAL(_af)   BFP_OF_REAL((_af), INT32_MAG_FRAC)
 
#define MAG_FLOAT_OF_BFP(_ai)   FLOAT_OF_BFP((_ai), INT32_MAG_FRAC)
 
#define INT_MULT_RSHIFT(_a, _b, _r)   (((_a)*(_b))>>(_r))
 
#define INT32_SQRT(_out, _in)   WARNING("INT32_SQRT macro is deprecated, use the lower case function instead") { _out = int32_sqrt(_in); }
 
#define INT_VECT2_ZERO(_v)   VECT2_ASSIGN(_v, 0, 0)
 
#define INT32_VECT2_NORM(_v)   int32_sqrt(VECT2_NORM2(_v))
 
#define INT32_VECT2_NORMALIZE(_v, _frac)   WARNING("INT32_VECT2_NORMALIZE macro is deprecated, use the lower case function instead") int32_vect2_normalize(&(_v), _frac)
 
#define INT32_VECT2_RSHIFT(_o, _i, _r)
 
#define INT32_VECT2_LSHIFT(_o, _i, _l)
 
#define INT32_VECT2_SCALE_2(_a, _b, _num, _den)
 
#define INT_VECT3_ZERO(_v)   VECT3_ASSIGN(_v, 0, 0, 0)
 
#define INT32_VECT3_ZERO(_v)   VECT3_ASSIGN(_v, 0, 0, 0)
 
#define INT32_VECT3_SCALE_2(_a, _b, _num, _den)
 
#define INT32_VECT3_NORM(_v)   int32_sqrt(VECT3_NORM2(_v))
 
#define INT32_VECT3_RSHIFT(_o, _i, _r)
 
#define INT32_VECT3_LSHIFT(_o, _i, _l)
 
#define INT32_MAT33_ZERO(_m)
 
#define INT32_MAT33_DIAG(_m, _d00, _d11, _d22)
 
#define int32_rmat_of_eulers   int32_rmat_of_eulers_321
 Rotation matrix from Euler angles. More...
 
#define INT32_RMAT_COMP(_m_a2c, _m_a2b, _m_b2c)   WARNING("INT32_RMAT_COMP macro is deprecated, use the lower case function instead") int32_rmat_comp(&(_m_a2c), &(_m_a2b), &(_m_b2c))
 
#define INT32_RMAT_COMP_INV(_m_a2b, _m_a2c, _m_b2c)   WARNING("INT32_RMAT_COMP_INV macro is deprecated, use the lower case function instead") int32_rmat_comp_inv(&(_m_a2b), &(_m_a2c), &(_m_b2c))
 
#define INT32_RMAT_VMULT(_vb, _m_a2b, _va)   WARNING("INT32_RMAT_VMULT macro is deprecated, use the lower case function instead") int32_rmat_vmult(&(_vb), &(_m_a2b), &(_va))
 
#define INT32_RMAT_TRANSP_VMULT(_vb, _m_b2a, _va)   WARNING("INT32_RMAT_TRANSP_VMULT macro is deprecated, use the lower case function instead") int32_rmat_transp_vmult(&(_vb), &(_m_b2a), &(_va))
 
#define INT32_RMAT_RATEMULT(_rb, _m_a2b, _ra)   WARNING("INT32_RMAT_RATEMULT macro is deprecated, use the lower case function instead") int32_rmat_ratemult(&(_rb), &(_m_a2b), &(_ra))
 
#define INT32_RMAT_TRANSP_RATEMULT(_rb, _m_b2a, _ra)   WARNING("INT32_RMAT_TRANSP_RATEMULT macro is deprecated, use the lower case function instead") int32_rmat_ratemult(&(_rb), &(_m_b2a), &(_ra))
 
#define INT32_RMAT_OF_QUAT(_rm, _q)   WARNING("INT32_RMAT_OF_QUAT macro is deprecated, use the lower case function instead") int32_rmat_of_quat(&(_rm), &(_q))
 
#define INT32_RMAT_OF_EULERS(_rm, _e)   WARNING("INT32_RMAT_OF_EULERS macro is deprecated, use the lower case function instead") int32_rmat_of_eulers_321(&(_rm), &(_e))
 
#define INT32_RMAT_OF_EULERS_321(_rm, _e)   WARNING("INT32_RMAT_OF_EULERS_321 macro is deprecated, use the lower case function instead") int32_rmat_of_eulers_321(&(_rm), &(_e))
 
#define INT32_RMAT_OF_EULERS_312(_rm, _e)   WARNING("INT32_RMAT_OF_EULERS_312 macro is deprecated, use the lower case function instead") int32_rmat_of_eulers_312(&(_rm), &(_e))
 
#define INT32_QUAT_ZERO(_q)   WARNING("INT32_QUAT_ZERO macro is deprecated, use the lower case function instead") int32_quat_identity(&(_q))
 
#define INT32_QUAT_NORM(n, q)   WARNING("INT32_QUAT_NORM macro is deprecated, use the lower case function instead") { n = int32_quat_norm(&(q)); }
 
#define INT32_QUAT_WRAP_SHORTEST(q)   WARNING("INT32_QUAT_WRAP_SHORTEST macro is deprecated, use the lower case function instead") int32_quat_wrap_shortest(&(q))
 
#define INT32_QUAT_NORMALIZE(q)   WARNING("INT32_QUAT_NORMALIZE macro is deprecated, use the lower case function instead") int32_quat_normalize(&(q))
 
#define INT32_QUAT_COMP(_a2c, _a2b, _b2c)   WARNING("INT32_QUAT_COMP macro is deprecated, use the lower case function instead") int32_quat_comp(&(_a2c), &(_a2b), &(_b2c))
 
#define INT32_QUAT_COMP_INV(_a2b, _a2c, _b2c)   WARNING("INT32_QUAT_COMP_INV macro is deprecated, use the lower case function instead") int32_quat_comp_inv(&(_a2b), &(_a2c), &(_b2c))
 
#define INT32_QUAT_INV_COMP(_b2c, _a2b, _a2c)   WARNING("INT32_QUAT_INV_COMP macro is deprecated, use the lower case function instead") int32_quat_inv_comp(&(_b2c), &(_a2b), &(_a2c))
 
#define INT32_QUAT_COMP_NORM_SHORTEST(_a2c, _a2b, _b2c)   WARNING("INT32_QUAT_COMP_NORM_SHORTEST macro is deprecated, use the lower case function instead") int32_quat_comp_norm_shortest(&(_a2c), &(_a2b), &(_b2c))
 
#define INT32_QUAT_INV_COMP_NORM_SHORTEST(_b2c, _a2b, _a2c)   WARNING("INT32_QUAT_INV_COMP_NORM_SHORTEST macro is deprecated, use the lower case function instead") int32_quat_inv_comp_norm_shortest(&(_b2c), &(_a2b), &(_a2c))
 
#define INT32_QUAT_DERIVATIVE(_qd, _r, _q)   WARNING("INT32_QUAT_DERIVATIVE macro is deprecated, use the lower case function instead") int32_quat_derivative(&(_qd), &(_r), &(_q))
 
#define INT32_QUAT_INTEGRATE_FI(_q, _hr, _omega, _f)   WARNING("INT32_QUAT_INTEGRATE_FI macro is deprecated, use the lower case function instead") int32_quat_integrate_fi(&(_q), &(_hr), &(_omega), _f)
 
#define INT32_QUAT_VMULT(v_out, q, v_in)   WARNING("INT32_QUAT_VMULT macro is deprecated, use the lower case function instead") int32_quat_vmult(&(v_out), &(q), &(v_in))
 
#define INT32_QUAT_OF_EULERS(_q, _e)   WARNING("INT32_QUAT_OF_EULERS macro is deprecated, use the lower case function instead") int32_quat_of_eulers(&(_q), &(_e))
 
#define INT32_QUAT_OF_AXIS_ANGLE(_q, _uv, _an)   WARNING("INT32_QUAT_OF_AXIS_ANGLE macro is deprecated, use the lower case function instead") int32_quat_of_axis_angle(&(_q), &(_uv), _an)
 
#define INT32_QUAT_OF_RMAT(_q, _r)   WARNING("INT32_QUAT_OF_RMAT macro is deprecated, use the lower case function instead") int32_quat_of_rmat(&(_q), &(_r))
 
#define INT_EULERS_ZERO(_e)   EULERS_ASSIGN(_e, 0, 0, 0)
 
#define INT32_EULERS_OF_RMAT(_e, _rm)   WARNING("INT32_EULERS_OF_RMAT macro is deprecated, use the lower case function instead") int32_eulers_of_rmat(&(_e), &(_rm))
 
#define INT32_EULERS_OF_QUAT(_e, _q)   WARNING("INT32_EULERS_OF_QUAT macro is deprecated, use the lower case function instead") int32_eulers_of_quat(&(_e), &(_q))
 
#define INT32_EULERS_LSHIFT(_o, _i, _r)
 
#define INT32_EULERS_RSHIFT(_o, _i, _r)
 
#define INT_RATES_ZERO(_e)   RATES_ASSIGN(_e, 0, 0, 0)
 
#define INT_RATES_RSHIFT(_o, _i, _r)
 
#define INT_RATES_LSHIFT(_o, _i, _r)
 
#define int32_eulers_dot_of_rates   int32_eulers_dot_321_of_rates
 
#define INT32_RATES_OF_EULERS_DOT_321(_r, _e, _ed)   WARNING("INT32_RATES_OF_EULERS_DOT_321 macro is deprecated, use the lower case function instead") int32_rates_of_eulers_dot_321(&(_r), &(_e), &(_ed))
 
#define INT32_RATES_OF_EULERS_DOT(_r, _e, _ed)   WARNING("INT32_RATES_OF_EULERS_DOT macro is deprecated, use the lower case function instead") int32_rates_of_eulers_dot_321(&(_r), &(_e), &(_ed))
 
#define INT32_EULERS_DOT_321_OF_RATES(_ed, _e, _r)   WARNING("INT32_EULERS_DOT_321_OF_RATES macro is deprecated, use the lower case function instead") int32_eulers_dot_321_of_rates(&(_ed), &(_e), &(_r))
 
#define INT32_EULERS_DOT_OF_RATES(_ed, _e, _r)   WARNING("INT32_EULERS_DOT_OF_RATES macro is deprecated, use the lower case function instead") int32_eulers_dot_321_of_rates(&(_ed), &(_e), &(_r))
 

Functions

uint32_t int32_sqrt (uint32_t in)
 
uint32_t int32_gcd (uint32_t a, uint32_t b)
 
static uint32_t int32_vect2_norm2 (struct Int32Vect2 *v)
 return squared norm of 2D vector More...
 
static uint32_t int32_vect2_norm (struct Int32Vect2 *v)
 return norm of 2D vector More...
 
static void int32_vect2_normalize (struct Int32Vect2 *v, uint8_t frac)
 normalize 2D vector inplace More...
 
static void int32_rmat_identity (struct Int32RMat *rm)
 initialises a rotation matrix to identity More...
 
void int32_rmat_comp (struct Int32RMat *m_a2c, const struct Int32RMat *m_a2b, const struct Int32RMat *m_b2c)
 Composition (multiplication) of two rotation matrices. More...
 
void int32_rmat_comp_inv (struct Int32RMat *m_a2b, const struct Int32RMat *m_a2c, const struct Int32RMat *m_b2c)
 Composition (multiplication) of two rotation matrices. More...
 
void int32_rmat_vmult (struct Int32Vect3 *vb, struct Int32RMat *m_a2b, struct Int32Vect3 *va)
 rotate 3D vector by rotation matrix. More...
 
void int32_rmat_transp_vmult (struct Int32Vect3 *vb, struct Int32RMat *m_b2a, struct Int32Vect3 *va)
 rotate 3D vector by transposed rotation matrix. More...
 
void int32_rmat_ratemult (struct Int32Rates *rb, struct Int32RMat *m_a2b, struct Int32Rates *ra)
 rotate anglular rates by rotation matrix. More...
 
void int32_rmat_transp_ratemult (struct Int32Rates *rb, struct Int32RMat *m_b2a, struct Int32Rates *ra)
 rotate anglular rates by transposed rotation matrix. More...
 
void int32_rmat_of_quat (struct Int32RMat *rm, struct Int32Quat *q)
 Convert unit quaternion to rotation matrix. More...
 
void int32_rmat_of_eulers_321 (struct Int32RMat *rm, struct Int32Eulers *e)
 Rotation matrix from 321 Euler angles (int). More...
 
void int32_rmat_of_eulers_312 (struct Int32RMat *rm, struct Int32Eulers *e)
 Rotation matrix from 312 Euler angles. More...
 
static void int32_quat_identity (struct Int32Quat *q)
 initialises a quaternion to identity More...
 
static uint32_t int32_quat_norm (struct Int32Quat *q)
 Norm of a quaternion. More...
 
static void int32_quat_wrap_shortest (struct Int32Quat *q)
 
static void int32_quat_normalize (struct Int32Quat *q)
 normalize a quaternion inplace More...
 
void int32_quat_comp (struct Int32Quat *a2c, struct Int32Quat *a2b, struct Int32Quat *b2c)
 Composition (multiplication) of two quaternions. More...
 
void int32_quat_comp_inv (struct Int32Quat *a2b, struct Int32Quat *a2c, struct Int32Quat *b2c)
 Composition (multiplication) of two quaternions. More...
 
void int32_quat_inv_comp (struct Int32Quat *b2c, struct Int32Quat *a2b, struct Int32Quat *a2c)
 Composition (multiplication) of two quaternions. More...
 
void int32_quat_comp_norm_shortest (struct Int32Quat *a2c, struct Int32Quat *a2b, struct Int32Quat *b2c)
 Composition (multiplication) of two quaternions with normalization. More...
 
void int32_quat_comp_inv_norm_shortest (struct Int32Quat *a2b, struct Int32Quat *a2c, struct Int32Quat *b2c)
 Composition (multiplication) of two quaternions with normalization. More...
 
void int32_quat_inv_comp_norm_shortest (struct Int32Quat *b2c, struct Int32Quat *a2b, struct Int32Quat *a2c)
 Composition (multiplication) of two quaternions with normalization. More...
 
void int32_quat_derivative (struct Int32Quat *qd, const struct Int32Rates *r, struct Int32Quat *q)
 Quaternion derivative from rotational velocity. More...
 
void int32_quat_integrate_fi (struct Int32Quat *q, struct Int64Quat *hr, struct Int32Rates *omega, int freq)
 in place quaternion first order integration with constant rotational velocity. More...
 
void int32_quat_vmult (struct Int32Vect3 *v_out, struct Int32Quat *q, struct Int32Vect3 *v_in)
 rotate 3D vector by quaternion. More...
 
void int32_quat_of_eulers (struct Int32Quat *q, struct Int32Eulers *e)
 Quaternion from Euler angles. More...
 
void int32_quat_of_axis_angle (struct Int32Quat *q, struct Int32Vect3 *uv, int32_t angle)
 Quaternion from unit vector and angle. More...
 
void int32_quat_of_rmat (struct Int32Quat *q, struct Int32RMat *r)
 Quaternion from rotation matrix. More...
 
void int32_eulers_of_rmat (struct Int32Eulers *e, struct Int32RMat *rm)
 
void int32_eulers_of_quat (struct Int32Eulers *e, struct Int32Quat *q)
 
void int32_rates_of_eulers_dot_321 (struct Int32Rates *r, struct Int32Eulers *e, struct Int32Eulers *ed)
 
void int32_eulers_dot_321_of_rates (struct Int32Eulers *ed, struct Int32Eulers *e, struct Int32Rates *r)
 
static void int32_vect_zero (int32_t *a, const int n)
 a = 0 More...
 
static void int16_vect_zero (int16_t *a, const int n)
 a = 0 More...
 
static void int32_vect_set_value (int32_t *a, const int32_t v, const int n)
 a = v * ones(n,1) More...
 
static void int32_vect_copy (int32_t *a, const int32_t *b, const int n)
 a = b More...
 
static void int32_vect_sum (int32_t *o, const int32_t *a, const int32_t *b, const int n)
 o = a + b More...
 
static void int32_vect_diff (int32_t *o, const int32_t *a, const int32_t *b, const int n)
 o = a - b More...
 
static void int32_vect_mul (int32_t *o, const int32_t *a, const int32_t *b, const int n)
 o = a * b (element wise) More...
 
static void int32_vect_add (int32_t *a, const int32_t *b, const int n)
 a += b More...
 
static void int32_vect_sub (int32_t *a, const int32_t *b, const int n)
 a -= b More...
 
static void int32_vect_smul (int32_t *o, const int32_t *a, const int32_t s, const int n)
 o = a * s More...
 
static bool int32_vect_find (const int32_t *a, const int32_t s, int *loc, const int n)
 Find value s in array a. More...
 
static void int32_mat_mul (int32_t **o, int32_t **a, int32_t **b, int m, int n, int l)
 o = a * b More...
 

Detailed Description


Data Structure Documentation

◆ Uint8Vect3

struct Uint8Vect3

Definition at line 44 of file pprz_algebra_int.h.

Data Fields
uint8_t x
uint8_t y
uint8_t z

◆ Int8Vect3

struct Int8Vect3

Definition at line 50 of file pprz_algebra_int.h.

Data Fields
int8_t x
int8_t y
int8_t z

◆ Uint16Vect3

struct Uint16Vect3

Definition at line 56 of file pprz_algebra_int.h.

Data Fields
uint16_t x
uint16_t y
uint16_t z

◆ Int16Vect3

struct Int16Vect3

Definition at line 62 of file pprz_algebra_int.h.

Data Fields
int16_t x
int16_t y
int16_t z

◆ Int32Vect2

struct Int32Vect2

Definition at line 83 of file pprz_algebra_int.h.

Data Fields
int32_t x
int32_t y

◆ Int32Vect3

struct Int32Vect3

Definition at line 88 of file pprz_algebra_int.h.

Data Fields
int32_t x
int32_t y
int32_t z

◆ Int32Quat

struct Int32Quat

Rotation quaternion.

Units: BFP with INT32_QUAT_FRAC

Definition at line 99 of file pprz_algebra_int.h.

Data Fields
int32_t qi
int32_t qx
int32_t qy
int32_t qz

◆ Int64Quat

struct Int64Quat

Definition at line 107 of file pprz_algebra_int.h.

Data Fields
int64_t qi
int64_t qx
int64_t qy
int64_t qz

◆ Int16Eulers

struct Int16Eulers

Definition at line 137 of file pprz_algebra_int.h.

Data Fields
int16_t phi
int16_t psi
int16_t theta

◆ Int32Eulers

struct Int32Eulers

euler angles

Units: rad in BFP with INT32_ANGLE_FRAC

Definition at line 146 of file pprz_algebra_int.h.

Data Fields
int32_t phi in rad with INT32_ANGLE_FRAC
int32_t psi in rad with INT32_ANGLE_FRAC
int32_t theta in rad with INT32_ANGLE_FRAC

◆ Int32RMat

struct Int32RMat

rotation matrix

Units: rad in BFP with INT32_TRIG_FRAC

Definition at line 159 of file pprz_algebra_int.h.

Data Fields
int32_t m[3 *3]

◆ Int32Mat33

struct Int32Mat33

Definition at line 164 of file pprz_algebra_int.h.

Data Fields
int32_t m[3 *3]

◆ Int16Rates

struct Int16Rates

Definition at line 169 of file pprz_algebra_int.h.

Data Fields
int16_t p
int16_t q
int16_t r

◆ Int32Rates

struct Int32Rates

angular rates

Units: rad/s in BFP with INT32_RATE_FRAC

Definition at line 179 of file pprz_algebra_int.h.

Data Fields
int32_t p in rad/s with INT32_RATE_FRAC
int32_t q in rad/s with INT32_RATE_FRAC
int32_t r in rad/s with INT32_RATE_FRAC

◆ Int64Rates

struct Int64Rates

Definition at line 185 of file pprz_algebra_int.h.

Data Fields
int64_t p
int64_t q
int64_t r

◆ Int64Vect2

struct Int64Vect2

Definition at line 192 of file pprz_algebra_int.h.

Data Fields
int64_t x
int64_t y

◆ Int64Vect3

struct Int64Vect3

Definition at line 197 of file pprz_algebra_int.h.

Data Fields
int64_t x
int64_t y
int64_t z

Macro Definition Documentation

◆ ACCEL_BFP_OF_REAL

#define ACCEL_BFP_OF_REAL (   _af)    BFP_OF_REAL((_af), INT32_ACCEL_FRAC)

Definition at line 221 of file pprz_algebra_int.h.

◆ ACCEL_FLOAT_OF_BFP

#define ACCEL_FLOAT_OF_BFP (   _ai)    FLOAT_OF_BFP((_ai), INT32_ACCEL_FRAC)

Definition at line 222 of file pprz_algebra_int.h.

◆ ANGLE_BFP_OF_REAL

#define ANGLE_BFP_OF_REAL (   _af)    BFP_OF_REAL((_af), INT32_ANGLE_FRAC)

Definition at line 211 of file pprz_algebra_int.h.

◆ ANGLE_FLOAT_OF_BFP

#define ANGLE_FLOAT_OF_BFP (   _ai)    FLOAT_OF_BFP((_ai), INT32_ANGLE_FRAC)

Definition at line 212 of file pprz_algebra_int.h.

◆ BFP_OF_REAL

#define BFP_OF_REAL (   _vr,
  _frac 
)    ((_vr)*(1<<(_frac)))

Definition at line 206 of file pprz_algebra_int.h.

◆ DOUBLE_OF_BFP

#define DOUBLE_OF_BFP (   _vbfp,
  _frac 
)    ((double)(_vbfp)/(1<<(_frac)))

Definition at line 208 of file pprz_algebra_int.h.

◆ FLOAT_OF_BFP

#define FLOAT_OF_BFP (   _vbfp,
  _frac 
)    ((float)(_vbfp)/(1<<(_frac)))

Definition at line 207 of file pprz_algebra_int.h.

◆ INT32_ACCEL_FRAC

#define INT32_ACCEL_FRAC   10

Definition at line 78 of file pprz_algebra_int.h.

◆ INT32_ANGLE_2_PI

#define INT32_ANGLE_2_PI   (int32_t)ANGLE_BFP_OF_REAL(2.*3.1415926535897932384626433832795029)

Definition at line 121 of file pprz_algebra_int.h.

◆ INT32_ANGLE_FRAC

#define INT32_ANGLE_FRAC   12

Definition at line 116 of file pprz_algebra_int.h.

◆ INT32_ANGLE_NORMALIZE

#define INT32_ANGLE_NORMALIZE (   _a)
Value:
{ \
while ((_a) > INT32_ANGLE_PI) (_a) -= INT32_ANGLE_2_PI; \
while ((_a) < -INT32_ANGLE_PI) (_a) += INT32_ANGLE_2_PI; \
}
#define INT32_ANGLE_2_PI
#define INT32_ANGLE_PI

Definition at line 126 of file pprz_algebra_int.h.

◆ INT32_ANGLE_PI

#define INT32_ANGLE_PI   (int32_t)ANGLE_BFP_OF_REAL( 3.1415926535897932384626433832795029)

Definition at line 120 of file pprz_algebra_int.h.

◆ INT32_ANGLE_PI_2

#define INT32_ANGLE_PI_2   (int32_t)ANGLE_BFP_OF_REAL( 1.5707963267948966192313216916397514)

Definition at line 119 of file pprz_algebra_int.h.

◆ INT32_ANGLE_PI_4

#define INT32_ANGLE_PI_4   (int32_t)ANGLE_BFP_OF_REAL( 0.7853981633974483096156608458198757)

Definition at line 118 of file pprz_algebra_int.h.

◆ INT32_COURSE_NORMALIZE

#define INT32_COURSE_NORMALIZE (   _a)
Value:
{ \
while ((_a) < 0) (_a) += INT32_ANGLE_2_PI; \
while ((_a) >= INT32_ANGLE_2_PI) (_a) -= INT32_ANGLE_2_PI; \
}

Definition at line 131 of file pprz_algebra_int.h.

◆ INT32_DEG_OF_RAD

#define INT32_DEG_OF_RAD (   _rad)    (int32_t)(((int64_t)(_rad) * 857374503)/14964008)

Definition at line 124 of file pprz_algebra_int.h.

◆ INT32_EULERS_DOT_321_OF_RATES

#define INT32_EULERS_DOT_321_OF_RATES (   _ed,
  _e,
  _r 
)    WARNING("INT32_EULERS_DOT_321_OF_RATES macro is deprecated, use the lower case function instead") int32_eulers_dot_321_of_rates(&(_ed), &(_e), &(_r))

Definition at line 599 of file pprz_algebra_int.h.

◆ int32_eulers_dot_of_rates

#define int32_eulers_dot_of_rates   int32_eulers_dot_321_of_rates

Definition at line 594 of file pprz_algebra_int.h.

◆ INT32_EULERS_DOT_OF_RATES

#define INT32_EULERS_DOT_OF_RATES (   _ed,
  _e,
  _r 
)    WARNING("INT32_EULERS_DOT_OF_RATES macro is deprecated, use the lower case function instead") int32_eulers_dot_321_of_rates(&(_ed), &(_e), &(_r))

Definition at line 600 of file pprz_algebra_int.h.

◆ INT32_EULERS_LSHIFT

#define INT32_EULERS_LSHIFT (   _o,
  _i,
  _r 
)
Value:
{ \
(_o).phi = ((_i).phi << (_r)); \
(_o).theta = ((_i).theta << (_r)); \
(_o).psi = ((_i).psi << (_r)); \
}

Definition at line 559 of file pprz_algebra_int.h.

◆ INT32_EULERS_OF_QUAT

#define INT32_EULERS_OF_QUAT (   _e,
  _q 
)    WARNING("INT32_EULERS_OF_QUAT macro is deprecated, use the lower case function instead") int32_eulers_of_quat(&(_e), &(_q))

Definition at line 557 of file pprz_algebra_int.h.

◆ INT32_EULERS_OF_RMAT

#define INT32_EULERS_OF_RMAT (   _e,
  _rm 
)    WARNING("INT32_EULERS_OF_RMAT macro is deprecated, use the lower case function instead") int32_eulers_of_rmat(&(_e), &(_rm))

Definition at line 556 of file pprz_algebra_int.h.

◆ INT32_EULERS_RSHIFT

#define INT32_EULERS_RSHIFT (   _o,
  _i,
  _r 
)
Value:
{ \
(_o).phi = ((_i).phi >> (_r)); \
(_o).theta = ((_i).theta >> (_r)); \
(_o).psi = ((_i).psi >> (_r)); \
}

Definition at line 565 of file pprz_algebra_int.h.

◆ INT32_MAG_FRAC

#define INT32_MAG_FRAC   11

Definition at line 79 of file pprz_algebra_int.h.

◆ INT32_MAT33_DIAG

#define INT32_MAT33_DIAG (   _m,
  _d00,
  _d11,
  _d22 
)
Value:
{ \
MAT33_ELMT((_m), 0, 0) = (_d00); \
MAT33_ELMT((_m), 0, 1) = 0; \
MAT33_ELMT((_m), 0, 2) = 0; \
MAT33_ELMT((_m), 1, 0) = 0; \
MAT33_ELMT((_m), 1, 1) = (_d11); \
MAT33_ELMT((_m), 1, 2) = 0; \
MAT33_ELMT((_m), 2, 0) = 0; \
MAT33_ELMT((_m), 2, 1) = 0; \
MAT33_ELMT((_m), 2, 2) = (_d22); \
}

Definition at line 328 of file pprz_algebra_int.h.

◆ INT32_MAT33_ZERO

#define INT32_MAT33_ZERO (   _m)
Value:
{ \
MAT33_ELMT((_m), 0, 0) = 0; \
MAT33_ELMT((_m), 0, 1) = 0; \
MAT33_ELMT((_m), 0, 2) = 0; \
MAT33_ELMT((_m), 1, 0) = 0; \
MAT33_ELMT((_m), 1, 1) = 0; \
MAT33_ELMT((_m), 1, 2) = 0; \
MAT33_ELMT((_m), 2, 0) = 0; \
MAT33_ELMT((_m), 2, 1) = 0; \
MAT33_ELMT((_m), 2, 2) = 0; \
}

Definition at line 316 of file pprz_algebra_int.h.

◆ INT32_PERCENTAGE_FRAC

#define INT32_PERCENTAGE_FRAC   10

Definition at line 81 of file pprz_algebra_int.h.

◆ INT32_POS_FRAC

#define INT32_POS_FRAC   8

Definition at line 68 of file pprz_algebra_int.h.

◆ INT32_POS_OF_CM

#define INT32_POS_OF_CM   2.56

Definition at line 69 of file pprz_algebra_int.h.

◆ INT32_POS_OF_CM_DEN

#define INT32_POS_OF_CM_DEN   25

Definition at line 71 of file pprz_algebra_int.h.

◆ INT32_POS_OF_CM_NUM

#define INT32_POS_OF_CM_NUM   64

Definition at line 70 of file pprz_algebra_int.h.

◆ INT32_QUAT_COMP

#define INT32_QUAT_COMP (   _a2c,
  _a2b,
  _b2c 
)    WARNING("INT32_QUAT_COMP macro is deprecated, use the lower case function instead") int32_quat_comp(&(_a2c), &(_a2b), &(_b2c))

Definition at line 531 of file pprz_algebra_int.h.

◆ INT32_QUAT_COMP_INV

#define INT32_QUAT_COMP_INV (   _a2b,
  _a2c,
  _b2c 
)    WARNING("INT32_QUAT_COMP_INV macro is deprecated, use the lower case function instead") int32_quat_comp_inv(&(_a2b), &(_a2c), &(_b2c))

Definition at line 532 of file pprz_algebra_int.h.

◆ INT32_QUAT_COMP_NORM_SHORTEST

#define INT32_QUAT_COMP_NORM_SHORTEST (   _a2c,
  _a2b,
  _b2c 
)    WARNING("INT32_QUAT_COMP_NORM_SHORTEST macro is deprecated, use the lower case function instead") int32_quat_comp_norm_shortest(&(_a2c), &(_a2b), &(_b2c))

Definition at line 534 of file pprz_algebra_int.h.

◆ INT32_QUAT_DERIVATIVE

#define INT32_QUAT_DERIVATIVE (   _qd,
  _r,
  _q 
)    WARNING("INT32_QUAT_DERIVATIVE macro is deprecated, use the lower case function instead") int32_quat_derivative(&(_qd), &(_r), &(_q))

Definition at line 536 of file pprz_algebra_int.h.

◆ INT32_QUAT_FRAC

#define INT32_QUAT_FRAC   15

Definition at line 95 of file pprz_algebra_int.h.

◆ INT32_QUAT_INTEGRATE_FI

#define INT32_QUAT_INTEGRATE_FI (   _q,
  _hr,
  _omega,
  _f 
)    WARNING("INT32_QUAT_INTEGRATE_FI macro is deprecated, use the lower case function instead") int32_quat_integrate_fi(&(_q), &(_hr), &(_omega), _f)

Definition at line 537 of file pprz_algebra_int.h.

◆ INT32_QUAT_INV_COMP

#define INT32_QUAT_INV_COMP (   _b2c,
  _a2b,
  _a2c 
)    WARNING("INT32_QUAT_INV_COMP macro is deprecated, use the lower case function instead") int32_quat_inv_comp(&(_b2c), &(_a2b), &(_a2c))

Definition at line 533 of file pprz_algebra_int.h.

◆ INT32_QUAT_INV_COMP_NORM_SHORTEST

#define INT32_QUAT_INV_COMP_NORM_SHORTEST (   _b2c,
  _a2b,
  _a2c 
)    WARNING("INT32_QUAT_INV_COMP_NORM_SHORTEST macro is deprecated, use the lower case function instead") int32_quat_inv_comp_norm_shortest(&(_b2c), &(_a2b), &(_a2c))

Definition at line 535 of file pprz_algebra_int.h.

◆ INT32_QUAT_NORM

#define INT32_QUAT_NORM (   n,
 
)    WARNING("INT32_QUAT_NORM macro is deprecated, use the lower case function instead") { n = int32_quat_norm(&(q)); }

Definition at line 528 of file pprz_algebra_int.h.

◆ INT32_QUAT_NORMALIZE

#define INT32_QUAT_NORMALIZE (   q)    WARNING("INT32_QUAT_NORMALIZE macro is deprecated, use the lower case function instead") int32_quat_normalize(&(q))

Definition at line 530 of file pprz_algebra_int.h.

◆ INT32_QUAT_OF_AXIS_ANGLE

#define INT32_QUAT_OF_AXIS_ANGLE (   _q,
  _uv,
  _an 
)    WARNING("INT32_QUAT_OF_AXIS_ANGLE macro is deprecated, use the lower case function instead") int32_quat_of_axis_angle(&(_q), &(_uv), _an)

Definition at line 540 of file pprz_algebra_int.h.

◆ INT32_QUAT_OF_EULERS

#define INT32_QUAT_OF_EULERS (   _q,
  _e 
)    WARNING("INT32_QUAT_OF_EULERS macro is deprecated, use the lower case function instead") int32_quat_of_eulers(&(_q), &(_e))

Definition at line 539 of file pprz_algebra_int.h.

◆ INT32_QUAT_OF_RMAT

#define INT32_QUAT_OF_RMAT (   _q,
  _r 
)    WARNING("INT32_QUAT_OF_RMAT macro is deprecated, use the lower case function instead") int32_quat_of_rmat(&(_q), &(_r))

Definition at line 541 of file pprz_algebra_int.h.

◆ INT32_QUAT_VMULT

#define INT32_QUAT_VMULT (   v_out,
  q,
  v_in 
)    WARNING("INT32_QUAT_VMULT macro is deprecated, use the lower case function instead") int32_quat_vmult(&(v_out), &(q), &(v_in))

Definition at line 538 of file pprz_algebra_int.h.

◆ INT32_QUAT_WRAP_SHORTEST

#define INT32_QUAT_WRAP_SHORTEST (   q)    WARNING("INT32_QUAT_WRAP_SHORTEST macro is deprecated, use the lower case function instead") int32_quat_wrap_shortest(&(q))

Definition at line 529 of file pprz_algebra_int.h.

◆ INT32_QUAT_ZERO

#define INT32_QUAT_ZERO (   _q)    WARNING("INT32_QUAT_ZERO macro is deprecated, use the lower case function instead") int32_quat_identity(&(_q))

Definition at line 527 of file pprz_algebra_int.h.

◆ INT32_RAD_OF_DEG

#define INT32_RAD_OF_DEG (   _deg)    (int32_t)(((int64_t)(_deg) * 14964008)/857374503)

Definition at line 123 of file pprz_algebra_int.h.

◆ INT32_RATE_FRAC

#define INT32_RATE_FRAC   12

Definition at line 117 of file pprz_algebra_int.h.

◆ INT32_RATES_OF_EULERS_DOT

#define INT32_RATES_OF_EULERS_DOT (   _r,
  _e,
  _ed 
)    WARNING("INT32_RATES_OF_EULERS_DOT macro is deprecated, use the lower case function instead") int32_rates_of_eulers_dot_321(&(_r), &(_e), &(_ed))

Definition at line 598 of file pprz_algebra_int.h.

◆ INT32_RATES_OF_EULERS_DOT_321

#define INT32_RATES_OF_EULERS_DOT_321 (   _r,
  _e,
  _ed 
)    WARNING("INT32_RATES_OF_EULERS_DOT_321 macro is deprecated, use the lower case function instead") int32_rates_of_eulers_dot_321(&(_r), &(_e), &(_ed))

Definition at line 597 of file pprz_algebra_int.h.

◆ INT32_RMAT_COMP

#define INT32_RMAT_COMP (   _m_a2c,
  _m_a2b,
  _m_b2c 
)    WARNING("INT32_RMAT_COMP macro is deprecated, use the lower case function instead") int32_rmat_comp(&(_m_a2c), &(_m_a2b), &(_m_b2c))

Definition at line 412 of file pprz_algebra_int.h.

◆ INT32_RMAT_COMP_INV

#define INT32_RMAT_COMP_INV (   _m_a2b,
  _m_a2c,
  _m_b2c 
)    WARNING("INT32_RMAT_COMP_INV macro is deprecated, use the lower case function instead") int32_rmat_comp_inv(&(_m_a2b), &(_m_a2c), &(_m_b2c))

Definition at line 413 of file pprz_algebra_int.h.

◆ int32_rmat_of_eulers

#define int32_rmat_of_eulers   int32_rmat_of_eulers_321

Rotation matrix from Euler angles.

Definition at line 409 of file pprz_algebra_int.h.

◆ INT32_RMAT_OF_EULERS

#define INT32_RMAT_OF_EULERS (   _rm,
  _e 
)    WARNING("INT32_RMAT_OF_EULERS macro is deprecated, use the lower case function instead") int32_rmat_of_eulers_321(&(_rm), &(_e))

Definition at line 420 of file pprz_algebra_int.h.

◆ INT32_RMAT_OF_EULERS_312

#define INT32_RMAT_OF_EULERS_312 (   _rm,
  _e 
)    WARNING("INT32_RMAT_OF_EULERS_312 macro is deprecated, use the lower case function instead") int32_rmat_of_eulers_312(&(_rm), &(_e))

Definition at line 422 of file pprz_algebra_int.h.

◆ INT32_RMAT_OF_EULERS_321

#define INT32_RMAT_OF_EULERS_321 (   _rm,
  _e 
)    WARNING("INT32_RMAT_OF_EULERS_321 macro is deprecated, use the lower case function instead") int32_rmat_of_eulers_321(&(_rm), &(_e))

Definition at line 421 of file pprz_algebra_int.h.

◆ INT32_RMAT_OF_QUAT

#define INT32_RMAT_OF_QUAT (   _rm,
  _q 
)    WARNING("INT32_RMAT_OF_QUAT macro is deprecated, use the lower case function instead") int32_rmat_of_quat(&(_rm), &(_q))

Definition at line 419 of file pprz_algebra_int.h.

◆ INT32_RMAT_RATEMULT

#define INT32_RMAT_RATEMULT (   _rb,
  _m_a2b,
  _ra 
)    WARNING("INT32_RMAT_RATEMULT macro is deprecated, use the lower case function instead") int32_rmat_ratemult(&(_rb), &(_m_a2b), &(_ra))

Definition at line 416 of file pprz_algebra_int.h.

◆ INT32_RMAT_TRANSP_RATEMULT

#define INT32_RMAT_TRANSP_RATEMULT (   _rb,
  _m_b2a,
  _ra 
)    WARNING("INT32_RMAT_TRANSP_RATEMULT macro is deprecated, use the lower case function instead") int32_rmat_ratemult(&(_rb), &(_m_b2a), &(_ra))

Definition at line 417 of file pprz_algebra_int.h.

◆ INT32_RMAT_TRANSP_VMULT

#define INT32_RMAT_TRANSP_VMULT (   _vb,
  _m_b2a,
  _va 
)    WARNING("INT32_RMAT_TRANSP_VMULT macro is deprecated, use the lower case function instead") int32_rmat_transp_vmult(&(_vb), &(_m_b2a), &(_va))

Definition at line 415 of file pprz_algebra_int.h.

◆ INT32_RMAT_VMULT

#define INT32_RMAT_VMULT (   _vb,
  _m_a2b,
  _va 
)    WARNING("INT32_RMAT_VMULT macro is deprecated, use the lower case function instead") int32_rmat_vmult(&(_vb), &(_m_a2b), &(_va))

Definition at line 414 of file pprz_algebra_int.h.

◆ INT32_SPEED_FRAC

#define INT32_SPEED_FRAC   19

Definition at line 73 of file pprz_algebra_int.h.

◆ INT32_SPEED_OF_CM_S

#define INT32_SPEED_OF_CM_S   5242.88

Definition at line 74 of file pprz_algebra_int.h.

◆ INT32_SPEED_OF_CM_S_DEN

#define INT32_SPEED_OF_CM_S_DEN   8

Definition at line 76 of file pprz_algebra_int.h.

◆ INT32_SPEED_OF_CM_S_NUM

#define INT32_SPEED_OF_CM_S_NUM   41943

Definition at line 75 of file pprz_algebra_int.h.

◆ INT32_SQRT

#define INT32_SQRT (   _out,
  _in 
)    WARNING("INT32_SQRT macro is deprecated, use the lower case function instead") { _out = int32_sqrt(_in); }

Definition at line 231 of file pprz_algebra_int.h.

◆ INT32_TRIG_FRAC

#define INT32_TRIG_FRAC   14

Definition at line 154 of file pprz_algebra_int.h.

◆ INT32_VECT2_LSHIFT

#define INT32_VECT2_LSHIFT (   _o,
  _i,
  _l 
)
Value:
{ \
(_o).x = ((_i).x << (_l)); \
(_o).y = ((_i).y << (_l)); \
}

Definition at line 274 of file pprz_algebra_int.h.

◆ INT32_VECT2_NORM

#define INT32_VECT2_NORM (   _v)    int32_sqrt(VECT2_NORM2(_v))

Definition at line 241 of file pprz_algebra_int.h.

◆ INT32_VECT2_NORMALIZE

#define INT32_VECT2_NORMALIZE (   _v,
  _frac 
)    WARNING("INT32_VECT2_NORMALIZE macro is deprecated, use the lower case function instead") int32_vect2_normalize(&(_v), _frac)

Definition at line 266 of file pprz_algebra_int.h.

◆ INT32_VECT2_RSHIFT

#define INT32_VECT2_RSHIFT (   _o,
  _i,
  _r 
)
Value:
{ \
(_o).x = ((_i).x >> (_r)); \
(_o).y = ((_i).y >> (_r)); \
}

Definition at line 269 of file pprz_algebra_int.h.

◆ INT32_VECT2_SCALE_2

#define INT32_VECT2_SCALE_2 (   _a,
  _b,
  _num,
  _den 
)
Value:
{ \
(_a).x = ((_b).x * (_num)) / (_den); \
(_a).y = ((_b).y * (_num)) / (_den); \
}

Definition at line 279 of file pprz_algebra_int.h.

◆ INT32_VECT3_LSHIFT

#define INT32_VECT3_LSHIFT (   _o,
  _i,
  _l 
)
Value:
{ \
(_o).x = ((_i).x << (_l)); \
(_o).y = ((_i).y << (_l)); \
(_o).z = ((_i).z << (_l)); \
}

Definition at line 305 of file pprz_algebra_int.h.

◆ INT32_VECT3_NORM

#define INT32_VECT3_NORM (   _v)    int32_sqrt(VECT3_NORM2(_v))

Definition at line 297 of file pprz_algebra_int.h.

◆ INT32_VECT3_RSHIFT

#define INT32_VECT3_RSHIFT (   _o,
  _i,
  _r 
)
Value:
{ \
(_o).x = ((_i).x >> (_r)); \
(_o).y = ((_i).y >> (_r)); \
(_o).z = ((_i).z >> (_r)); \
}

Definition at line 299 of file pprz_algebra_int.h.

◆ INT32_VECT3_SCALE_2

#define INT32_VECT3_SCALE_2 (   _a,
  _b,
  _num,
  _den 
)
Value:
{ \
(_a).x = ((_b).x * (_num)) / (_den); \
(_a).y = ((_b).y * (_num)) / (_den); \
(_a).z = ((_b).z * (_num)) / (_den); \
}

Definition at line 291 of file pprz_algebra_int.h.

◆ INT32_VECT3_ZERO

#define INT32_VECT3_ZERO (   _v)    VECT3_ASSIGN(_v, 0, 0, 0)

Definition at line 289 of file pprz_algebra_int.h.

◆ INT_EULERS_ZERO

#define INT_EULERS_ZERO (   _e)    EULERS_ASSIGN(_e, 0, 0, 0)

Definition at line 550 of file pprz_algebra_int.h.

◆ INT_MULT_RSHIFT

#define INT_MULT_RSHIFT (   _a,
  _b,
  _r 
)    (((_a)*(_b))>>(_r))

Definition at line 226 of file pprz_algebra_int.h.

◆ INT_RATES_LSHIFT

#define INT_RATES_LSHIFT (   _o,
  _i,
  _r 
)
Value:
{ \
(_o).p = ((_i).p << (_r)); \
(_o).q = ((_i).q << (_r)); \
(_o).r = ((_i).r << (_r)); \
}
static float p[2][2]

Definition at line 584 of file pprz_algebra_int.h.

◆ INT_RATES_RSHIFT

#define INT_RATES_RSHIFT (   _o,
  _i,
  _r 
)
Value:
{ \
(_o).p = ((_i).p >> (_r)); \
(_o).q = ((_i).q >> (_r)); \
(_o).r = ((_i).r >> (_r)); \
}

Definition at line 578 of file pprz_algebra_int.h.

◆ INT_RATES_ZERO

#define INT_RATES_ZERO (   _e)    RATES_ASSIGN(_e, 0, 0, 0)

Definition at line 576 of file pprz_algebra_int.h.

◆ INT_VECT2_ZERO

#define INT_VECT2_ZERO (   _v)    VECT2_ASSIGN(_v, 0, 0)

Definition at line 238 of file pprz_algebra_int.h.

◆ INT_VECT3_ZERO

#define INT_VECT3_ZERO (   _v)    VECT3_ASSIGN(_v, 0, 0, 0)

Definition at line 288 of file pprz_algebra_int.h.

◆ LBFP_OF_REAL

#define LBFP_OF_REAL (   _vr,
  _frac 
)    ((_vr)*(1LL<<(_frac)))

Definition at line 205 of file pprz_algebra_int.h.

◆ MAG_BFP_OF_REAL

#define MAG_BFP_OF_REAL (   _af)    BFP_OF_REAL((_af), INT32_MAG_FRAC)

Definition at line 223 of file pprz_algebra_int.h.

◆ MAG_FLOAT_OF_BFP

#define MAG_FLOAT_OF_BFP (   _ai)    FLOAT_OF_BFP((_ai), INT32_MAG_FRAC)

Definition at line 224 of file pprz_algebra_int.h.

◆ POS_BFP_OF_REAL

#define POS_BFP_OF_REAL (   _af)    BFP_OF_REAL((_af), INT32_POS_FRAC)

Definition at line 217 of file pprz_algebra_int.h.

◆ POS_FLOAT_OF_BFP

#define POS_FLOAT_OF_BFP (   _ai)    FLOAT_OF_BFP((_ai), INT32_POS_FRAC)

Definition at line 218 of file pprz_algebra_int.h.

◆ QUAT1_BFP_OF_REAL

#define QUAT1_BFP_OF_REAL (   _qf)    BFP_OF_REAL((_qf), INT32_QUAT_FRAC)

Definition at line 213 of file pprz_algebra_int.h.

◆ QUAT1_FLOAT_OF_BFP

#define QUAT1_FLOAT_OF_BFP (   _qi)    FLOAT_OF_BFP((_qi), INT32_QUAT_FRAC)

Definition at line 214 of file pprz_algebra_int.h.

◆ RATE_BFP_OF_REAL

#define RATE_BFP_OF_REAL (   _af)    BFP_OF_REAL((_af), INT32_RATE_FRAC)

Definition at line 209 of file pprz_algebra_int.h.

◆ RATE_FLOAT_OF_BFP

#define RATE_FLOAT_OF_BFP (   _ai)    FLOAT_OF_BFP((_ai), INT32_RATE_FRAC)

Definition at line 210 of file pprz_algebra_int.h.

◆ SPEED_BFP_OF_REAL

#define SPEED_BFP_OF_REAL (   _af)    BFP_OF_REAL((_af), INT32_SPEED_FRAC)

Definition at line 219 of file pprz_algebra_int.h.

◆ SPEED_FLOAT_OF_BFP

#define SPEED_FLOAT_OF_BFP (   _ai)    FLOAT_OF_BFP((_ai), INT32_SPEED_FRAC)

Definition at line 220 of file pprz_algebra_int.h.

◆ TRIG_BFP_OF_REAL

#define TRIG_BFP_OF_REAL (   _tf)    BFP_OF_REAL((_tf), INT32_TRIG_FRAC)

Definition at line 215 of file pprz_algebra_int.h.

◆ TRIG_FLOAT_OF_BFP

#define TRIG_FLOAT_OF_BFP (   _ti)    FLOAT_OF_BFP((_ti),INT32_TRIG_FRAC)

Definition at line 216 of file pprz_algebra_int.h.

Function Documentation

◆ int16_vect_zero()

static void int16_vect_zero ( int16_t a,
const int  n 
)
inlinestatic

a = 0

Definition at line 617 of file pprz_algebra_int.h.

◆ int32_eulers_dot_321_of_rates()

void int32_eulers_dot_321_of_rates ( struct Int32Eulers ed,
struct Int32Eulers e,
struct Int32Rates r 
)

◆ int32_eulers_of_quat()

void int32_eulers_of_quat ( struct Int32Eulers e,
struct Int32Quat q 
)

◆ int32_eulers_of_rmat()

void int32_eulers_of_rmat ( struct Int32Eulers e,
struct Int32RMat rm 
)

Definition at line 504 of file pprz_algebra_int.c.

References ANGLE_BFP_OF_REAL, Int32RMat::m, Int32Eulers::phi, Int32Eulers::psi, Int32Eulers::theta, and TRIG_FLOAT_OF_BFP.

Referenced by orientationCalcEulers_i().

+ Here is the caller graph for this function:

◆ int32_gcd()

uint32_t int32_gcd ( uint32_t  a,
uint32_t  b 
)

Definition at line 52 of file pprz_algebra_int.c.

References b.

Referenced by mt9f002_set_blanking().

+ Here is the caller graph for this function:

◆ int32_mat_mul()

static void int32_mat_mul ( int32_t **  o,
int32_t **  a,
int32_t **  b,
int  m,
int  n,
int  l 
)
inlinestatic

o = a * b

a: [m x n] b: [n x l] o: [m x l]

Definition at line 708 of file pprz_algebra_int.h.

References b, and simple_quad_sim::m.

◆ int32_quat_comp()

void int32_quat_comp ( struct Int32Quat a2c,
struct Int32Quat a2b,
struct Int32Quat b2c 
)

Composition (multiplication) of two quaternions.

a2c = a2b comp b2c , aka a2c = a2b * b2c

Definition at line 269 of file pprz_algebra_int.c.

References INT32_QUAT_FRAC, Int32Quat::qi, Int32Quat::qx, Int32Quat::qy, and Int32Quat::qz.

Referenced by int32_quat_comp_norm_shortest().

+ Here is the caller graph for this function:

◆ int32_quat_comp_inv()

void int32_quat_comp_inv ( struct Int32Quat a2b,
struct Int32Quat a2c,
struct Int32Quat b2c 
)

Composition (multiplication) of two quaternions.

a2b = a2c comp_inv b2c , aka a2b = a2c * inv(b2c)

Definition at line 277 of file pprz_algebra_int.c.

References INT32_QUAT_FRAC, Int32Quat::qi, Int32Quat::qx, Int32Quat::qy, and Int32Quat::qz.

Referenced by int32_quat_comp_inv_norm_shortest(), and stabilization_attitude_run().

+ Here is the caller graph for this function:

◆ int32_quat_comp_inv_norm_shortest()

void int32_quat_comp_inv_norm_shortest ( struct Int32Quat a2b,
struct Int32Quat a2c,
struct Int32Quat b2c 
)

Composition (multiplication) of two quaternions with normalization.

a2b = a2c comp_inv b2c , aka a2b = a2c * inv(b2c)

Definition at line 300 of file pprz_algebra_int.c.

References int32_quat_comp_inv(), int32_quat_normalize(), and int32_quat_wrap_shortest().

+ Here is the call graph for this function:

◆ int32_quat_comp_norm_shortest()

void int32_quat_comp_norm_shortest ( struct Int32Quat a2c,
struct Int32Quat a2b,
struct Int32Quat b2c 
)

Composition (multiplication) of two quaternions with normalization.

a2c = a2b comp b2c , aka a2c = a2b * b2c

Definition at line 293 of file pprz_algebra_int.c.

References int32_quat_comp(), int32_quat_normalize(), and int32_quat_wrap_shortest().

Referenced by ahrs_icq_realign_heading().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ int32_quat_derivative()

void int32_quat_derivative ( struct Int32Quat qd,
const struct Int32Rates r,
struct Int32Quat q 
)

Quaternion derivative from rotational velocity.

qd = -0.5*omega(r) * q or equally: qd = 0.5 * q * omega(r)

qd = -0.5*omega(r) * q or equally: qd = 0.5 * q * omega(r) Multiplication with 0.5 is done by shifting one more bit to the right.

Definition at line 320 of file pprz_algebra_int.c.

References INT32_RATE_FRAC, Int32Rates::p, Int32Rates::q, Int32Quat::qi, Int32Quat::qx, Int32Quat::qy, Int32Quat::qz, and Int32Rates::r.

Referenced by attitude_ref_quat_int_update().

+ Here is the caller graph for this function:

◆ int32_quat_identity()

static void int32_quat_identity ( struct Int32Quat q)
inlinestatic

◆ int32_quat_integrate_fi()

void int32_quat_integrate_fi ( struct Int32Quat q,
struct Int64Quat hr,
struct Int32Rates omega,
int  freq 
)

in place quaternion first order integration with constant rotational velocity.

Definition at line 329 of file pprz_algebra_int.c.

References INT32_RATE_FRAC, Int32Rates::p, Int32Rates::q, Int32Quat::qi, Int64Quat::qi, Int32Quat::qx, Int64Quat::qx, Int32Quat::qy, Int64Quat::qy, Int32Quat::qz, Int64Quat::qz, and Int32Rates::r.

Referenced by ahrs_icq_propagate().

+ Here is the caller graph for this function:

◆ int32_quat_inv_comp()

void int32_quat_inv_comp ( struct Int32Quat b2c,
struct Int32Quat a2b,
struct Int32Quat a2c 
)

Composition (multiplication) of two quaternions.

b2c = a2b inv_comp a2c , aka b2c = inv(_a2b) * a2c

Definition at line 285 of file pprz_algebra_int.c.

References INT32_QUAT_FRAC, Int32Quat::qi, Int32Quat::qx, Int32Quat::qy, and Int32Quat::qz.

Referenced by attitude_ref_quat_int_update(), int32_quat_inv_comp_norm_shortest(), and stabilization_attitude_run().

+ Here is the caller graph for this function:

◆ int32_quat_inv_comp_norm_shortest()

void int32_quat_inv_comp_norm_shortest ( struct Int32Quat b2c,
struct Int32Quat a2b,
struct Int32Quat a2c 
)

Composition (multiplication) of two quaternions with normalization.

b2c = a2b inv_comp a2c , aka b2c = inv(_a2b) * a2c

Definition at line 307 of file pprz_algebra_int.c.

References int32_quat_inv_comp(), int32_quat_normalize(), and int32_quat_wrap_shortest().

Referenced by ahrs_icq_realign_heading().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ int32_quat_norm()

static uint32_t int32_quat_norm ( struct Int32Quat q)
inlinestatic

Norm of a quaternion.

Definition at line 442 of file pprz_algebra_int.h.

References int32_sqrt(), Int32Quat::qi, Int32Quat::qx, Int32Quat::qy, and Int32Quat::qz.

Referenced by int32_quat_normalize().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ int32_quat_normalize()

static void int32_quat_normalize ( struct Int32Quat q)
inlinestatic

◆ int32_quat_of_axis_angle()

void int32_quat_of_axis_angle ( struct Int32Quat q,
struct Int32Vect3 uv,
int32_t  angle 
)

Quaternion from unit vector and angle.

Output quaternion is not normalized. The output resolution depends on the resolution of the resolution of the unit vector. If the unit vector has no fractional part (ex: [0, 0, 1]), the quaternion is unitary.

Definition at line 409 of file pprz_algebra_int.c.

References INT32_QUAT_FRAC, INT32_TRIG_FRAC, PPRZ_ITRIG_COS, PPRZ_ITRIG_SIN, Int32Quat::qi, Int32Quat::qx, Int32Quat::qy, Int32Quat::qz, Int32Vect3::x, Int32Vect3::y, and Int32Vect3::z.

◆ int32_quat_of_eulers()

void int32_quat_of_eulers ( struct Int32Quat q,
struct Int32Eulers e 
)

Quaternion from Euler angles.

Definition at line 375 of file pprz_algebra_int.c.

References INT32_QUAT_FRAC, INT32_TRIG_FRAC, INT_MULT_RSHIFT, Int32Eulers::phi, PPRZ_ITRIG_COS, PPRZ_ITRIG_SIN, Int32Eulers::psi, Int32Quat::qi, Int32Quat::qx, Int32Quat::qy, Int32Quat::qz, and Int32Eulers::theta.

Referenced by orientationCalcQuat_i().

+ Here is the caller graph for this function:

◆ int32_quat_of_rmat()

void int32_quat_of_rmat ( struct Int32Quat q,
struct Int32RMat r 
)

Quaternion from rotation matrix.

Definition at line 421 of file pprz_algebra_int.c.

References INT32_QUAT_FRAC, int32_sqrt(), INT32_TRIG_FRAC, Int32Quat::qi, Int32Quat::qx, Int32Quat::qy, Int32Quat::qz, RMAT_ELMT, RMAT_TRACE, and TRIG_BFP_OF_REAL.

Referenced by orientationCalcQuat_i().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ int32_quat_vmult()

void int32_quat_vmult ( struct Int32Vect3 v_out,
struct Int32Quat q,
struct Int32Vect3 v_in 
)

rotate 3D vector by quaternion.

vb = q_a2b * va * q_a2b^-1 Doesn't support inplace rotation, meaning v_out mustn't be a pointer to same struct as v_in.

Definition at line 353 of file pprz_algebra_int.c.

References INT32_QUAT_FRAC, Int32Quat::qi, QUAT1_BFP_OF_REAL, Int32Quat::qx, Int32Quat::qy, Int32Quat::qz, Int32Vect3::x, Int32Vect3::y, and Int32Vect3::z.

Referenced by ins_int_update_gps().

+ Here is the caller graph for this function:

◆ int32_quat_wrap_shortest()

static void int32_quat_wrap_shortest ( struct Int32Quat q)
inlinestatic

◆ int32_rates_of_eulers_dot_321()

void int32_rates_of_eulers_dot_321 ( struct Int32Rates r,
struct Int32Eulers e,
struct Int32Eulers ed 
)

◆ int32_rmat_comp()

void int32_rmat_comp ( struct Int32RMat m_a2c,
const struct Int32RMat m_a2b,
const struct Int32RMat m_b2c 
)

Composition (multiplication) of two rotation matrices.

m_a2c = m_a2b comp m_b2c , aka m_a2c = m_b2c * m_a2b

_m_a2c = _m_a2b comp _m_b2c , aka _m_a2c = _m_b2c * _m_a2b

Definition at line 75 of file pprz_algebra_int.c.

References INT32_TRIG_FRAC, and Int32RMat::m.

Referenced by imu_init(), imu_set_body_to_imu_eulers(), imu_set_defaults_accel(), imu_set_defaults_gyro(), and imu_set_defaults_mag().

+ Here is the caller graph for this function:

◆ int32_rmat_comp_inv()

void int32_rmat_comp_inv ( struct Int32RMat m_a2b,
const struct Int32RMat m_a2c,
const struct Int32RMat m_b2c 
)

Composition (multiplication) of two rotation matrices.

m_a2b = m_a2c comp_inv m_b2c , aka m_a2b = inv(_m_b2c) * m_a2c

_m_a2b = _m_a2c comp_inv _m_b2c , aka _m_a2b = inv(_m_b2c) * _m_a2c

Definition at line 91 of file pprz_algebra_int.c.

References INT32_TRIG_FRAC, and Int32RMat::m.

Referenced by imu_set_body_to_imu_eulers().

+ Here is the caller graph for this function:

◆ int32_rmat_identity()

static void int32_rmat_identity ( struct Int32RMat rm)
inlinestatic

initialises a rotation matrix to identity

Definition at line 347 of file pprz_algebra_int.h.

References INT32_MAT33_DIAG, and TRIG_BFP_OF_REAL.

Referenced by imu_init().

+ Here is the caller graph for this function:

◆ int32_rmat_of_eulers_312()

void int32_rmat_of_eulers_312 ( struct Int32RMat rm,
struct Int32Eulers e 
)

Rotation matrix from 312 Euler angles.

Definition at line 220 of file pprz_algebra_int.c.

References INT32_TRIG_FRAC, INT_MULT_RSHIFT, Int32Eulers::phi, PPRZ_ITRIG_COS, PPRZ_ITRIG_SIN, Int32Eulers::psi, RMAT_ELMT, and Int32Eulers::theta.

◆ int32_rmat_of_eulers_321()

void int32_rmat_of_eulers_321 ( struct Int32RMat rm,
struct Int32Eulers e 
)

Rotation matrix from 321 Euler angles (int).

The Euler angles are interpreted as zy'x'' (intrinsic) rotation. First rotate around z with psi, then around the new y' with theta, then around new x'' with phi. This is the same as a xyz (extrinsic) rotation, rotating around the fixed x, then y then z axis.

  • psi range: -pi < psi <= pi
  • theta range: -pi/2 <= theta <= pi/2
  • phi range: -pi < phi <= pi
    Parameters
    [out]rmpointer to rotation matrix
    [in]epointer to Euler angles
    Rotation matrix from 321 Euler angles (int).

http://www.mathworks.com/access/helpdesk_r13/help/toolbox/aeroblks/euleranglestodirectioncosinematrix.html

Definition at line 177 of file pprz_algebra_int.c.

References INT32_TRIG_FRAC, INT_MULT_RSHIFT, Int32Eulers::phi, PPRZ_ITRIG_COS, PPRZ_ITRIG_SIN, Int32Eulers::psi, RMAT_ELMT, and Int32Eulers::theta.

◆ int32_rmat_of_quat()

◆ int32_rmat_ratemult()

void int32_rmat_ratemult ( struct Int32Rates rb,
struct Int32RMat m_a2b,
struct Int32Rates ra 
)

rotate anglular rates by rotation matrix.

rb = m_a2b * ra

Definition at line 127 of file pprz_algebra_int.c.

References INT32_TRIG_FRAC, Int32RMat::m, Int32Rates::p, Int32Rates::q, and Int32Rates::r.

◆ int32_rmat_transp_ratemult()

void int32_rmat_transp_ratemult ( struct Int32Rates rb,
struct Int32RMat m_b2a,
struct Int32Rates ra 
)

rotate anglular rates by transposed rotation matrix.

rb = m_b2a^T * ra

Definition at line 137 of file pprz_algebra_int.c.

References INT32_TRIG_FRAC, Int32RMat::m, Int32Rates::p, Int32Rates::q, and Int32Rates::r.

Referenced by imu_gyro_raw_cb().

+ Here is the caller graph for this function:

◆ int32_rmat_transp_vmult()

void int32_rmat_transp_vmult ( struct Int32Vect3 vb,
struct Int32RMat m_b2a,
struct Int32Vect3 va 
)

rotate 3D vector by transposed rotation matrix.

vb = m_b2a^T * va

Definition at line 117 of file pprz_algebra_int.c.

References INT32_TRIG_FRAC, Int32RMat::m, Int32Vect3::x, Int32Vect3::y, and Int32Vect3::z.

Referenced by accel_cb(), ahrs_icq_update_mag_2d(), georeference_project(), hff_propagate(), imu_accel_raw_cb(), imu_mag_raw_cb(), ins_int_propagate(), and ins_module_propagate().

+ Here is the caller graph for this function:

◆ int32_rmat_vmult()

void int32_rmat_vmult ( struct Int32Vect3 vb,
struct Int32RMat m_a2b,
struct Int32Vect3 va 
)

◆ int32_sqrt()

uint32_t int32_sqrt ( uint32_t  in)

◆ int32_vect2_norm()

static uint32_t int32_vect2_norm ( struct Int32Vect2 v)
inlinestatic

return norm of 2D vector

Definition at line 250 of file pprz_algebra_int.h.

References int32_sqrt(), and int32_vect2_norm2().

Referenced by guidance_hybrid_airspeed_to_attitude(), guidance_hybrid_groundspeed_to_airspeed(), and int32_vect2_normalize().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ int32_vect2_norm2()

static uint32_t int32_vect2_norm2 ( struct Int32Vect2 v)
inlinestatic

return squared norm of 2D vector

Definition at line 244 of file pprz_algebra_int.h.

References Int32Vect2::x, and Int32Vect2::y.

Referenced by int32_vect2_norm().

+ Here is the caller graph for this function:

◆ int32_vect2_normalize()

static void int32_vect2_normalize ( struct Int32Vect2 v,
uint8_t  frac 
)
inlinestatic

normalize 2D vector inplace

Definition at line 256 of file pprz_algebra_int.h.

References BFP_OF_REAL, f, int32_vect2_norm(), Int32Vect2::x, and Int32Vect2::y.

Referenced by ahrs_icq_update_mag_2d().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ int32_vect_add()

static void int32_vect_add ( int32_t a,
const int32_t b,
const int  n 
)
inlinestatic

a += b

Definition at line 660 of file pprz_algebra_int.h.

References b.

◆ int32_vect_copy()

static void int32_vect_copy ( int32_t a,
const int32_t b,
const int  n 
)
inlinestatic

a = b

Definition at line 632 of file pprz_algebra_int.h.

References b.

Referenced by stabilization_attitude_run().

+ Here is the caller graph for this function:

◆ int32_vect_diff()

static void int32_vect_diff ( int32_t o,
const int32_t a,
const int32_t b,
const int  n 
)
inlinestatic

o = a - b

Definition at line 646 of file pprz_algebra_int.h.

References b.

Referenced by stabilization_attitude_run().

+ Here is the caller graph for this function:

◆ int32_vect_find()

static bool int32_vect_find ( const int32_t a,
const int32_t  s,
int *  loc,
const int  n 
)
inlinestatic

Find value s in array a.

Returns 1 if found, 0 if not found. If the value is found loc = index of found value in array, else loc = -1

Definition at line 683 of file pprz_algebra_int.h.

References s.

Referenced by range_msg_callback().

+ Here is the caller graph for this function:

◆ int32_vect_mul()

static void int32_vect_mul ( int32_t o,
const int32_t a,
const int32_t b,
const int  n 
)
inlinestatic

o = a * b (element wise)

Definition at line 653 of file pprz_algebra_int.h.

References b.

◆ int32_vect_set_value()

static void int32_vect_set_value ( int32_t a,
const int32_t  v,
const int  n 
)
inlinestatic

a = v * ones(n,1)

Definition at line 624 of file pprz_algebra_int.h.

Referenced by relative_localization_filter_init().

+ Here is the caller graph for this function:

◆ int32_vect_smul()

static void int32_vect_smul ( int32_t o,
const int32_t a,
const int32_t  s,
const int  n 
)
inlinestatic

o = a * s

Definition at line 674 of file pprz_algebra_int.h.

References s.

◆ int32_vect_sub()

static void int32_vect_sub ( int32_t a,
const int32_t b,
const int  n 
)
inlinestatic

a -= b

Definition at line 667 of file pprz_algebra_int.h.

References b.

◆ int32_vect_sum()

static void int32_vect_sum ( int32_t o,
const int32_t a,
const int32_t b,
const int  n 
)
inlinestatic

o = a + b

Definition at line 639 of file pprz_algebra_int.h.

References b.

Referenced by stabilization_attitude_run().

+ Here is the caller graph for this function:

◆ int32_vect_zero()

static void int32_vect_zero ( int32_t a,
const int  n 
)
inlinestatic

a = 0

Definition at line 610 of file pprz_algebra_int.h.