Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
gvf_low_level_control.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 
27 #include "autopilot.h"
30 
31 #if defined(FIXEDWING_FIRMWARE)
33 #endif
34 
36 {
37  #if defined(FIXEDWING_FIRMWARE)
42 
43  #elif defined(ROVER_FIRMWARE) || defined(ROTORCRAFT_FIRMWARE)
44  // We assume that the course and psi
45  // of the rover (steering wheel) are the same
49  #endif
50 }
51 
52 void gvf_low_level_control_2D(float omega)
53 {
54 
55 #if defined(FIXEDWING_FIRMWARE)
57 
58  // Coordinated turn
59  struct FloatEulers *att = stateGetNedToBodyEulers_f();
61 
63 
65  -atanf(omega * ground_speed / GVF_GRAVITY / cosf(att->theta));
67  }
68 #endif
69 
70  (void)(omega); // Avoid unused parameter warning
71 }
72 
uint8_t autopilot_get_mode(void)
get autopilot mode
Definition: autopilot.c:222
Core autopilot interface common to all firmwares.
static float ground_speed
Definition: follow_me.c:76
uint8_t lateral_mode
#define LATERAL_MODE_ROLL
#define AP_MODE_AUTO2
Fixed wing horizontal control.
float theta
in radians
float psi
in radians
euler angles
static struct FloatEulers * stateGetNedToBodyEulers_f(void)
Get vehicle body attitude euler angles (float).
Definition: state.h:1306
static float stateGetHorizontalSpeedNorm_f(void)
Get norm of horizontal ground speed (float).
Definition: state.h:1076
static float stateGetHorizontalSpeedDir_f(void)
Get dir of horizontal ground speed (float).
Definition: state.h:1085
static struct EnuCoor_f * stateGetSpeedEnu_f(void)
Get ground speed in local ENU coordinates (float).
Definition: state.h:1058
gvf_st gvf_state
Definition: gvf.c:39
Guidance algorithm based on vector fields.
float py_dot
Definition: gvf.h:65
#define GVF_GRAVITY
Definition: gvf.h:31
float course
Definition: gvf.h:63
float px_dot
Definition: gvf.h:64
void gvf_low_level_control_2D(float omega)
void gvf_low_level_getState(void)
Firmware dependent file for the guiding vector field algorithm for 2D trajectories.
float y
in meters
float x
in meters
float h_ctl_roll_max_setpoint
float h_ctl_roll_setpoint