Paparazzi UAS v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
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#define GVF_PARAMETRIC_3D_ELLIPSE_KX 0.001
33#endif
34
36#ifndef GVF_PARAMETRIC_3D_ELLIPSE_KY
37#define GVF_PARAMETRIC_3D_ELLIPSE_KY 0.001
38#endif
39
41#ifndef GVF_PARAMETRIC_3D_ELLIPSE_KZ
42#define GVF_PARAMETRIC_3D_ELLIPSE_KZ 0.001
43#endif
44
46#ifndef GVF_PARAMETRIC_3D_ELLIPSE_R
47#define GVF_PARAMETRIC_3D_ELLIPSE_R 80
48#endif
49
51#ifndef GVF_PARAMETRIC_3D_ELLIPSE_ZL
52#define GVF_PARAMETRIC_3D_ELLIPSE_ZL 40
53#endif
54
56#ifndef GVF_PARAMETRIC_3D_ELLIPSE_ZH
57#define GVF_PARAMETRIC_3D_ELLIPSE_ZH 40
58#endif
59
61#ifndef GVF_PARAMETRIC_3D_ELLIPSE_ALPHA
62#define GVF_PARAMETRIC_3D_ELLIPSE_ALPHA 0
63#endif
64
70
71#ifdef FIXEDWING_FIRMWARE
72
73static int gvf_parametric_p_len_wps = 0;
74
77// 3D ELLIPSE
78
79bool nav_gvf_parametric_3D_ellipse_XYZ(float xo, float yo, float r, float zl, float zh, float alpha)
80{
81 horizontal_mode = HORIZONTAL_MODE_CIRCLE; // Circle for the 2D GCS
82
83 // Safety first! If the asked altitude is low
84 if (zl > zh) {
85 zl = zh;
86 }
87 if (zl < 1 || zh < 1) {
88 zl = 10;
89 zh = 10;
90 }
91 if (r < 1) {
92 r = 60;
93 }
94
104
105 float f1, f2, f3, f1d, f2d, f3d, f1dd, f2dd, f3dd;
107
111
112 return true;
113}
114
115bool nav_gvf_parametric_3D_ellipse_wp(uint8_t wp, float r, float zl, float zh, float alpha)
116{
119
121 return true;
122}
123
124bool nav_gvf_parametric_3D_ellipse_wp_delta(uint8_t wp, float r, float alt_center, float delta, float alpha)
125{
126 float zl = alt_center - delta;
127 float zh = alt_center + delta;
128
130 return true;
131}
132
133#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.