Paparazzi UAS
v5.10_stable-5-g83a0da5-dirty
Paparazzi is a free software Unmanned Aircraft System.
|
This module implements optical flow landings in which the divergence is kept constant. More...
#include "std.h"
Go to the source code of this file.
Data Structures | |
struct | OpticalFlowLanding |
Macros | |
#define | COV_WINDOW_SIZE 60 |
#define | GUIDANCE_H_MODE_MODULE_SETTING GUIDANCE_H_MODE_HOVER |
#define | GUIDANCE_V_MODE_MODULE_SETTING GUIDANCE_V_MODE_MODULE |
Functions | |
float | get_cov (float *a, float *b, int n_elements) |
Get the covariance of two arrays. More... | |
float | get_mean_array (float *a, int n_elements) |
Get the mean value of an array. More... | |
void | reset_all_vars (void) |
Reset all variables: More... | |
void | guidance_v_module_init (void) |
void | guidance_v_module_enter (void) |
Entering the module (user switched to module) More... | |
void | guidance_v_module_run (bool in_flight) |
Variables | |
struct OpticalFlowLanding | of_landing_ctrl |
float | thrust_history [COV_WINDOW_SIZE] |
float | divergence_history [COV_WINDOW_SIZE] |
float | past_divergence_history [COV_WINDOW_SIZE] |
unsigned long | ind_hist |
This module implements optical flow landings in which the divergence is kept constant.
When using a fixed gain for control, the covariance between thrust and divergence is tracked, so that the drone knows when it has arrived close to the landing surface. Then, a final landing procedure is triggered. It can also be set to adaptive gain control, where the goal is to continuously gauge the distance to the landing surface. In this mode, the drone will oscillate all the way down to the surface.
de Croon, G.C.H.E. (2016). Monocular distance estimation with optical flow maneuvers and efference copies: a stability-based strategy. Bioinspiration & biomimetics, 11(1), 016004. http://iopscience.iop.org/article/10.1088/1748-3190/11/1/016004
Definition in file optical_flow_landing.h.
struct OpticalFlowLanding |
Definition at line 44 of file optical_flow_landing.h.
#define COV_WINDOW_SIZE 60 |
Definition at line 39 of file optical_flow_landing.h.
Referenced by guidance_v_module_enter(), reset_all_vars(), vertical_ctrl_module_init(), and vertical_ctrl_module_run().
#define GUIDANCE_H_MODE_MODULE_SETTING GUIDANCE_H_MODE_HOVER |
Definition at line 76 of file optical_flow_landing.h.
#define GUIDANCE_V_MODE_MODULE_SETTING GUIDANCE_V_MODE_MODULE |
Definition at line 79 of file optical_flow_landing.h.
float get_cov | ( | float * | a, |
float * | b, | ||
int | n_elements | ||
) |
Get the covariance of two arrays.
[out] | cov | The covariance |
[in] | *a | The first array |
[in] | *b | The second array |
[in] | n | Number of elements in the arrays |
Definition at line 459 of file optical_flow_landing.c.
References get_mean_array().
Referenced by vertical_ctrl_module_run().
float get_mean_array | ( | float * | a, |
int | n_elements | ||
) |
Get the mean value of an array.
[out] | mean | The mean value |
[in] | *a | The array |
[in] | n | Number of elements in the array |
Definition at line 440 of file optical_flow_landing.c.
Referenced by get_cov().
void guidance_v_module_enter | ( | void | ) |
Entering the module (user switched to module)
Definition at line 111 of file ctrl_module_demo.c.
void guidance_v_module_init | ( | void | ) |
Definition at line 105 of file ctrl_module_demo.c.
void guidance_v_module_run | ( | bool | in_flight | ) |
Definition at line 526 of file optical_flow_landing.c.
void reset_all_vars | ( | void | ) |
Reset all variables:
Definition at line 194 of file optical_flow_landing.c.
References OpticalFlowLanding::agl_lp, cov_div, OpticalFlowLanding::cov_set_point, COV_WINDOW_SIZE, divergence, divergence_history, OpticalFlowLanding::divergence_setpoint, dt, ind_hist, landing, normalized_thrust, of_landing_ctrl, previous_cov_err, previous_err, previous_message_nr, previous_time, stabilization_cmd, OpticalFlowLanding::sum_err, thrust_history, and vision_message_nr.
Referenced by vertical_ctrl_module_run().
float divergence_history[COV_WINDOW_SIZE] |
Definition at line 70 of file optical_flow_landing.h.
Referenced by guidance_v_module_enter(), reset_all_vars(), vertical_ctrl_module_init(), and vertical_ctrl_module_run().
unsigned long ind_hist |
Definition at line 72 of file optical_flow_landing.h.
Referenced by guidance_v_module_enter(), reset_all_vars(), vertical_ctrl_module_init(), and vertical_ctrl_module_run().
struct OpticalFlowLanding of_landing_ctrl |
Definition at line 123 of file optical_flow_landing.c.
Referenced by guidance_v_module_enter(), reset_all_vars(), send_divergence(), vertical_ctrl_agl_cb(), vertical_ctrl_module_init(), and vertical_ctrl_module_run().
float past_divergence_history[COV_WINDOW_SIZE] |
Definition at line 71 of file optical_flow_landing.h.
Referenced by vertical_ctrl_module_run().
float thrust_history[COV_WINDOW_SIZE] |
Definition at line 69 of file optical_flow_landing.h.
Referenced by guidance_v_module_enter(), reset_all_vars(), vertical_ctrl_module_init(), and vertical_ctrl_module_run().