Paparazzi UAS  v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
optical_flow_landing.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2016
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 
44 #ifndef OPTICAL_FLOW_LANDING_H_
45 #define OPTICAL_FLOW_LANDING_H_
46 
47 #include "std.h"
48 
50  float agl;
51  float agl_lp;
52  float lp_const;
53  float vel;
55  float pgain;
56  float igain;
57  float dgain;
58  float divergence;
59  float previous_err;
60  float sum_err;
61  float d_err;
65  float cov_set_point;
66  float cov_limit;
75  float t_transition;
78 };
79 
81 
82 // Without optitrack set to: GUIDANCE_H_MODE_ATTITUDE
83 // With optitrack set to: GUIDANCE_H_MODE_HOVER / NAV
84 #define GUIDANCE_H_MODE_MODULE_SETTING GUIDANCE_H_MODE_NAV
85 
86 // Own guidance_v
87 #define GUIDANCE_V_MODE_MODULE_SETTING GUIDANCE_V_MODE_MODULE
88 
89 // Implement own Vertical loops
90 extern void guidance_v_module_init(void);
91 extern void guidance_v_module_enter(void);
92 extern void guidance_v_module_run(bool in_flight);
93 
94 #endif /* OPTICAL_FLOW_LANDING_H_ */
OpticalFlowLanding::window_size
uint32_t window_size
number of time steps in "window" used for getting the covariance
Definition: optical_flow_landing.h:72
OpticalFlowLanding::VISION_METHOD
uint32_t VISION_METHOD
whether to use vision (1) or Optitrack / sonar (0)
Definition: optical_flow_landing.h:63
OpticalFlowLanding::t_transition
float t_transition
how many seconds the drone has to be oscillating in order to transition to the hover phase with reduc...
Definition: optical_flow_landing.h:75
guidance_v_module_run
void guidance_v_module_run(bool in_flight)
Definition: optical_flow_hover.c:656
OpticalFlowLanding::lp_cov_div_factor
float lp_cov_div_factor
low-pass factor for the covariance of divergence in order to trigger the second landing phase in the ...
Definition: optical_flow_landing.h:74
OpticalFlowLanding::nominal_thrust
float nominal_thrust
nominal thrust around which the PID-control operates
Definition: optical_flow_landing.h:62
uint32_t
unsigned long uint32_t
Definition: types.h:18
OpticalFlowLanding::reduction_factor_elc
float reduction_factor_elc
reduction factor - after oscillation, how much to reduce the gain...
Definition: optical_flow_landing.h:73
guidance_v_module_enter
void guidance_v_module_enter(void)
Entering the vertical module (user switched to module)
Definition: ctrl_module_innerloop_demo.c:111
OpticalFlowLanding::agl_lp
float agl_lp
low-pass version of agl
Definition: optical_flow_landing.h:51
OpticalFlowLanding::COV_METHOD
uint32_t COV_METHOD
method to calculate the covariance: between thrust and div (0) or div and div past (1)
Definition: optical_flow_landing.h:70
OpticalFlowLanding::lp_const
float lp_const
low-pass filter constant
Definition: optical_flow_landing.h:52
OpticalFlowLanding::divergence_setpoint
float divergence_setpoint
setpoint for constant divergence approach
Definition: optical_flow_landing.h:54
OpticalFlowLanding::pgain_adaptive
float pgain_adaptive
P-gain for adaptive gain control.
Definition: optical_flow_landing.h:67
std.h
OpticalFlowLanding::CONTROL_METHOD
uint32_t CONTROL_METHOD
type of divergence control: 0 = fixed gain, 1 = adaptive gain
Definition: optical_flow_landing.h:64
OpticalFlowLanding::divergence
float divergence
Divergence estimate.
Definition: optical_flow_landing.h:58
guidance_v_module_init
void guidance_v_module_init(void)
Definition: ctrl_module_innerloop_demo.c:105
OpticalFlowLanding::elc_oscillate
bool elc_oscillate
Whether or not to oscillate at beginning of elc to find optimum gain.
Definition: optical_flow_landing.h:77
OpticalFlowLanding::igain
float igain
I-gain for constant divergence control.
Definition: optical_flow_landing.h:56
OpticalFlowLanding::igain_adaptive
float igain_adaptive
I-gain for adaptive gain control.
Definition: optical_flow_landing.h:68
OpticalFlowLanding::previous_err
float previous_err
Previous divergence tracking error.
Definition: optical_flow_landing.h:59
OpticalFlowLanding::d_err
float d_err
difference of error for the D-gain
Definition: optical_flow_landing.h:61
of_landing_ctrl
struct OpticalFlowLanding of_landing_ctrl
Definition: optical_flow_landing.c:157
OpticalFlowLanding::dgain
float dgain
D-gain for constant divergence control.
Definition: optical_flow_landing.h:57
OpticalFlowLanding::sum_err
float sum_err
integration of the error for I-gain
Definition: optical_flow_landing.h:60
OpticalFlowLanding::p_land_threshold
float p_land_threshold
if during the exponential landing the gain reaches this value, the final landing procedure is trigger...
Definition: optical_flow_landing.h:76
OpticalFlowLanding::cov_set_point
float cov_set_point
for adaptive gain control, setpoint of the covariance (oscillations)
Definition: optical_flow_landing.h:65
OpticalFlowLanding::cov_limit
float cov_limit
for fixed gain control, what is the cov limit triggering the landing
Definition: optical_flow_landing.h:66
OpticalFlowLanding::delay_steps
uint32_t delay_steps
number of delay steps for div past
Definition: optical_flow_landing.h:71
OpticalFlowLanding
Definition: optical_flow_landing.h:49
OpticalFlowLanding::pgain
float pgain
P-gain for constant divergence control (from divergence error to thrust)
Definition: optical_flow_landing.h:55
OpticalFlowLanding::agl
float agl
agl = height from sonar (only used when using "fake" divergence)
Definition: optical_flow_landing.h:50
OpticalFlowLanding::vel
float vel
vertical velocity as determined with sonar (only used when using "fake" divergence)
Definition: optical_flow_landing.h:53
OpticalFlowLanding::dgain_adaptive
float dgain_adaptive
D-gain for adaptive gain control.
Definition: optical_flow_landing.h:69