Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
stabilization_attitude_ref_quat_int.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2008-2009 Antoine Drouin <poinix@gmail.com>
3  *
4  * This file is part of paparazzi.
5  *
6  * paparazzi is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2, or (at your option)
9  * any later version.
10  *
11  * paparazzi is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with paparazzi; see the file COPYING. If not, write to
18  * the Free Software Foundation, 59 Temple Place - Suite 330,
19  * Boston, MA 02111-1307, USA.
20  */
21 
30 #ifndef STABILIZATION_ATTITUDE_REF_QUAT_INT_H
31 #define STABILIZATION_ATTITUDE_REF_QUAT_INT_H
32 
35 
36 /* ref model is in float and then used to precompute ref values in int */
38 
40 struct IntRefModel {
41  struct FloatRates omega;
42  struct FloatRates zeta;
43  /* cached intermediate values in int */
45  struct Int32Rates two_omega2;
46 };
47 
49 struct AttRefQuatInt {
50  struct Int32Eulers euler;
51  struct Int32Quat quat;
52  struct Int32Rates rate;
53  struct Int32Rates accel;
54  struct IntRefModel model;
55  struct Int32RefSat saturation;
56 };
57 
58 extern void attitude_ref_quat_int_init(struct AttRefQuatInt *ref);
59 extern void attitude_ref_quat_int_enter(struct AttRefQuatInt *ref, struct Int32Quat *state_quat);
60 extern void attitude_ref_quat_int_update(struct AttRefQuatInt *ref, struct Int32Quat *sp_quat, float dt);
61 
62 extern void attitude_ref_quat_int_set_omega(struct AttRefQuatInt *ref, struct FloatRates *omega);
66 
67 extern void attitude_ref_quat_int_set_zeta(struct AttRefQuatInt *ref, struct FloatRates *zeta);
68 extern void attitude_ref_quat_int_set_zeta_p(struct AttRefQuatInt *ref, float zeta_p);
69 extern void attitude_ref_quat_int_set_zeta_q(struct AttRefQuatInt *ref, float zeta_q);
70 extern void attitude_ref_quat_int_set_zeta_r(struct AttRefQuatInt *ref, float zeta_r);
71 
72 extern void attitude_ref_quat_int_set_max_p(struct AttRefQuatInt *ref, float max_p);
73 extern void attitude_ref_quat_int_set_max_q(struct AttRefQuatInt *ref, float max_q);
74 extern void attitude_ref_quat_int_set_max_r(struct AttRefQuatInt *ref, float max_r);
75 extern void attitude_ref_quat_int_set_max_pdot(struct AttRefQuatInt *ref, float max_pdot);
76 extern void attitude_ref_quat_int_set_max_qdot(struct AttRefQuatInt *ref, float max_qdot);
77 extern void attitude_ref_quat_int_set_max_rdot(struct AttRefQuatInt *ref, float max_rdot);
78 
79 #endif /* STABILIZATION_ATTITUDE_REF_QUAT_INT_H */
Naive attitude reference saturation.
angular rates
euler angles
Rotation quaternion.
angular rates
float max_r
Definition: oneloop_andi.c:163
Paparazzi floating point algebra.
Rotorcraft attitude reference generation API.
static const float omega_r[]
static const float zeta_r[]
static const float omega_q[]
static const float omega_p[]
static const float zeta_q[]
static const float zeta_p[]
void attitude_ref_quat_int_update(struct AttRefQuatInt *ref, struct Int32Quat *sp_quat, float dt)
Propagate reference.
void attitude_ref_quat_int_enter(struct AttRefQuatInt *ref, struct Int32Quat *state_quat)
void attitude_ref_quat_int_set_max_rdot(struct AttRefQuatInt *ref, float max_rdot)
void attitude_ref_quat_int_set_zeta_r(struct AttRefQuatInt *ref, float zeta_r)
void attitude_ref_quat_int_init(struct AttRefQuatInt *ref)
void attitude_ref_quat_int_set_max_r(struct AttRefQuatInt *ref, float max_r)
struct Int32Rates rate
with REF_RATE_FRAC
void attitude_ref_quat_int_set_omega_r(struct AttRefQuatInt *ref, float omega_r)
struct Int32Eulers euler
with INT32_ANGLE_FRAC
void attitude_ref_quat_int_set_zeta(struct AttRefQuatInt *ref, struct FloatRates *zeta)
void attitude_ref_quat_int_set_zeta_q(struct AttRefQuatInt *ref, float zeta_q)
void attitude_ref_quat_int_set_omega(struct AttRefQuatInt *ref, struct FloatRates *omega)
void attitude_ref_quat_int_set_max_qdot(struct AttRefQuatInt *ref, float max_qdot)
void attitude_ref_quat_int_set_omega_q(struct AttRefQuatInt *ref, float omega_q)
void attitude_ref_quat_int_set_omega_p(struct AttRefQuatInt *ref, float omega_p)
struct Int32Rates accel
with REF_ACCEL_FRAC
void attitude_ref_quat_int_set_max_pdot(struct AttRefQuatInt *ref, float max_pdot)
void attitude_ref_quat_int_set_zeta_p(struct AttRefQuatInt *ref, float zeta_p)
void attitude_ref_quat_int_set_max_q(struct AttRefQuatInt *ref, float max_q)
void attitude_ref_quat_int_set_max_p(struct AttRefQuatInt *ref, float max_p)
Attitude reference models and state/output (quat int)
Attitude reference model parameters (quat int)
uint16_t ref[TCOUPLE_NB]