Paparazzi UAS  v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
stabilization_attitude_ref_quat_float.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_FLOAT_H
31 #define STABILIZATION_ATTITUDE_REF_QUAT_FLOAT_H
32 
33 #include "generated/airframe.h"
36 
37 #ifndef STABILIZATION_ATTITUDE_GAIN_NB
38 #define STABILIZATION_ATTITUDE_GAIN_NB 1
39 #endif
40 
42 struct FloatRefModel {
43  struct FloatRates omega;
44  struct FloatRates zeta;
47 };
48 
52  struct FloatQuat quat;
53  struct FloatRates rate;
54  struct FloatRates accel;
58 };
59 
60 
62 extern void attitude_ref_quat_float_enter(struct AttRefQuatFloat *ref, struct FloatQuat *state_quat);
63 extern void attitude_ref_quat_float_update(struct AttRefQuatFloat *ref, struct FloatQuat *sp_quat, float dt);
64 
65 
67 
68 extern void attitude_ref_quat_float_idx_set_omega_p(struct AttRefQuatFloat *ref, uint8_t idx, float omega);
69 extern void attitude_ref_quat_float_idx_set_omega_q(struct AttRefQuatFloat *ref, uint8_t idx, float omega);
70 extern void attitude_ref_quat_float_idx_set_omega_r(struct AttRefQuatFloat *ref, uint8_t idx, float omega);
71 extern void attitude_ref_quat_float_set_omega_p(struct AttRefQuatFloat *ref, float omega);
72 extern void attitude_ref_quat_float_set_omega_q(struct AttRefQuatFloat *ref, float omega);
73 extern void attitude_ref_quat_float_set_omega_r(struct AttRefQuatFloat *ref, float omega);
74 
75 
76 #endif /* STABILIZATION_ATTITUDE_REF_QUAT_FLOAT_H */
attitude_ref_quat_float_idx_set_omega_q
void attitude_ref_quat_float_idx_set_omega_q(struct AttRefQuatFloat *ref, uint8_t idx, float omega)
Definition: stabilization_attitude_ref_quat_float.c:146
attitude_ref_quat_float_enter
void attitude_ref_quat_float_enter(struct AttRefQuatFloat *ref, struct FloatQuat *state_quat)
Definition: stabilization_attitude_ref_quat_float.c:78
pprz_algebra_float.h
Paparazzi floating point algebra.
attitude_ref_quat_float_idx_set_omega_p
void attitude_ref_quat_float_idx_set_omega_p(struct AttRefQuatFloat *ref, uint8_t idx, float omega)
Definition: stabilization_attitude_ref_quat_float.c:140
AttRefQuatFloat::model
struct FloatRefModel model[STABILIZATION_ATTITUDE_GAIN_NB]
Definition: stabilization_attitude_ref_quat_float.h:56
idx
static uint32_t idx
Definition: nps_radio_control_spektrum.c:105
FloatRefModel
Attitude reference model parameters (float)
Definition: stabilization_attitude_ref_euler_float.h:29
FloatRefSat
Definition: attitude_ref_saturate_naive.h:32
FloatRefModel::two_omega2
struct FloatRates two_omega2
cached value of 2*omega*omega
Definition: stabilization_attitude_ref_quat_float.h:46
attitude_ref_quat_float_set_omega_q
void attitude_ref_quat_float_set_omega_q(struct AttRefQuatFloat *ref, float omega)
Definition: stabilization_attitude_ref_quat_float.c:163
FloatQuat
Roation quaternion.
Definition: pprz_algebra_float.h:63
AttRefQuatFloat::cur_idx
uint8_t cur_idx
Definition: stabilization_attitude_ref_quat_float.h:55
AttRefQuatFloat::euler
struct FloatEulers euler
Definition: stabilization_attitude_ref_quat_float.h:51
attitude_ref_quat_float_set_omega_r
void attitude_ref_quat_float_set_omega_r(struct AttRefQuatFloat *ref, float omega)
Definition: stabilization_attitude_ref_quat_float.c:168
uint8_t
unsigned char uint8_t
Definition: types.h:14
attitude_ref_quat_float_set_omega_p
void attitude_ref_quat_float_set_omega_p(struct AttRefQuatFloat *ref, float omega)
Definition: stabilization_attitude_ref_quat_float.c:158
AttRefQuatFloat::rate
struct FloatRates rate
Definition: stabilization_attitude_ref_quat_float.h:53
AttRefQuatFloat
Attitude reference models and state/output (float)
Definition: stabilization_attitude_ref_quat_float.h:50
attitude_ref_saturate_naive.h
AttRefQuatFloat::quat
struct FloatQuat quat
Definition: stabilization_attitude_ref_quat_float.h:52
STABILIZATION_ATTITUDE_GAIN_NB
#define STABILIZATION_ATTITUDE_GAIN_NB
Definition: stabilization_attitude_ref_quat_float.h:38
FloatRefModel::zeta
struct FloatRates zeta
Definition: stabilization_attitude_ref_euler_float.h:31
ref
uint16_t ref[TCOUPLE_NB]
Definition: temp_tcouple_adc.c:49
FloatEulers
euler angles
Definition: pprz_algebra_float.h:84
AttRefQuatFloat::accel
struct FloatRates accel
Definition: stabilization_attitude_ref_quat_float.h:54
FloatRefModel::omega
struct FloatRates omega
Definition: stabilization_attitude_ref_euler_float.h:30
attitude_ref_quat_float_init
void attitude_ref_quat_float_init(struct AttRefQuatFloat *ref)
Definition: stabilization_attitude_ref_quat_float.c:55
attitude_ref_quat_float_schedule
void attitude_ref_quat_float_schedule(struct AttRefQuatFloat *ref, uint8_t idx)
Definition: stabilization_attitude_ref_quat_float.c:177
AttRefQuatFloat::saturation
struct FloatRefSat saturation
Definition: stabilization_attitude_ref_quat_float.h:57
attitude_ref_quat_float_idx_set_omega_r
void attitude_ref_quat_float_idx_set_omega_r(struct AttRefQuatFloat *ref, uint8_t idx, float omega)
Definition: stabilization_attitude_ref_quat_float.c:152
FloatRates
angular rates
Definition: pprz_algebra_float.h:93
attitude_ref_quat_float_update
void attitude_ref_quat_float_update(struct AttRefQuatFloat *ref, struct FloatQuat *sp_quat, float dt)
Definition: stabilization_attitude_ref_quat_float.c:88