21 #ifndef OPTICAL_FLOW_FUNCTIONS_H_
22 #define OPTICAL_FLOW_FUNCTIONS_H_
float cov_setpoint
for adaptive gain control, setpoint of the covariance (oscillations)
uint8_t cov_array_filledXY
float d_err
difference of error for the D-gain
float P
P-gain for control.
int32_t PID_divergence_control(float dt, struct OpticalFlowHoverControl *of_hover_ctrl)
Determine and set the thrust for constant divergence control.
struct OpticalFlowHover of_hover
float divergence
Divergence estimate.
struct GainsPID PID
The struct with the PID gains.
float flowX
Flow estimate in X direction.
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 previous_err
Previous tracking error.
float I
I-gain for control.
float input[COV_WINDOW_SIZE]
float PID_flow_control(float dt, struct OpticalFlowHoverControl *of_hover_ctrl)
Determine and set the desired angle for constant flow control.
float reduction_factor
Reduce the gain by this factor when oscillating.
float sum_err
integration of the error for I-gain
float past_OF[COV_WINDOW_SIZE]
float setpoint
setpoint for constant divergence/flow
float D
D-gain for control.
uint8_t cov_array_filledZ
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 flowY
Flow estimate in Y direction.
float nominal_value
The nominal value of thrust, phi or theta depending on Z, Y, X.
float OF[COV_WINDOW_SIZE]
float err
Current tracking error.
float ramp
The ramp pused is increased with per dt.
struct OFhistory historyX
struct OFhistory historyY
bool cov_method
method to calculate the covariance: between thrust and div / angle and flow (0) or div and div past /...
Paparazzi floating point algebra.
int int32_t
Typedef defining 32 bit int type.
unsigned int uint32_t
Typedef defining 32 bit unsigned int type.
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.