Paparazzi UAS v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
Loading...
Searching...
No Matches
nav_parametric_3d_ellipse.c
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
29
31#ifndef GVF_PARAMETRIC_3D_ELLIPSE_KX
32 #if GVF_PARAMETRIC_CONTROL_STEP_ADAPTATION > 0
33 #define GVF_PARAMETRIC_3D_ELLIPSE_KX 0.1
34 #else
35 #define GVF_PARAMETRIC_3D_ELLIPSE_KX 0.001
36 #endif
37#endif
38
40#ifndef GVF_PARAMETRIC_3D_ELLIPSE_KY
41 #if GVF_PARAMETRIC_CONTROL_STEP_ADAPTATION > 0
42 #define GVF_PARAMETRIC_3D_ELLIPSE_KY 0.1
43 #else
44 #define GVF_PARAMETRIC_3D_ELLIPSE_KY 0.001
45 #endif
46#endif
47
49#ifndef GVF_PARAMETRIC_3D_ELLIPSE_KZ
50 #if GVF_PARAMETRIC_CONTROL_STEP_ADAPTATION > 0
51 #define GVF_PARAMETRIC_3D_ELLIPSE_KZ 0.1
52 #else
53 #define GVF_PARAMETRIC_3D_ELLIPSE_KZ 0.001
54 #endif
55#endif
56
58#ifndef GVF_PARAMETRIC_3D_ELLIPSE_R
59 #define GVF_PARAMETRIC_3D_ELLIPSE_R 80
60#endif
61
63#ifndef GVF_PARAMETRIC_3D_ELLIPSE_ZL
64 #define GVF_PARAMETRIC_3D_ELLIPSE_ZL 40
65#endif
66
68#ifndef GVF_PARAMETRIC_3D_ELLIPSE_ZH
69 #define GVF_PARAMETRIC_3D_ELLIPSE_ZH 40
70#endif
71
73#ifndef GVF_PARAMETRIC_3D_ELLIPSE_ALPHA
74 #define GVF_PARAMETRIC_3D_ELLIPSE_ALPHA 0
75#endif
76
82
83#ifdef FIXEDWING_FIRMWARE
84
85static int gvf_parametric_p_len_wps = 0;
86
89// 3D ELLIPSE
90
91bool nav_gvf_parametric_3D_ellipse_XYZ(float xo, float yo, float r, float zl, float zh, float alpha)
92{
93 horizontal_mode = HORIZONTAL_MODE_CIRCLE; // Circle for the 2D GCS
94
95 // Safety first! If the asked altitude is low
96 if (zl > zh) {
97 zl = zh;
98 }
99 if (zl < 1 || zh < 1) {
100 zl = 10;
101 zh = 10;
102 }
103 if (r < 1) {
104 r = 60;
105 }
106
116
117 float f1, f2, f3, f1d, f2d, f3d, f1dd, f2dd, f3dd;
119
123
124 return true;
125}
126
127bool nav_gvf_parametric_3D_ellipse_wp(uint8_t wp, float r, float zl, float zh, float alpha)
128{
131
133 return true;
134}
135
136bool nav_gvf_parametric_3D_ellipse_wp_delta(uint8_t wp, float r, float alt_center, float delta, float alpha)
137{
138 float zl = alt_center - delta;
139 float zh = alt_center + delta;
140
142 return true;
143}
144
145#endif
struct point waypoints[NB_WAYPOINT]
size == nb_waypoint, waypoint 0 is a dummy waypoint
Definition common_nav.c:44
void gvf_parametric_3d_ellipse_info(float *f1, float *f2, float *f3, float *f1d, float *f2d, float *f3d, float *f1dd, float *f2dd, float *f3dd, float wb)
gvf_parametric_tra gvf_parametric_trajectory
@ ELLIPSE_3D
enum trajectories_parametric type
gvf_parametric_con gvf_parametric_control
Guiding vector field algorithm for 2D and 3D parametric trajectories.
void gvf_parametric_control_3D(float, float, float, float, float, float, float, float, float, float, float, float)
uint16_t foo
Definition main_demo5.c:58
uint8_t horizontal_mode
Definition nav.c:70
#define HORIZONTAL_MODE_CIRCLE
Definition nav.h:92
static int gvf_parametric_p_len_wps
#define GVF_PARAMETRIC_3D_ELLIPSE_KX
Guiding vector field algorithm for 2D and 3D complex trajectories.
#define GVF_PARAMETRIC_3D_ELLIPSE_KY
#define GVF_PARAMETRIC_3D_ELLIPSE_ZH
#define GVF_PARAMETRIC_3D_ELLIPSE_ALPHA
#define GVF_PARAMETRIC_3D_ELLIPSE_KZ
#define GVF_PARAMETRIC_3D_ELLIPSE_ZL
#define GVF_PARAMETRIC_3D_ELLIPSE_R
gvf_par_3d_ell_par gvf_parametric_3d_ellipse_par
bool nav_gvf_parametric_3D_ellipse_wp(uint8_t wp, float r, float zl, float zh, float alpha)
bool nav_gvf_parametric_3D_ellipse_wp_delta(uint8_t wp, float r, float alt_center, float delta, float alpha)
bool nav_gvf_parametric_3D_ellipse_XYZ(float xo, float yo, float r, float zl, float zh, float alpha)
float alpha
Definition textons.c:133
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.