|
Paparazzi UAS
v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
|
Go to the documentation of this file.
28 #define OFH_MAXBANK 10.f
33 #define OF_LP_CONST 0.5 // Average between 0.4 Bebop value and 0.6 ARDrone value
37 #ifndef OF_COV_DELAY_STEPS
38 #define OF_COV_DELAY_STEPS COV_WINDOW_SIZE/2
100 float normalized_phi = (float)(100.0 * inputs->
phi /
OFH_MAXBANK);
136 Bound(lp_factor, 0.
f, 1.
f);
141 of_hover_ctrl->
PID.
d_err) * lp_factor;
145 float des_angle = of_hover_ctrl->
PID.
P * of_hover_ctrl->
PID.
err + of_hover_ctrl->
PID.
I *
164 Bound(lp_factor, 0.
f, 1.
f);
169 of_hover_ctrl->
PID.
d_err) * lp_factor;
174 + of_hover_ctrl->
PID.
P * of_hover_ctrl->
PID.
err
float err
Current tracking error.
float D
D-gain for control.
float past_OF[COV_WINDOW_SIZE]
struct GainsPID PID
The struct with the PID gains.
int32_t PID_divergence_control(float dt, struct OpticalFlowHoverControl *of_hover_ctrl)
Determine and set the thrust for constant divergence control.
uint8_t cov_array_filledZ
float input[COV_WINDOW_SIZE]
float I
I-gain for control.
float previous_err
Previous tracking error.
struct OFhistory historyY
bool cov_method
method to calculate the covariance: between thrust and div / angle and flow (0) or div and div past /...
float flowX
Flow estimate in X direction.
float OF[COV_WINDOW_SIZE]
uint8_t cov_array_filledXY
float covariance_f(float *arr1, float *arr2, uint32_t n_elements)
Compute the covariance of two arrays V(X) = E[(X-E[X])(Y-E[Y])] = E[XY] - E[X]E[Y] where E[X] is the ...
uint16_t f
Camera baseline, in meters (i.e. horizontal distance between the two cameras of the stereo setup)
struct OpticalFlowHover of_hover
float divergence
Divergence estimate.
struct OFhistory historyX
float set_cov_div(bool cov_method, struct OFhistory *history, struct DesiredInputs *inputs)
Set the covariance of the divergence and the thrust / past divergence This funciton should only be ca...
float PID_flow_control(float dt, struct OpticalFlowHoverControl *of_hover_ctrl)
Determine and set the desired angle for constant flow control.
float sum_err
integration of the error for I-gain
float nominal_value
The nominal value of thrust, phi or theta depending on Z, Y, X.
float flowY
Flow estimate in Y direction.
#define OF_COV_DELAY_STEPS
void set_cov_flow(bool cov_method, struct OFhistory *historyX, struct OFhistory *historyY, struct DesiredInputs *inputs, struct FloatVect3 *covs)
Set the covariance of the flow and past flow / desired angle This funciton should only be called once...
float P
P-gain for control.
float d_err
difference of error for the D-gain