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_common.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2023 Alfredo Gonzalez Calvin <alfredgo@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
21#ifndef GVF_COMMON_H
22#define GVF_COMMON_H
23
24#ifdef FIXEDWING_FIRMWARE
28#include "firmwares/fixedwing/guidance/guidance_v_n.h" // 3D low level control is only compatible with the new pprz controller!
29#define gvf_setNavMode(_navMode) (horizontal_mode = _navMode)
30#define GVF_MODE_ROUTE HORIZONTAL_MODE_ROUTE
31#define GVF_MODE_WAYPOINT HORIZONTAL_MODE_WAYPOINT
32#define GVF_MODE_CIRCLE HORIZONTAL_MODE_CIRCLE
33
34#elif defined(ROVER_FIRMWARE)
36#define gvf_setNavMode(_navMode) (nav.mode = _navMode)
37#define GVF_MODE_ROUTE NAV_MODE_ROUTE
38#define GVF_MODE_WAYPOINT NAV_MODE_WAYPOINT
39#define GVF_MODE_CIRCLE NAV_MODE_CIRCLE
40
41#elif defined(ROTORCRAFT_FIRMWARE)
43#define gvf_setNavMode(_navMode) (nav.horizontal_mode = _navMode)
44#define GVF_MODE_ROUTE NAV_HORIZONTAL_MODE_ROUTE
45#define GVF_MODE_WAYPOINT NAV_HORIZONTAL_MODE_WAYPOINT
46#define GVF_MODE_CIRCLE NAV_HORIZONTAL_MODE_CIRCLE
47
48#else
49#error "GVF does not support your firmware yet!"
50#endif
51
52#include "std.h"
53
54#define GVF_GRAVITY 9.806
55
61typedef struct {
62 float px;
63 float py;
64 float course;
65 float px_dot;
66 float py_dot;
68
73typedef struct{
74 float omega;
76
82typedef struct {
83 float kappa;
84 float ori_err;
86
92typedef struct {
93 float k_roll;
94 float k_climb;
96
101
104// Low level control functions
105extern void gvf_low_level_getState(void);
106extern void gvf_low_level_control_2D(float omega);
107extern void gvf_low_level_control_3D(float heading_rate, float climbing_rate);
108extern bool gvf_nav_approaching(float wp_x, float wp_y, float from_x, float from_y, float t);
109
110#endif // GVF_COMMON_H
Fixed wing horizontal control.
"New" vertical control for fixed wing vehicles.
gvf_common_ctrl gvf_c_ctrl
Definition gvf_common.c:28
gvf_common_params gvf_c_params
Definition gvf_common.c:30
void gvf_low_level_control_2D(float omega)
Definition gvf_common.c:58
gvf_common_info gvf_c_info
Definition gvf_common.c:29
void gvf_low_level_control_3D(float heading_rate, float climbing_rate)
Definition gvf_common.c:79
gvf_common_state gvf_c_state
Definition gvf_common.c:33
void gvf_low_level_getState(void)
Definition gvf_common.c:37
bool gvf_nav_approaching(float wp_x, float wp_y, float from_x, float from_y, float t)
Definition gvf_common.c:106
uint16_t foo
Definition main_demo5.c:58
Fixedwing Navigation library.
Rotorcraft navigation functions.
Rover navigation functions.