Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
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)
 
int pprz_trig_int_init (void)
 

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

◆ INT32_ATAN2

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

Definition at line 113 of file pprz_trig_int.h.

◆ INT32_ATAN2_2

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

Definition at line 114 of file pprz_trig_int.h.

◆ ONE_MIN

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

Definition at line 66 of file pprz_trig_int.h.

◆ PPRZ_ITRIG_COS

#define PPRZ_ITRIG_COS (   _c,
  _a 
)    { _c = pprz_itrig_cos(_a); }

Definition at line 112 of file pprz_trig_int.h.

◆ PPRZ_ITRIG_SIN

#define PPRZ_ITRIG_SIN (   _s,
  _a 
)    { _s = pprz_itrig_sin(_a); }

Definition at line 111 of file pprz_trig_int.h.

◆ PPRZ_TRIG_CONST

#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.

◆ TREE_BUF_12_1

#define TREE_BUF_12_1   1035

Definition at line 68 of file pprz_trig_int.h.

◆ TREE_BUF_12_2

#define TREE_BUF_12_2   2145

Definition at line 69 of file pprz_trig_int.h.

◆ TREE_BUF_12_3

#define TREE_BUF_12_3   3474

Definition at line 70 of file pprz_trig_int.h.

◆ TREE_SIZE_12

#define TREE_SIZE_12   (TRIG_INT_VAL_MAX - 12)

Definition at line 59 of file pprz_trig_int.h.

◆ TREE_SIZE_4

#define TREE_SIZE_4   (TRIG_INT_VAL_MAX - 4)

Definition at line 57 of file pprz_trig_int.h.

◆ TREE_SIZE_8

#define TREE_SIZE_8   (TRIG_INT_VAL_MAX - 8)

Definition at line 58 of file pprz_trig_int.h.

◆ TRIG_INT_COMPR_LEN

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

Definition at line 63 of file pprz_trig_int.h.

◆ TRIG_INT_RLE_LEN

#define TRIG_INT_RLE_LEN   3379

Definition at line 62 of file pprz_trig_int.h.

◆ TRIG_INT_SIZE

#define TRIG_INT_SIZE   6434

Definition at line 55 of file pprz_trig_int.h.

◆ TRIG_INT_VAL_MAX

#define TRIG_INT_VAL_MAX   14

Definition at line 56 of file pprz_trig_int.h.

Function Documentation

◆ int32_atan2()

int32_t int32_atan2 ( int32_t  y,
int32_t  x 
)

Definition at line 905 of file pprz_trig_int.c.

References c1, c2, INT32_ANGLE_PI_4, and R_FRAC.

Referenced by rotorcraft_cam_periodic(), and stateCalcHorizontalSpeedDir_i().

+ Here is the caller graph for this function:

◆ int32_atan2_2()

int32_t int32_atan2_2 ( int32_t  y,
int32_t  x 
)

Definition at line 927 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:

◆ pprz_itrig_cos()

int32_t pprz_itrig_cos ( int32_t  angle)

Definition at line 894 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:

◆ pprz_itrig_sin()

int32_t pprz_itrig_sin ( int32_t  angle)

Definition at line 865 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:

◆ pprz_trig_int_init()

int pprz_trig_int_init ( void  )

Definition at line 860 of file pprz_trig_int.c.

Variable Documentation

◆ pprz_trig_int

PPRZ_TRIG_CONST int16_t pprz_trig_int[]
extern

Definition at line 31 of file pprz_trig_int.c.

Referenced by pprz_itrig_sin().