35 #ifndef NUMBER_OF_GAINSETS
36 #error You must define the number of gainsets to use this module!
39 #ifndef SCHEDULING_VARIABLE_FRAC
40 #define SCHEDULING_VARIABLE_FRAC 0
41 #pragma message "SCHEDULING_VARIABLE_FRAC not specified!"
44 #define INT32_RATIO_FRAC 12
53 int32_t phi_p[NUMBER_OF_GAINSETS] = PHI_P;
54 int32_t phi_d[NUMBER_OF_GAINSETS] = PHI_D;
55 int32_t phi_i[NUMBER_OF_GAINSETS] = PHI_I;
56 int32_t phi_dd[NUMBER_OF_GAINSETS] = PHI_DD;
58 int32_t theta_p[NUMBER_OF_GAINSETS] = THETA_P;
59 int32_t theta_d[NUMBER_OF_GAINSETS] = THETA_D;
60 int32_t theta_i[NUMBER_OF_GAINSETS] = THETA_I;
61 int32_t theta_dd[NUMBER_OF_GAINSETS] = THETA_DD;
63 int32_t psi_p[NUMBER_OF_GAINSETS] = PSI_P;
64 int32_t psi_d[NUMBER_OF_GAINSETS] = PSI_D;
65 int32_t psi_i[NUMBER_OF_GAINSETS] = PSI_I;
66 int32_t psi_dd[NUMBER_OF_GAINSETS] = PSI_DD;
68 for (
int i = 0;
i < NUMBER_OF_GAINSETS;
i++) {
71 {phi_p[
i], theta_p[
i], psi_p[
i] },
72 {phi_d[
i], theta_d[
i], psi_d[
i] },
73 {phi_dd[
i], theta_dd[
i], psi_dd[
i] },
74 {phi_i[
i], theta_i[
i], psi_i[
i] }
85 #if NUMBER_OF_GAINSETS > 1
91 if (section == NUMBER_OF_GAINSETS) {
break; }
101 }
else if (section == NUMBER_OF_GAINSETS) {
117 g1 = *(((int32_t *) ga) +
i);
119 g2 = *(((int32_t *) gb) +
i);
124 *(((int32_t *) gblend) +
i) = (int32_t) gbl;
void set_gainset(int gainset)
#define FLOAT_OF_BFP(_vbfp, _frac)
float scheduling_points[NUMBER_OF_GAINSETS]
void gain_scheduling_init(void)
Initialises periodic loop;.
#define SCHEDULING_VARIABLE_FRAC
#define BFP_OF_REAL(_vr, _frac)
void gain_scheduling_periodic(void)
Periodic function that interpolates between gain sets depending on the scheduling variable...
Module that interpolates between gain sets, depending on the scheduling variable. ...
struct Int32AttitudeGains stabilization_gains
General stabilization interface for rotorcrafts.
Horizontal guidance for rotorcrafts.
struct Int32AttitudeGains gainlibrary[NUMBER_OF_GAINSETS]
Paparazzi fixed point algebra.