Paparazzi UAS  v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
guidance_OA.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2015 Roland + Clint
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 
26 #ifndef GUIDANCE_OA
27 #define GUIDANCE_OA
28 
29 #include "std.h"
31 //#include "inter_thread_data.h"
32 #include "math/pprz_algebra_int.h"
33 
34 /* The opticflow stabilization */
35 struct opticflow_stab_t {
40  float desired_vx;
41  float desired_vy;
42 
43  float err_vx_int;
44  float err_vy_int;
45  struct Int32Eulers cmd;
46 };
47 extern struct opticflow_stab_t opticflow_stab;
48 
49 extern int8_t filter_flag;
51 
53 extern oa_method OA_method_flag; //0 =>No OA only opticflow 1=pingpong 2=>pot_heading 3=>pot_vel 4=>vector 5=>safetyzone
54 
55 extern int8_t opti_speed_flag;
56 extern float vref_max;
57 
58 //variables form optic flow module
59 extern float ref_pitch;
60 extern float ref_roll;
61 extern float r_dot_new;
62 extern float speed_pot;
63 
64 // Implement own Horizontal loops
65 extern void guidance_h_module_init(void);
66 extern void guidance_h_module_enter(void);
67 extern void guidance_h_module_read_rc(void);
68 extern void guidance_h_module_run(bool in_flight);
69 
70 // Update the stabilization commands based on a vision result
71 extern void OA_update(void);
72 
73 #endif
OA_update
void OA_update(void)
Update the controls based on a vision result.
Definition: guidance_OA.c:189
oa_method
oa_method
Definition: guidance_OA.h:52
PINGPONG
@ PINGPONG
Definition: guidance_OA.h:52
opticflow_stab_t::phi_pgain
int32_t phi_pgain
The roll P gain on the err_vx.
Definition: guidance_opticflow_hover.h:38
opticflow_stab_t::desired_vx
float desired_vx
The desired velocity in the x direction (cm/s)
Definition: guidance_opticflow_hover.h:42
LOGICBASED
@ LOGICBASED
Definition: guidance_OA.h:52
opticflow_stab_t::theta_igain
int32_t theta_igain
The pitch I gain on the err_vy_int.
Definition: guidance_opticflow_hover.h:41
SAFETYZONE
@ SAFETYZONE
Definition: guidance_OA.h:52
repulsionforce_filter_flag
int8_t repulsionforce_filter_flag
Definition: guidance_OA.c:94
r_dot_new
float r_dot_new
Definition: guidance_OA.c:107
pprz_algebra_int.h
Paparazzi fixed point algebra.
guidance_h_module_enter
void guidance_h_module_enter(void)
Entering the horizontal module (user switched to module)
Definition: ctrl_module_innerloop_demo.c:85
opticflow_stab_t::err_vx_int
float err_vx_int
The integrated velocity error in x direction (m/s)
Definition: guidance_opticflow_hover.h:45
opticflow_stab_t::desired_vy
float desired_vy
The desired velocity in the y direction (cm/s)
Definition: guidance_opticflow_hover.h:43
std.h
speed_pot
float speed_pot
Definition: guidance_OA.c:110
filter_flag
int8_t filter_flag
Definition: guidance_OA.c:93
NO_OBSTACLE_AVOIDANCE
@ NO_OBSTACLE_AVOIDANCE
Definition: guidance_OA.h:52
v4l2.h
POT_HEADING
@ POT_HEADING
Definition: guidance_OA.h:52
OA_method_flag
oa_method OA_method_flag
Definition: guidance_OA.c:96
Int32Eulers
euler angles
Definition: pprz_algebra_int.h:146
opticflow_stab_t::theta_pgain
int32_t theta_pgain
The pitch P gain on the err_vy.
Definition: guidance_opticflow_hover.h:40
guidance_h_module_run
void guidance_h_module_run(bool in_flight)
Main guidance loop.
Definition: ctrl_module_innerloop_demo.c:99
int8_t
signed char int8_t
Definition: types.h:15
vref_max
float vref_max
Definition: guidance_OA.c:99
opticflow_stab_t::cmd
struct Int32Eulers cmd
The commands that are send to the hover loop.
Definition: guidance_opticflow_hover.h:47
int32_t
signed long int32_t
Definition: types.h:19
VECTOR
@ VECTOR
Definition: guidance_OA.h:52
ref_roll
float ref_roll
Definition: guidance_OA.c:104
opti_speed_flag
int8_t opti_speed_flag
Definition: guidance_OA.c:98
guidance_h_module_read_rc
void guidance_h_module_read_rc(void)
Read the RC commands.
Definition: ctrl_module_innerloop_demo.c:90
opticflow_stab
struct opticflow_stab_t opticflow_stab
Definition: guidance_opticflow_hover.c:90
opticflow_stab_t::phi_igain
int32_t phi_igain
The roll I gain on the err_vx_int.
Definition: guidance_opticflow_hover.h:39
opticflow_stab_t::err_vy_int
float err_vy_int
The integrated velocity error in y direction (m/s)
Definition: guidance_opticflow_hover.h:46
POT_VEL
@ POT_VEL
Definition: guidance_OA.h:52
ref_pitch
float ref_pitch
Definition: guidance_OA.c:103
opticflow_stab_t
Definition: guidance_opticflow_hover.h:37
guidance_h_module_init
void guidance_h_module_init(void)
Initialization of horizontal guidance module.
Definition: ctrl_module_innerloop_demo.c:80