Paparazzi UAS  v6.2_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)
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 }
71 
stateGetHorizontalSpeedDir_f
static float stateGetHorizontalSpeedDir_f(void)
Get dir of horizontal ground speed (float).
Definition: state.h:944
gvf_low_level_control_2D
void gvf_low_level_control_2D(float omega)
Definition: gvf_low_level_control.c:52
gvf_low_level_getState
void gvf_low_level_getState(void)
Definition: gvf_low_level_control.c:35
AP_MODE_AUTO2
#define AP_MODE_AUTO2
Definition: autopilot_static.h:38
ground_speed
static float ground_speed
Definition: follow_me.c:76
gvf_st::py_dot
float py_dot
Definition: gvf.h:55
LATERAL_MODE_ROLL
#define LATERAL_MODE_ROLL
Definition: autopilot_firmware.h:38
stateGetNedToBodyEulers_f
static struct FloatEulers * stateGetNedToBodyEulers_f(void)
Get vehicle body attitude euler angles (float).
Definition: state.h:1143
h_ctl_roll_max_setpoint
float h_ctl_roll_max_setpoint
Definition: stabilization_adaptive.c:85
stabilization_attitude.h
h_ctl_roll_setpoint
float h_ctl_roll_setpoint
Definition: stabilization_adaptive.c:157
EnuCoor_f::y
float y
in meters
Definition: pprz_geodetic_float.h:74
FloatEulers::theta
float theta
in radians
Definition: pprz_algebra_float.h:86
gvf_state
gvf_st gvf_state
Definition: gvf.c:37
lateral_mode
uint8_t lateral_mode
Definition: autopilot_firmware.c:38
gvf.h
gvf_st::px_dot
float px_dot
Definition: gvf.h:54
autopilot.h
gvf_low_level_control.h
course
static int16_t course[3]
Definition: airspeed_uADC.c:58
stateGetHorizontalSpeedNorm_f
static float stateGetHorizontalSpeedNorm_f(void)
Get norm of horizontal ground speed (float).
Definition: state.h:935
gvf_st::course
float course
Definition: gvf.h:53
stateGetSpeedEnu_f
static struct EnuCoor_f * stateGetSpeedEnu_f(void)
Get ground speed in local ENU coordinates (float).
Definition: state.h:917
GVF_GRAVITY
#define GVF_GRAVITY
Definition: gvf.h:31
FloatEulers
euler angles
Definition: pprz_algebra_float.h:84
EnuCoor_f::x
float x
in meters
Definition: pprz_geodetic_float.h:73
autopilot_get_mode
uint8_t autopilot_get_mode(void)
get autopilot mode
Definition: autopilot.c:216
FloatEulers::psi
float psi
in radians
Definition: pprz_algebra_float.h:87