Paparazzi UAS  v5.15_devel-81-gd13dafb
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
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, int32_t psi);
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 */
void attitude_ref_quat_int_set_max_q(struct AttRefQuatInt *ref, float max_q)
angular rates
struct Int32Rates rate
with REF_RATE_FRAC
static const float zeta_p[]
void attitude_ref_quat_int_set_max_rdot(struct AttRefQuatInt *ref, float max_rdot)
void attitude_ref_quat_int_set_max_p(struct AttRefQuatInt *ref, float max_p)
void attitude_ref_quat_int_set_omega_p(struct AttRefQuatInt *ref, float omega_p)
static const float omega_r[]
static const float zeta_r[]
uint16_t ref[TCOUPLE_NB]
void attitude_ref_quat_int_set_omega_r(struct AttRefQuatInt *ref, float omega_r)
void attitude_ref_quat_int_set_max_qdot(struct AttRefQuatInt *ref, float max_qdot)
void attitude_ref_quat_int_enter(struct AttRefQuatInt *ref, int32_t psi)
static const float zeta_q[]
static const float omega_q[]
void attitude_ref_quat_int_set_zeta_q(struct AttRefQuatInt *ref, float zeta_q)
Paparazzi floating point algebra.
void attitude_ref_quat_int_set_zeta_r(struct AttRefQuatInt *ref, float zeta_r)
Naive attitude reference saturation.
euler angles
void attitude_ref_quat_int_set_omega(struct AttRefQuatInt *ref, struct FloatRates *omega)
void attitude_ref_quat_int_init(struct AttRefQuatInt *ref)
signed long int32_t
Definition: types.h:19
struct Int32Eulers euler
with INT32_ANGLE_FRAC
void attitude_ref_quat_int_update(struct AttRefQuatInt *ref, struct Int32Quat *sp_quat, float dt)
Propagate reference.
Attitude reference model parameters (quat int)
Attitude reference models and state/output (quat int)
void attitude_ref_quat_int_set_omega_q(struct AttRefQuatInt *ref, float omega_q)
struct Int32Rates accel
with REF_ACCEL_FRAC
static const float omega_p[]
void attitude_ref_quat_int_set_zeta(struct AttRefQuatInt *ref, struct FloatRates *zeta)
Rotorcraft attitude reference generation API.
Rotation quaternion.
angular rates
void attitude_ref_quat_int_set_max_pdot(struct AttRefQuatInt *ref, float max_pdot)
void attitude_ref_quat_int_set_max_r(struct AttRefQuatInt *ref, float max_r)
void attitude_ref_quat_int_set_zeta_p(struct AttRefQuatInt *ref, float zeta_p)