Paparazzi UAS  v5.14.0_stable-0-g3f680d1
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
pprz_trig_int.h File Reference

Paparazzi fixed point trig functions. More...

#include "std.h"
+ Include dependency graph for pprz_trig_int.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define PPRZ_TRIG_CONST
 Allow makefile to define PPRZ_TRIG_CONST in case we want to make the trig tables const and store them in flash. More...
 
#define TRIG_INT_SIZE   6434
 
#define TRIG_INT_VAL_MAX   14
 
#define TREE_SIZE_4   (TRIG_INT_VAL_MAX - 4)
 
#define TREE_SIZE_8   (TRIG_INT_VAL_MAX - 8)
 
#define TREE_SIZE_12   (TRIG_INT_VAL_MAX - 12)
 
#define TRIG_INT_RLE_LEN   3379
 
#define TRIG_INT_COMPR_LEN   ((TRIG_INT_RLE_LEN + 1) / 2)
 
#define ONE_MIN   ((3 * 3) + 1)
 
#define TREE_BUF_12_1   1035
 
#define TREE_BUF_12_2   2145
 
#define TREE_BUF_12_3   3474
 
#define PPRZ_ITRIG_SIN(_s, _a)   { _s = pprz_itrig_sin(_a); }
 
#define PPRZ_ITRIG_COS(_c, _a)   { _c = pprz_itrig_cos(_a); }
 
#define INT32_ATAN2(_a, _y, _x)   { _a = int32_atan2(_y, _x); }
 
#define INT32_ATAN2_2(_a, _y, _x)   { _a = int32_atan2_2(_y, _x); }
 

Functions

int32_t pprz_itrig_sin (int32_t angle)
 
int32_t pprz_itrig_cos (int32_t angle)
 
int32_t int32_atan2 (int32_t y, int32_t x)
 
int32_t int32_atan2_2 (int32_t y, int32_t x)
 

Variables

PPRZ_TRIG_CONST int16_t pprz_trig_int []
 

Detailed Description

Paparazzi fixed point trig functions.

Definition in file pprz_trig_int.h.

Macro Definition Documentation

#define INT32_ATAN2 (   _a,
  _y,
  _x 
)    { _a = int32_atan2(_y, _x); }

Definition at line 111 of file pprz_trig_int.h.

#define INT32_ATAN2_2 (   _a,
  _y,
  _x 
)    { _a = int32_atan2_2(_y, _x); }

Definition at line 112 of file pprz_trig_int.h.

#define ONE_MIN   ((3 * 3) + 1)

Definition at line 66 of file pprz_trig_int.h.

#define PPRZ_TRIG_CONST

Allow makefile to define PPRZ_TRIG_CONST in case we want to make the trig tables const and store them in flash.

Otherwise use the empty string and keep the table in RAM.

Definition at line 40 of file pprz_trig_int.h.

#define TREE_BUF_12_1   1035

Definition at line 68 of file pprz_trig_int.h.

#define TREE_BUF_12_2   2145

Definition at line 69 of file pprz_trig_int.h.

#define TREE_BUF_12_3   3474

Definition at line 70 of file pprz_trig_int.h.

#define TREE_SIZE_12   (TRIG_INT_VAL_MAX - 12)

Definition at line 59 of file pprz_trig_int.h.

#define TREE_SIZE_4   (TRIG_INT_VAL_MAX - 4)

Definition at line 57 of file pprz_trig_int.h.

#define TREE_SIZE_8   (TRIG_INT_VAL_MAX - 8)

Definition at line 58 of file pprz_trig_int.h.

#define TRIG_INT_COMPR_LEN   ((TRIG_INT_RLE_LEN + 1) / 2)

Definition at line 63 of file pprz_trig_int.h.

#define TRIG_INT_RLE_LEN   3379

Definition at line 62 of file pprz_trig_int.h.

#define TRIG_INT_SIZE   6434

Definition at line 55 of file pprz_trig_int.h.

#define TRIG_INT_VAL_MAX   14

Definition at line 56 of file pprz_trig_int.h.

Function Documentation

int32_t int32_atan2 ( int32_t  y,
int32_t  x 
)

Definition at line 899 of file pprz_trig_int.c.

References c1, c2, INT32_ANGLE_PI_4, and R_FRAC.

Referenced by get_phi_theta_measurement_fom_accel(), nav_circle(), rotorcraft_cam_periodic(), and stateCalcHorizontalSpeedDir_i().

+ Here is the caller graph for this function:

int32_t int32_atan2_2 ( int32_t  y,
int32_t  x 
)

Definition at line 921 of file pprz_trig_int.c.

References ANGLE_BFP_OF_REAL, c1, c2, INT32_ANGLE_FRAC, INT32_ANGLE_PI_4, and R_FRAC.

Referenced by nav_oval().

+ Here is the caller graph for this function:

int32_t pprz_itrig_cos ( int32_t  angle)

Definition at line 888 of file pprz_trig_int.c.

References INT32_ANGLE_PI_2, and pprz_itrig_sin().

Referenced by stabilization_attitude_run().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int32_t pprz_itrig_sin ( int32_t  angle)

Definition at line 859 of file pprz_trig_int.c.

References ANGLE_BFP_OF_REAL, ANGLE_FLOAT_OF_BFP, INT32_ANGLE_NORMALIZE, INT32_ANGLE_PI, INT32_ANGLE_PI_2, and pprz_trig_int.

Referenced by pprz_itrig_cos(), and stabilization_attitude_run().

+ Here is the caller graph for this function:

Variable Documentation

PPRZ_TRIG_CONST int16_t pprz_trig_int[]

Definition at line 31 of file pprz_trig_int.c.

Referenced by pprz_itrig_sin().