Paparazzi UAS  v5.10_stable-5-g83a0da5-dirty
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
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
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  */
26 #ifndef GUIDANCE_OA
27 #define GUIDANCE_OA
29 #include "std.h"
31 //#include "inter_thread_data.h"
32 #include "math/pprz_algebra_int.h"
34 /* The opticflow stabilization */
35 struct opticflow_stab_t {
40  float desired_vx;
41  float desired_vy;
43  float err_vx_int;
44  float err_vy_int;
45  struct Int32Eulers cmd;
46 };
47 extern struct opticflow_stab_t opticflow_stab;
49 extern int8_t filter_flag;
53 extern oa_method OA_method_flag; //0 =>No OA only opticflow 1=pingpong 2=>pot_heading 3=>pot_vel 4=>vector 5=>safetyzone
55 extern int8_t opti_speed_flag;
56 extern float vref_max;
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;
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);
70 // Update the stabiliztion commands based on a vision result
71 extern void OA_update(void);
73 #endif
void guidance_h_module_enter(void)
Horizontal guidance mode enter resets the errors and starts the controller.
void guidance_h_module_run(bool in_flight)
Main guidance loop.
int8_t opti_speed_flag
Definition: guidance_OA.c:98
float ref_pitch
Definition: guidance_OA.c:103
void guidance_h_module_init(void)
Initialization of horizontal guidance module.
Capture images from a V4L2 device (Video for Linux 2)
float ref_roll
Definition: guidance_OA.c:104
void guidance_h_module_read_rc(void)
Read the RC commands.
int8_t filter_flag
Definition: guidance_OA.c:93
float r_dot_new
Definition: guidance_OA.c:107
float err_vx_int
The integrated velocity error in x direction (m/s)
float desired_vx
The desired velocity in the x direction (cm/s)
int32_t phi_pgain
The roll P gain on the err_vx.
int32_t theta_pgain
The pitch P gain on the err_vy.
int32_t theta_igain
The pitch I gain on the err_vy_int.
float speed_pot
Definition: guidance_OA.c:110
euler angles
int8_t repulsionforce_filter_flag
Definition: guidance_OA.c:94
struct Int32Eulers cmd
The commands that are send to the hover loop.
int32_t phi_igain
The roll I gain on the err_vx_int.
signed long int32_t
Definition: types.h:19
struct opticflow_stab_t opticflow_stab
float desired_vy
The desired velocity in the y direction (cm/s)
Definition: guidance_OA.h:52
signed char int8_t
Definition: types.h:15
float err_vy_int
The integrated velocity error in y direction (m/s)
oa_method OA_method_flag
Definition: guidance_OA.c:96
void OA_update(void)
Update the controls based on a vision result.
Definition: guidance_OA.c:189
Paparazzi fixed point algebra.
float vref_max
Definition: guidance_OA.c:99