Paparazzi UAS  v5.14.0_stable-0-g3f680d1
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
stabilization_indi_simple.c
Go to the documentation of this file.
1 /*
2  * Copyright (C) Ewoud Smeur <ewoud_smeur@msn.com>
3  * MAVLab Delft University of Technology
4  *
5  * This file is part of paparazzi.
6  *
7  * paparazzi is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2, or (at your option)
10  * any later version.
11  *
12  * paparazzi is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with paparazzi; see the file COPYING. If not, write to
19  * the Free Software Foundation, 59 Temple Place - Suite 330,
20  * Boston, MA 02111-1307, USA.
21  */
22 
37 
38 #include "state.h"
39 #include "generated/airframe.h"
40 #include "paparazzi.h"
42 
43 #if !defined(STABILIZATION_INDI_ACT_DYN_P) && !defined(STABILIZATION_INDI_ACT_DYN_Q) && !defined(STABILIZATION_INDI_ACT_DYN_R)
44 #error You have to define the first order time constant of the actuator dynamics!
45 #endif
46 
47 // these parameters are used in the filtering of the angular acceleration
48 // define them in the airframe file if different values are required
49 #ifndef STABILIZATION_INDI_FILT_CUTOFF
50 #define STABILIZATION_INDI_FILT_CUTOFF 8.0
51 #endif
52 
53 // the yaw sometimes requires more filtering
54 #ifndef STABILIZATION_INDI_FILT_CUTOFF_R
55 #define STABILIZATION_INDI_FILT_CUTOFF_R STABILIZATION_INDI_FILT_CUTOFF
56 #endif
57 
58 #ifndef STABILIZATION_INDI_MAX_RATE
59 #define STABILIZATION_INDI_MAX_RATE 6.0
60 #endif
61 
62 #if STABILIZATION_INDI_USE_ADAPTIVE
63 #warning "Use caution with adaptive indi. See the wiki for more info"
64 #endif
65 
66 #ifndef STABILIZATION_INDI_MAX_R
67 #define STABILIZATION_INDI_MAX_R STABILIZATION_ATTITUDE_SP_MAX_R
68 #endif
69 
70 #ifndef STABILIZATION_INDI_ESTIMATION_FILT_CUTOFF
71 #define STABILIZATION_INDI_ESTIMATION_FILT_CUTOFF 4.0
72 #endif
73 
76 
77 static int32_t stabilization_att_indi_cmd[COMMANDS_NB];
78 static inline void stabilization_indi_calc_cmd(int32_t indi_commands[], struct Int32Quat *att_err, bool rate_control);
79 static inline void lms_estimation(void);
80 static void indi_init_filters(void);
81 
82 //The G values are scaled to avoid numerical problems during the estimation
83 #define INDI_EST_SCALE 0.001
84 
85 struct IndiVariables indi = {
87  .attitude_max_yaw_rate = STABILIZATION_INDI_MAX_R,
88 
89  .g1 = {STABILIZATION_INDI_G1_P, STABILIZATION_INDI_G1_Q, STABILIZATION_INDI_G1_R},
90  .g2 = STABILIZATION_INDI_G2_R,
91  .reference_acceleration = {
92  STABILIZATION_INDI_REF_ERR_P,
93  STABILIZATION_INDI_REF_ERR_Q,
94  STABILIZATION_INDI_REF_ERR_R,
95  STABILIZATION_INDI_REF_RATE_P,
96  STABILIZATION_INDI_REF_RATE_Q,
97  STABILIZATION_INDI_REF_RATE_R
98  },
99 
100  /* Estimation parameters for adaptive INDI */
101  .est = {
102  .g1 = {
103  STABILIZATION_INDI_G1_P / INDI_EST_SCALE,
104  STABILIZATION_INDI_G1_Q / INDI_EST_SCALE,
105  STABILIZATION_INDI_G1_R / INDI_EST_SCALE
106  },
107  .g2 = STABILIZATION_INDI_G2_R / INDI_EST_SCALE,
108  .mu = STABILIZATION_INDI_ADAPTIVE_MU,
109  },
110 
111 #if STABILIZATION_INDI_USE_ADAPTIVE
112  .adaptive = TRUE,
113 #else
114  .adaptive = FALSE,
115 #endif
116 };
117 
118 #if PERIODIC_TELEMETRY
120 
121 static void send_att_indi(struct transport_tx *trans, struct link_device *dev)
122 {
123  //The estimated G values are scaled, so scale them back before sending
124  struct FloatRates g1_disp;
125  RATES_SMUL(g1_disp, indi.est.g1, INDI_EST_SCALE);
126  float g2_disp = indi.est.g2 * INDI_EST_SCALE;
127 
128  pprz_msg_send_STAB_ATTITUDE_INDI(trans, dev, AC_ID,
129  &indi.rate_d[0],
130  &indi.rate_d[1],
131  &indi.rate_d[2],
132  &indi.angular_accel_ref.p,
133  &indi.angular_accel_ref.q,
134  &indi.angular_accel_ref.r,
135  &g1_disp.p,
136  &g1_disp.q,
137  &g1_disp.r,
138  &g2_disp);
139 }
140 
141 static void send_ahrs_ref_quat(struct transport_tx *trans, struct link_device *dev)
142 {
143  struct Int32Quat *quat = stateGetNedToBodyQuat_i();
144  pprz_msg_send_AHRS_REF_QUAT(trans, dev, AC_ID,
149  &(quat->qi),
150  &(quat->qx),
151  &(quat->qy),
152  &(quat->qz));
153 }
154 #endif
155 
157 {
158  // Initialize filters
160 
161 #if PERIODIC_TELEMETRY
162  register_periodic_telemetry(DefaultPeriodic, PPRZ_MSG_ID_STAB_ATTITUDE_INDI, send_att_indi);
164 #endif
165 }
166 
168 {
169  // tau = 1/(2*pi*Fc)
170  float tau = 1.0 / (2.0 * M_PI * STABILIZATION_INDI_FILT_CUTOFF);
171  float tau_r = 1.0 / (2.0 * M_PI * STABILIZATION_INDI_FILT_CUTOFF_R);
172  float tau_axis[3] = {tau, tau, tau_r};
173  float tau_est = 1.0 / (2.0 * M_PI * STABILIZATION_INDI_ESTIMATION_FILT_CUTOFF);
174  float sample_time = 1.0 / PERIODIC_FREQUENCY;
175  // Filtering of gyroscope and actuators
176  for (int8_t i = 0; i < 3; i++) {
177  init_butterworth_2_low_pass(&indi.u[i], tau_axis[i], sample_time, 0.0);
178  init_butterworth_2_low_pass(&indi.rate[i], tau_axis[i], sample_time, 0.0);
179  init_butterworth_2_low_pass(&indi.est.u[i], tau_est, sample_time, 0.0);
180  init_butterworth_2_low_pass(&indi.est.rate[i], tau_est, sample_time, 0.0);
181  }
182 }
183 
185 {
186  /* reset psi setpoint to current psi angle */
188 
191  FLOAT_RATES_ZERO(indi.u_in);
192 
193  // Re-initialize filters
195 }
196 
198 {
199  /* set failsafe to zero roll/pitch and current heading */
202  stab_att_sp_quat.qx = 0;
203  stab_att_sp_quat.qy = 0;
205 }
206 
213 {
214  // stab_att_sp_euler.psi still used in ref..
215  stab_att_sp_euler = *rpy;
216 
218 }
219 
227 {
228  // stab_att_sp_euler.psi still used in ref..
230 
231  // compute sp_euler phi/theta for debugging/telemetry
232  /* Rotate horizontal commands to body frame by psi */
234  int32_t s_psi, c_psi;
235  PPRZ_ITRIG_SIN(s_psi, psi);
236  PPRZ_ITRIG_COS(c_psi, psi);
237  stab_att_sp_euler.phi = (-s_psi * cmd->x + c_psi * cmd->y) >> INT32_TRIG_FRAC;
238  stab_att_sp_euler.theta = -(c_psi * cmd->x + s_psi * cmd->y) >> INT32_TRIG_FRAC;
239 
240  quat_from_earth_cmd_i(&stab_att_sp_quat, cmd, heading);
241 }
242 
249 static inline void filter_pqr(Butterworth2LowPass *filter, struct FloatRates *new_values)
250 {
251  update_butterworth_2_low_pass(&filter[0], new_values->p);
252  update_butterworth_2_low_pass(&filter[1], new_values->q);
253  update_butterworth_2_low_pass(&filter[2], new_values->r);
254 }
255 
263 static inline void finite_difference_from_filter(float *output, Butterworth2LowPass *filter)
264 {
265  for (int8_t i = 0; i < 3; i++) {
266  output[i] = (filter[i].o[0] - filter[i].o[1]) * PERIODIC_FREQUENCY;
267  }
268 }
269 
277 static inline void finite_difference(float output[3], float new[3], float old[3])
278 {
279  for (int8_t i = 0; i < 3; i++) {
280  output[i] = (new[i] - old[i])*PERIODIC_FREQUENCY;
281  }
282 }
283 
291 static inline void stabilization_indi_calc_cmd(int32_t indi_commands[], struct Int32Quat *att_err, bool rate_control)
292 {
293  // Propagate the filter on the gyroscopes and actuators
294  struct FloatRates *body_rates = stateGetBodyRates_f();
295  filter_pqr(indi.u, &indi.u_act_dyn);
296  filter_pqr(indi.rate, body_rates);
297 
298  // Calculate the derivative of the rates
300 
301  //The rates used for feedback are by default the measured rates. If needed they can be filtered (see below)
302  struct FloatRates rates_for_feedback;
303  RATES_COPY(rates_for_feedback, (*body_rates));
304 
305  //If there is a lot of noise on the gyroscope, it might be good to use the filtered value for feedback.
306  //Note that due to the delay, the PD controller can not be as aggressive.
307 #if STABILIZATION_INDI_FILTER_ROLL_RATE
308  rates_for_feedback.p = indi.rate[0].o[0];
309 #endif
310 #if STABILIZATION_INDI_FILTER_PITCH_RATE
311  rates_for_feedback.q = indi.rate[1].o[0];
312 #endif
313 #if STABILIZATION_INDI_FILTER_YAW_RATE
314  rates_for_feedback.r = indi.rate[2].o[0];
315 #endif
316 
318  - indi.reference_acceleration.rate_p * rates_for_feedback.p;
319 
321  - indi.reference_acceleration.rate_q * rates_for_feedback.q;
322 
323  //This separates the P and D controller and lets you impose a maximum yaw rate.
324  float rate_ref_r = indi.reference_acceleration.err_r * QUAT1_FLOAT_OF_BFP(att_err->qz) / indi.reference_acceleration.rate_r;
325  BoundAbs(rate_ref_r, indi.attitude_max_yaw_rate);
326  indi.angular_accel_ref.r = indi.reference_acceleration.rate_r * (rate_ref_r - rates_for_feedback.r);
327 
328  /* Check if we are running the rate controller and overwrite */
329  if (rate_control) {
330  indi.angular_accel_ref.p = indi.reference_acceleration.rate_p * ((float)radio_control.values[RADIO_ROLL] / MAX_PPRZ * indi.max_rate - body_rates->p);
331  indi.angular_accel_ref.q = indi.reference_acceleration.rate_q * ((float)radio_control.values[RADIO_PITCH] / MAX_PPRZ * indi.max_rate - body_rates->q);
332  indi.angular_accel_ref.r = indi.reference_acceleration.rate_r * ((float)radio_control.values[RADIO_YAW] / MAX_PPRZ * indi.max_rate - body_rates->r);
333  }
334 
335  //Increment in angular acceleration requires increment in control input
336  //G1 is the control effectiveness. In the yaw axis, we need something additional: G2.
337  //It takes care of the angular acceleration caused by the change in rotation rate of the propellers
338  //(they have significant inertia, see the paper mentioned in the header for more explanation)
339  indi.du.p = 1.0 / indi.g1.p * (indi.angular_accel_ref.p - indi.rate_d[0]);
340  indi.du.q = 1.0 / indi.g1.q * (indi.angular_accel_ref.q - indi.rate_d[1]);
341  indi.du.r = 1.0 / (indi.g1.r + indi.g2) * (indi.angular_accel_ref.r - indi.rate_d[2] + indi.g2 * indi.du.r);
342 
343  //add the increment to the total control input
344  indi.u_in.p = indi.u[0].o[0] + indi.du.p;
345  indi.u_in.q = indi.u[1].o[0] + indi.du.q;
346  indi.u_in.r = indi.u[2].o[0] + indi.du.r;
347 
348  //bound the total control input
349 #if STABILIZATION_INDI_FULL_AUTHORITY
350  Bound(indi.u_in.p, -9600, 9600);
351  Bound(indi.u_in.q, -9600, 9600);
352  float rlim = 9600 - fabs(indi.u_in.q);
353  Bound(indi.u_in.r, -rlim, rlim);
354  Bound(indi.u_in.r, -9600, 9600);
355 #else
356  Bound(indi.u_in.p, -4500, 4500);
357  Bound(indi.u_in.q, -4500, 4500);
358  Bound(indi.u_in.r, -4500, 4500);
359 #endif
360 
361  //Propagate input filters
362  //first order actuator dynamics
363  indi.u_act_dyn.p = indi.u_act_dyn.p + STABILIZATION_INDI_ACT_DYN_P * (indi.u_in.p - indi.u_act_dyn.p);
364  indi.u_act_dyn.q = indi.u_act_dyn.q + STABILIZATION_INDI_ACT_DYN_Q * (indi.u_in.q - indi.u_act_dyn.q);
365  indi.u_act_dyn.r = indi.u_act_dyn.r + STABILIZATION_INDI_ACT_DYN_R * (indi.u_in.r - indi.u_act_dyn.r);
366 
367  //Don't increment if thrust is off
368  //TODO: this should be something more elegant, but without this the inputs
369  //will increment to the maximum before even getting in the air.
370  if (stabilization_cmd[COMMAND_THRUST] < 300) {
371  FLOAT_RATES_ZERO(indi.du);
373  FLOAT_RATES_ZERO(indi.u_in);
374  } else {
375  // only run the estimation if the commands are not zero.
376  lms_estimation();
377  }
378 
379  /* INDI feedback */
380  indi_commands[COMMAND_ROLL] = indi.u_in.p;
381  indi_commands[COMMAND_PITCH] = indi.u_in.q;
382  indi_commands[COMMAND_YAW] = indi.u_in.r;
383 }
384 
391 void stabilization_indi_run(bool in_flight __attribute__((unused)), bool rate_control)
392 {
393  /* attitude error */
394  struct Int32Quat att_err;
395  struct Int32Quat *att_quat = stateGetNedToBodyQuat_i();
396  int32_quat_inv_comp(&att_err, att_quat, &stab_att_sp_quat);
397  /* wrap it in the shortest direction */
398  int32_quat_wrap_shortest(&att_err);
399  int32_quat_normalize(&att_err);
400 
401  /* compute the INDI command */
403 
404  /* copy the INDI command */
405  stabilization_cmd[COMMAND_ROLL] = stabilization_att_indi_cmd[COMMAND_ROLL];
406  stabilization_cmd[COMMAND_PITCH] = stabilization_att_indi_cmd[COMMAND_PITCH];
407  stabilization_cmd[COMMAND_YAW] = stabilization_att_indi_cmd[COMMAND_YAW];
408 
409  /* bound the result */
410  BoundAbs(stabilization_cmd[COMMAND_ROLL], MAX_PPRZ);
411  BoundAbs(stabilization_cmd[COMMAND_PITCH], MAX_PPRZ);
412  BoundAbs(stabilization_cmd[COMMAND_YAW], MAX_PPRZ);
413 }
414 
420 void stabilization_indi_read_rc(bool in_flight, bool in_carefree, bool coordinated_turn)
421 {
422  struct FloatQuat q_sp;
423 #if USE_EARTH_BOUND_RC_SETPOINT
424  stabilization_attitude_read_rc_setpoint_quat_earth_bound_f(&q_sp, in_flight, in_carefree, coordinated_turn);
425 #else
426  stabilization_attitude_read_rc_setpoint_quat_f(&q_sp, in_flight, in_carefree, coordinated_turn);
427 #endif
429 }
430 
437 static inline void lms_estimation(void)
438 {
439  static struct IndiEstimation *est = &indi.est;
440  // Only pass really low frequencies so you don't adapt to noise
441  struct FloatRates *body_rates = stateGetBodyRates_f();
442  filter_pqr(est->u, &indi.u_act_dyn);
443  filter_pqr(est->rate, body_rates);
444 
445  // Calculate the first and second derivatives of the rates and actuators
446  float rate_d_prev[3];
447  float u_d_prev[3];
448  float_vect_copy(rate_d_prev, est->rate_d, 3);
449  float_vect_copy(u_d_prev, est->u_d, 3);
451  finite_difference_from_filter(est->u_d, est->u);
452  finite_difference(est->rate_dd, est->rate_d, rate_d_prev);
453  finite_difference(est->u_dd, est->u_d, u_d_prev);
454 
455  // The inputs are scaled in order to avoid overflows
456  float du[3];
457  float_vect_copy(du, est->u_d, 3);
459  est->g1.p = est->g1.p - (est->g1.p * du[0] - est->rate_dd[0]) * du[0] * est->mu;
460  est->g1.q = est->g1.q - (est->g1.q * du[1] - est->rate_dd[1]) * du[1] * est->mu;
461  float ddu = est->u_dd[2] * INDI_EST_SCALE / PERIODIC_FREQUENCY;
462  float error = (est->g1.r * du[2] + est->g2 * ddu - est->rate_dd[2]);
463  est->g1.r = est->g1.r - error * du[2] * est->mu / 3;
464  est->g2 = est->g2 - error * 1000 * ddu * est->mu / 3;
465 
466  //the g values should be larger than zero, otherwise there is positive feedback, the command will go to max and there is nothing to learn anymore...
467  if (est->g1.p < 0.01) { est->g1.p = 0.01; }
468  if (est->g1.q < 0.01) { est->g1.q = 0.01; }
469  if (est->g1.r < 0.01) { est->g1.r = 0.01; }
470  if (est->g2 < 0.01) { est->g2 = 0.01; }
471 
472  if (indi.adaptive) {
473  //Commit the estimated G values and apply the scaling
474  indi.g1.p = est->g1.p * INDI_EST_SCALE;
475  indi.g1.q = est->g1.q * INDI_EST_SCALE;
476  indi.g1.r = est->g1.r * INDI_EST_SCALE;
477  indi.g2 = est->g2 * INDI_EST_SCALE;
478  }
479 }
int32_t psi
in rad with INT32_ANGLE_FRAC
struct Int32Quat stab_att_sp_quat
with INT32_QUAT_FRAC
static float update_butterworth_2_low_pass(Butterworth2LowPass *filter, float value)
Update second order Butterworth low pass filter state with a new value.
#define RADIO_ROLL
Definition: intermcu_ap.h:40
#define STABILIZATION_INDI_MAX_R
void stabilization_attitude_read_rc_setpoint_quat_f(struct FloatQuat *q_sp, bool in_flight, bool in_carefree, bool coordinated_turn)
Read attitude setpoint from RC as quaternion Interprets the stick positions as axes.
static void init_butterworth_2_low_pass(Butterworth2LowPass *filter, float tau, float sample_time, float value)
Init a second order Butterworth filter.
static void int32_quat_normalize(struct Int32Quat *q)
normalize a quaternion inplace
bool adaptive
Enable adataptive estimation.
void int32_quat_inv_comp(struct Int32Quat *b2c, struct Int32Quat *a2b, struct Int32Quat *a2c)
Composition (multiplication) of two quaternions.
struct ReferenceSystem reference_acceleration
#define STABILIZATION_INDI_MAX_RATE
static void indi_init_filters(void)
Quaternion transformation functions.
struct FloatRates du
struct FloatRates g1
void stabilization_indi_read_rc(bool in_flight, bool in_carefree, bool coordinated_turn)
This function reads rc commands.
static void send_att_indi(struct transport_tx *trans, struct link_device *dev)
Periodic telemetry system header (includes downlink utility and generated code).
General attitude stabilization interface for rotorcrafts.
#define INDI_EST_SCALE
void stabilization_indi_enter(void)
Function that resets important values upon engaging INDI.
int32_t theta
in rad with INT32_ANGLE_FRAC
struct FloatRates u_in
static void send_ahrs_ref_quat(struct transport_tx *trans, struct link_device *dev)
void int32_quat_of_eulers(struct Int32Quat *q, struct Int32Eulers *e)
Quaternion from Euler angles.
int32_t stabilization_attitude_get_heading_i(void)
float r
in rad/s
Read an attitude setpoint from the RC.
float max_rate
Maximum rate in rate control in rad/s.
static void filter_pqr(Butterworth2LowPass *filter, struct FloatRates *new_values)
Update butterworth filter for p, q and r of a FloatRates struct.
#define FLOAT_RATES_ZERO(_r)
void stabilization_indi_set_failsafe_setpoint(void)
Function that calculates the failsafe setpoint.
float q
in rad/s
float p
in rad/s
pprz_t values[RADIO_CONTROL_NB_CHANNEL]
Definition: radio_control.h:69
static struct Int32Quat * stateGetNedToBodyQuat_i(void)
Get vehicle body attitude quaternion (int).
Definition: state.h:1113
#define FALSE
Definition: std.h:5
void stabilization_indi_init(void)
Function that initializes important values upon engaging INDI.
float o[2]
output history
Roation quaternion.
static void stabilization_indi_calc_cmd(int32_t indi_commands[], struct Int32Quat *att_err, bool rate_control)
Does the INDI calculations.
void stabilization_attitude_read_rc_setpoint_quat_earth_bound_f(struct FloatQuat *q_sp, bool in_flight, bool in_carefree, bool coordinated_turn)
static void finite_difference(float output[3], float new[3], float old[3])
Calculate derivative of an array via finite difference.
void stabilization_indi_run(bool in_flight, bool rate_control)
runs stabilization indi
#define PPRZ_ITRIG_SIN(_s, _a)
#define TRUE
Definition: std.h:4
#define STABILIZATION_INDI_FILT_CUTOFF_R
struct IndiVariables indi
static float heading
Definition: ahrs_infrared.c:45
Butterworth2LowPass rate[3]
Butterworth2LowPass rate[3]
euler angles
static int32_t stabilization_att_indi_cmd[COMMANDS_NB]
#define QUAT_BFP_OF_REAL(_qi, _qf)
Definition: pprz_algebra.h:752
#define DefaultPeriodic
Set default periodic telemetry.
Definition: telemetry.h:66
static void lms_estimation(void)
This is a Least Mean Squares adaptive filter It estimates the actuator effectiveness online...
struct IndiEstimation est
Estimation parameters for adaptive INDI.
struct Int32Eulers stab_att_sp_euler
with INT32_ANGLE_FRAC
#define STABILIZATION_INDI_ESTIMATION_FILT_CUTOFF
struct RadioControl radio_control
Definition: radio_control.c:30
static void finite_difference_from_filter(float *output, Butterworth2LowPass *filter)
Caclulate finite difference form a filter array The filter already contains the previous values...
void quat_from_earth_cmd_i(struct Int32Quat *quat, struct Int32Vect2 *cmd, int32_t heading)
#define RATES_SMUL(_ro, _ri, _s)
Definition: pprz_algebra.h:379
void stabilization_indi_set_rpy_setpoint_i(struct Int32Eulers *rpy)
Set attitude quaternion setpoint from rpy.
static struct FloatRates * stateGetBodyRates_f(void)
Get vehicle body angular rate (float).
Definition: state.h:1200
signed long int32_t
Definition: types.h:19
#define QUAT1_FLOAT_OF_BFP(_qi)
static const struct usb_device_descriptor dev
Definition: usb_ser_hw.c:73
#define INT32_TRIG_FRAC
#define STABILIZATION_INDI_FILT_CUTOFF
void stabilization_indi_set_earth_cmd_i(struct Int32Vect2 *cmd, int32_t heading)
Set attitude setpoint from command in earth axes.
int32_t phi
in rad with INT32_ANGLE_FRAC
struct FloatRates angular_accel_ref
API to get/set the generic vehicle states.
#define RADIO_PITCH
Definition: intermcu_ap.h:41
Butterworth2LowPass u[3]
static void float_vect_scale(float *a, const float s, const int n)
a *= s
static void int32_quat_wrap_shortest(struct Int32Quat *q)
static void float_vect_copy(float *a, const float *b, const int n)
a = b
#define RADIO_YAW
Definition: intermcu_ap.h:42
int32_t stabilization_cmd[COMMANDS_NB]
Stabilization commands.
Definition: stabilization.c:32
#define RATES_COPY(_a, _b)
Definition: pprz_algebra.h:337
Second order low pass filter structure.
#define MAX_PPRZ
Definition: paparazzi.h:8
float attitude_max_yaw_rate
Maximum yaw rate in atttiude control in rad/s.
Butterworth2LowPass u[3]
signed char int8_t
Definition: types.h:15
static struct Int32Eulers * stateGetNedToBodyEulers_i(void)
Get vehicle body attitude euler angles (int).
Definition: state.h:1125
Rotation quaternion.
angular rates
struct FloatRates u_act_dyn
int8_t register_periodic_telemetry(struct periodic_telemetry *_pt, uint8_t _id, telemetry_cb _cb)
Register a telemetry callback function.
Definition: telemetry.c:46
struct FloatRates g1
#define PPRZ_ITRIG_COS(_c, _a)