Paparazzi UAS  v5.18.0_stable
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 */
46 };
47 
49 struct AttRefQuatInt {
50  struct Int32Eulers euler;
51  struct Int32Quat quat;
52  struct Int32Rates rate;
53  struct Int32Rates accel;
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 */
attitude_ref_quat_int_set_omega_r
void attitude_ref_quat_int_set_omega_r(struct AttRefQuatInt *ref, float omega_r)
Definition: stabilization_attitude_ref_quat_int.c:205
AttRefQuatInt::euler
struct Int32Eulers euler
with INT32_ANGLE_FRAC
Definition: stabilization_attitude_ref_quat_int.h:50
AttRefQuatInt::quat
struct Int32Quat quat
Definition: stabilization_attitude_ref_quat_int.h:51
attitude_ref_quat_int_set_zeta
void attitude_ref_quat_int_set_zeta(struct AttRefQuatInt *ref, struct FloatRates *zeta)
Definition: stabilization_attitude_ref_quat_int.c:236
stabilization_attitude_ref_int.h
Int32Rates
angular rates
Definition: pprz_algebra_int.h:179
omega_p
static const float omega_p[]
Definition: stabilization_attitude_ref_quat_float.c:42
attitude_ref_quat_int_enter
void attitude_ref_quat_int_enter(struct AttRefQuatInt *ref, struct Int32Quat *state_quat)
Definition: stabilization_attitude_ref_quat_int.c:77
Int32Quat
Rotation quaternion.
Definition: pprz_algebra_int.h:99
attitude_ref_quat_int_set_zeta_p
void attitude_ref_quat_int_set_zeta_p(struct AttRefQuatInt *ref, float zeta_p)
Definition: stabilization_attitude_ref_quat_int.c:218
attitude_ref_quat_int_set_max_q
void attitude_ref_quat_int_set_max_q(struct AttRefQuatInt *ref, float max_q)
Definition: stabilization_attitude_ref_quat_int.c:248
AttRefQuatInt::saturation
struct Int32RefSat saturation
Definition: stabilization_attitude_ref_quat_int.h:55
attitude_ref_quat_int_set_max_pdot
void attitude_ref_quat_int_set_max_pdot(struct AttRefQuatInt *ref, float max_pdot)
Definition: stabilization_attitude_ref_quat_int.c:258
pprz_algebra_float.h
Paparazzi floating point algebra.
attitude_ref_quat_int_init
void attitude_ref_quat_int_init(struct AttRefQuatInt *ref)
Definition: stabilization_attitude_ref_quat_int.c:50
omega_q
static const float omega_q[]
Definition: stabilization_attitude_ref_quat_float.c:44
AttRefQuatInt::rate
struct Int32Rates rate
with REF_RATE_FRAC
Definition: stabilization_attitude_ref_quat_int.h:52
IntRefModel::omega
struct FloatRates omega
Definition: stabilization_attitude_ref_quat_int.h:41
attitude_ref_quat_int_set_omega
void attitude_ref_quat_int_set_omega(struct AttRefQuatInt *ref, struct FloatRates *omega)
Definition: stabilization_attitude_ref_quat_int.c:211
IntRefModel::two_zeta_omega
struct Int32Rates two_zeta_omega
Definition: stabilization_attitude_ref_quat_int.h:44
AttRefQuatInt::model
struct IntRefModel model
Definition: stabilization_attitude_ref_quat_int.h:54
Int32Eulers
euler angles
Definition: pprz_algebra_int.h:146
attitude_ref_quat_int_update
void attitude_ref_quat_int_update(struct AttRefQuatInt *ref, struct Int32Quat *sp_quat, float dt)
Propagate reference.
Definition: stabilization_attitude_ref_quat_int.c:97
attitude_ref_quat_int_set_max_r
void attitude_ref_quat_int_set_max_r(struct AttRefQuatInt *ref, float max_r)
Definition: stabilization_attitude_ref_quat_int.c:253
Int32RefSat
Definition: attitude_ref_saturate_naive.h:37
attitude_ref_quat_int_set_max_rdot
void attitude_ref_quat_int_set_max_rdot(struct AttRefQuatInt *ref, float max_rdot)
Definition: stabilization_attitude_ref_quat_int.c:268
attitude_ref_quat_int_set_zeta_q
void attitude_ref_quat_int_set_zeta_q(struct AttRefQuatInt *ref, float zeta_q)
Definition: stabilization_attitude_ref_quat_int.c:224
attitude_ref_saturate_naive.h
attitude_ref_quat_int_set_omega_p
void attitude_ref_quat_int_set_omega_p(struct AttRefQuatInt *ref, float omega_p)
Definition: stabilization_attitude_ref_quat_int.c:193
AttRefQuatInt
Attitude reference models and state/output (quat int)
Definition: stabilization_attitude_ref_quat_int.h:49
omega_r
static const float omega_r[]
Definition: stabilization_attitude_ref_quat_float.c:46
AttRefQuatInt::accel
struct Int32Rates accel
with REF_ACCEL_FRAC
Definition: stabilization_attitude_ref_quat_int.h:53
IntRefModel
Attitude reference model parameters (quat int)
Definition: stabilization_attitude_ref_quat_int.h:40
attitude_ref_quat_int_set_omega_q
void attitude_ref_quat_int_set_omega_q(struct AttRefQuatInt *ref, float omega_q)
Definition: stabilization_attitude_ref_quat_int.c:199
zeta_q
static const float zeta_q[]
Definition: stabilization_attitude_ref_quat_float.c:45
attitude_ref_quat_int_set_max_p
void attitude_ref_quat_int_set_max_p(struct AttRefQuatInt *ref, float max_p)
Definition: stabilization_attitude_ref_quat_int.c:243
ref
uint16_t ref[TCOUPLE_NB]
Definition: temp_tcouple_adc.c:49
attitude_ref_quat_int_set_max_qdot
void attitude_ref_quat_int_set_max_qdot(struct AttRefQuatInt *ref, float max_qdot)
Definition: stabilization_attitude_ref_quat_int.c:263
zeta_r
static const float zeta_r[]
Definition: stabilization_attitude_ref_quat_float.c:47
IntRefModel::zeta
struct FloatRates zeta
Definition: stabilization_attitude_ref_quat_int.h:42
attitude_ref_quat_int_set_zeta_r
void attitude_ref_quat_int_set_zeta_r(struct AttRefQuatInt *ref, float zeta_r)
Definition: stabilization_attitude_ref_quat_int.c:230
IntRefModel::two_omega2
struct Int32Rates two_omega2
Definition: stabilization_attitude_ref_quat_int.h:45
FloatRates
angular rates
Definition: pprz_algebra_float.h:93
zeta_p
static const float zeta_p[]
Definition: stabilization_attitude_ref_quat_float.c:43