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
gvf.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2016 Hector Garcia de Marina
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, write to
18 * the Free Software Foundation, 59 Temple Place - Suite 330,
19 * Boston, MA 02111-1307, USA.
20 *
21 */
22
28#ifndef GVF_H
29#define GVF_H
30
31#define GVF_GRAVITY 9.806
32
34#ifndef GVF_OCAML_GCS
35#define GVF_OCAML_GCS true
36#endif
37
38#include "std.h"
39
50typedef struct {
51 float ke;
52 float kn;
53 float error;
54 float omega;
55 float speed;
57 bool align;
58} gvf_con;
59
60extern gvf_con gvf_control;
61
62typedef struct {
63 float course;
64 float px_dot;
65 float py_dot;
66} gvf_st;
67
68extern gvf_st gvf_state;
69
71 LINE = 0,
74 NONE = 255,
75};
76
77typedef struct {
79 float p[16];
80} gvf_tra;
81
90typedef struct {
91 int seg;
92 float x1;
93 float y1;
94 float x2;
95 float y2;
96} gvf_seg;
97
99
100struct gvf_grad {
101 float nx;
102 float ny;
103 float nz;
104};
105
106struct gvf_Hess {
107 float H11;
108 float H12;
109 float H13;
110 float H21;
111 float H22;
112 float H23;
113 float H31;
114 float H32;
115 float H33;
116};
117
118extern void gvf_init(void);
119void gvf_control_2D(float ke, float kn, float e,
120 struct gvf_grad *, struct gvf_Hess *);
121extern void gvf_set_speed(float speed); // Rotorcraft only (for now)
122extern void gvf_set_align(bool align); // Rotorcraft only
123extern void gvf_set_direction(int8_t s);
124
125// Straight line
126extern bool gvf_line_XY_heading(float x, float y, float heading);
127extern bool gvf_line_XY1_XY2(float x1, float y1, float x2, float y2);
129extern bool gvf_segment_loop_XY1_XY2(float x1, float y1, float x2, float y2, float d1, float d2);
130extern bool gvf_segment_loop_wp1_wp2(uint8_t wp1, uint8_t wp2, float d1, float d2);
131extern bool gvf_segment_XY1_XY2(float x1, float y1, float x2, float y2);
133extern bool gvf_line_wp_heading(uint8_t wp, float heading);
134
135// Ellipse
136extern bool gvf_ellipse_wp(uint8_t wp, float a, float b, float alpha);
137extern bool gvf_ellipse_XY(float x, float y, float a, float b, float alpha);
138
139// Sinusoidal
140extern bool gvf_sin_XY_alpha(float x, float y, float alpha, float w, float off, float A);
141extern bool gvf_sin_wp1_wp2(uint8_t wp1, uint8_t wp2, float w, float off,
142 float A);
143extern bool gvf_sin_wp_alpha(uint8_t wp, float alpha, float w, float off,
144 float A);
145
146#endif // GVF_H
static uint16_t d1
static uint16_t d2
#define A
float ke
Definition gvf.h:51
float H13
Definition gvf.h:109
float x1
Definition gvf.h:92
float H12
Definition gvf.h:108
float error
Definition gvf.h:53
float py_dot
Definition gvf.h:65
enum trajectories type
Definition gvf.h:78
bool gvf_segment_XY1_XY2(float x1, float y1, float x2, float y2)
Definition gvf.c:382
float speed
Definition gvf.h:55
bool gvf_segment_loop_XY1_XY2(float x1, float y1, float x2, float y2, float d1, float d2)
Definition gvf.c:342
float H23
Definition gvf.h:112
bool gvf_ellipse_wp(uint8_t wp, float a, float b, float alpha)
Definition gvf.c:472
float H21
Definition gvf.h:110
int8_t s
Definition gvf.h:56
void gvf_set_align(bool align)
Definition gvf.c:259
bool gvf_line_wp1_wp2(uint8_t wp1, uint8_t wp2)
Definition gvf.c:328
float H11
Definition gvf.h:107
trajectories
Definition gvf.h:70
@ SIN
Definition gvf.h:73
@ ELLIPSE
Definition gvf.h:72
@ LINE
Definition gvf.h:71
@ NONE
Definition gvf.h:74
float ny
Definition gvf.h:102
gvf_con gvf_control
Definition gvf.c:36
bool gvf_sin_wp1_wp2(uint8_t wp1, uint8_t wp2, float w, float off, float A)
Definition gvf.c:508
bool gvf_segment_wp1_wp2(uint8_t wp1, uint8_t wp2)
Definition gvf.c:404
bool gvf_sin_wp_alpha(uint8_t wp, float alpha, float w, float off, float A)
Definition gvf.c:531
void gvf_init(void)
Definition gvf.c:116
float nz
Definition gvf.h:103
float nx
Definition gvf.h:101
void gvf_set_speed(float speed)
Definition gvf.c:253
bool align
Definition gvf.h:57
gvf_st gvf_state
Definition gvf.c:39
void gvf_set_direction(int8_t s)
Definition gvf.c:266
int seg
Definition gvf.h:91
bool gvf_line_XY_heading(float x, float y, float heading)
Definition gvf.c:297
bool gvf_sin_XY_alpha(float x, float y, float alpha, float w, float off, float A)
Definition gvf.c:483
float y1
Definition gvf.h:93
float H32
Definition gvf.h:114
gvf_tra gvf_trajectory
Definition gvf.c:42
float y2
Definition gvf.h:95
float course
Definition gvf.h:63
bool gvf_segment_loop_wp1_wp2(uint8_t wp1, uint8_t wp2, float d1, float d2)
Definition gvf.c:366
float px_dot
Definition gvf.h:64
void gvf_control_2D(float ke, float kn, float e, struct gvf_grad *, struct gvf_Hess *)
Definition gvf.c:131
float x2
Definition gvf.h:94
float H31
Definition gvf.h:113
float kn
Definition gvf.h:52
float H22
Definition gvf.h:111
float H33
Definition gvf.h:115
bool gvf_ellipse_XY(float x, float y, float a, float b, float alpha)
Definition gvf.c:433
bool gvf_line_wp_heading(uint8_t wp, float heading)
Definition gvf.c:418
bool gvf_line_XY1_XY2(float x1, float y1, float x2, float y2)
Definition gvf.c:304
float omega
Definition gvf.h:54
Definition gvf.h:50
Definition gvf.h:90
Definition gvf.h:62
Definition gvf.h:77
static float p[2][2]
static uint32_t s
uint16_t foo
Definition main_demo5.c:58
float alpha
Definition textons.c:133
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.
signed char int8_t
Typedef defining 8 bit char type.
float b
Definition wedgebug.c:202
float heading
Definition wedgebug.c:258