Paparazzi UAS  v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
gvf_parametric.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2020 Hector Garcia de Marina <hgarciad@ucm.es>
3  *
4  * This file is part of paparazzi.
5  *
6  * paparazzi is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2, or (at your option)
9  * any later version.
10  *
11  * paparazzi is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with paparazzi; see the file COPYING. If not, see
18  * <http://www.gnu.org/licenses/>.
19  */
20 
27 #ifndef GVF_PARAMETRIC_H
28 #define GVF_PARAMETRIC_H
29 
30 #define GVF_PARAMETRIC_GRAVITY 9.806
31 
33 #ifndef GVF_PARAMETRIC_CONTROL_KROLL
34 #define GVF_PARAMETRIC_CONTROL_KROLL 1
35 #endif
36 
38 #ifndef GVF_PARAMETRIC_CONTROL_KCLIMB
39 #define GVF_PARAMETRIC_CONTROL_KCLIMB 1
40 #endif
41 
43 #ifndef GVF_PARAMETRIC_CONTROL_L
44 #define GVF_PARAMETRIC_CONTROL_L 0.1
45 #endif
46 
48 #ifndef GVF_PARAMETRIC_CONTROL_BETA
49 #define GVF_PARAMETRIC_CONTROL_BETA 0.01
50 #endif
51 
53 #ifndef GVF_PARAMETRIC_CONTROL_KPSI
54 #define GVF_PARAMETRIC_CONTROL_KPSI 1
55 #endif
56 
57 
58 #ifdef __cplusplus
59 extern "C" {
60 #endif
61 
65 
74 typedef struct {
75  float w;
76  float delta_T;
78  float k_roll;
79  float k_climb;
80  float k_psi;
81  float L;
82  float beta;
84 
86 
87 // Parameters for the trajectories
93 };
94 
95 typedef struct {
97  float p_parametric[16];
98  float phi_errors[3];
100 
102 
103 // Init function
104 extern void gvf_parametric_init(void);
105 
106 // Control functions
108 extern void gvf_parametric_control_2D(float, float, float, float, float, float, float, float);
109 extern void gvf_parametric_control_3D(float, float, float, float, float, float, float, float, float,
110  float, float, float);
111 
112 // 2D Trefoil
113 extern bool gvf_parametric_2D_trefoil_XY(float, float, float, float, float, float, float);
114 extern bool gvf_parametric_2D_trefoil_wp(uint8_t, float, float, float, float, float);
115 
116 // 3D Ellipse
117 extern bool gvf_parametric_3D_ellipse_XYZ(float, float, float, float, float, float);
118 extern bool gvf_parametric_3D_ellipse_wp(uint8_t, float, float, float, float);
119 extern bool gvf_parametric_3D_ellipse_wp_delta(uint8_t, float, float, float, float);
120 
121 // 3D Lissajous
122 extern bool gvf_parametric_3D_lissajous_XYZ(float, float, float, float, float, float, float, float, float, float, float,
123  float, float);
124 extern bool gvf_parametric_3D_lissajous_wp_center(uint8_t, float, float, float, float, float, float, float, float,
125  float, float, float);
126 
127 #ifdef __cplusplus
128 }
129 #endif
130 
131 
132 #endif // GVF_PARAMETRIC_H
LISSAJOUS_3D
@ LISSAJOUS_3D
Definition: gvf_parametric.h:91
gvf_parametric_control_3D
void gvf_parametric_control_3D(float, float, float, float, float, float, float, float, float, float, float, float)
Definition: gvf_parametric.cpp:219
gvf_parametric_con::k_psi
float k_psi
Definition: gvf_parametric.h:80
gvf_parametric_2d_trefoil.h
gvf_parametric_trajectory
gvf_parametric_tra gvf_parametric_trajectory
Definition: gvf_parametric.cpp:47
s
static uint32_t s
Definition: light_scheduler.c:33
gvf_parametric_control
gvf_parametric_con gvf_parametric_control
Definition: gvf_parametric.cpp:44
trajectories_parametric
trajectories_parametric
Definition: gvf_parametric.h:88
gvf_parametric_3D_lissajous_wp_center
bool gvf_parametric_3D_lissajous_wp_center(uint8_t, float, float, float, float, float, float, float, float, float, float, float)
Definition: gvf_parametric.cpp:435
gvf_parametric_3D_ellipse_wp
bool gvf_parametric_3D_ellipse_wp(uint8_t, float, float, float, float)
Definition: gvf_parametric.cpp:385
gvf_parametric_3D_ellipse_wp_delta
bool gvf_parametric_3D_ellipse_wp_delta(uint8_t, float, float, float, float)
Definition: gvf_parametric.cpp:391
gvf_parametric_tra
Definition: gvf_parametric.h:95
gvf_parametric_2D_trefoil_wp
bool gvf_parametric_2D_trefoil_wp(uint8_t, float, float, float, float, float)
Definition: gvf_parametric.cpp:343
gvf_parametric_3d_ellipse.h
TREFOIL_2D
@ TREFOIL_2D
Definition: gvf_parametric.h:89
uint8_t
unsigned char uint8_t
Definition: types.h:14
gvf_parametric_con::k_roll
float k_roll
Definition: gvf_parametric.h:78
gvf_parametric_con::w
float w
Definition: gvf_parametric.h:75
gvf_parametric_3D_ellipse_XYZ
bool gvf_parametric_3D_ellipse_XYZ(float, float, float, float, float, float)
3D TRAJECTORIES
Definition: gvf_parametric.cpp:352
gvf_parametric_init
void gvf_parametric_init(void)
Definition: gvf_parametric.cpp:107
gvf_parametric_control_2D
void gvf_parametric_control_2D(float, float, float, float, float, float, float, float)
Definition: gvf_parametric.cpp:130
NONE_PARAMETRIC
@ NONE_PARAMETRIC
Definition: gvf_parametric.h:92
gvf_parametric_con::s
int8_t s
Definition: gvf_parametric.h:77
gvf_parametric_con::k_climb
float k_climb
Definition: gvf_parametric.h:79
int8_t
signed char int8_t
Definition: types.h:15
gvf_parametric_2D_trefoil_XY
bool gvf_parametric_2D_trefoil_XY(float, float, float, float, float, float, float)
2D TRAJECTORIES
Definition: gvf_parametric.cpp:323
gvf_parametric_3D_lissajous_XYZ
bool gvf_parametric_3D_lissajous_XYZ(float, float, float, float, float, float, float, float, float, float, float, float, float)
Definition: gvf_parametric.cpp:402
gvf_parametric_con::beta
float beta
Definition: gvf_parametric.h:82
ELLIPSE_3D
@ ELLIPSE_3D
Definition: gvf_parametric.h:90
type
timer subsystem type(config options) --------------------------------------------(advanced timers using RCC_APB1) TIM1 adc(if USE_AD_TIM1) radio_control/ppm(if USE_PPM_TIM1
gvf_parametric_set_direction
void gvf_parametric_set_direction(int8_t s)
Definition: gvf_parametric.cpp:125
gvf_parametric_con::delta_T
float delta_T
Definition: gvf_parametric.h:76
gvf_parametric_3d_lissajous.h
gvf_parametric_con::L
float L
Definition: gvf_parametric.h:81
gvf_parametric_con
Definition: gvf_parametric.h:74