Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
stabilization.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 
26 #ifndef STABILIZATION_H
27 #define STABILIZATION_H
28 
29 #include "std.h"
30 
31 #include "generated/airframe.h"
32 #include "math/pprz_algebra_int.h"
34 
35 extern void stabilization_init(void);
36 extern void stabilization_filter_commands(void);
37 
43  enum {
49  } type;
50  enum {
53  } format;
54  union {
55  struct Int32Quat quat_i;
56  struct FloatQuat quat_f;
57  struct Int32Eulers eulers_i;
58  struct FloatEulers eulers_f;
59  struct { struct Int32Vect2 vect; int32_t heading; } ltp_i;
60  struct { struct FloatVect2 vect; float heading; } ltp_f;
61  } sp;
62  union {
63  struct Int32Rates rates_i;
64  struct FloatRates rates_f;
65  } r_sp;
66 };
67 
68 // helper convert functions
69 extern struct Int32Quat stab_sp_to_quat_i(struct StabilizationSetpoint *sp);
70 extern struct FloatQuat stab_sp_to_quat_f(struct StabilizationSetpoint *sp);
71 extern struct Int32Eulers stab_sp_to_eulers_i(struct StabilizationSetpoint *sp);
72 extern struct FloatEulers stab_sp_to_eulers_f(struct StabilizationSetpoint *sp);
73 extern struct Int32Rates stab_sp_to_rates_i(struct StabilizationSetpoint *sp);
74 extern struct FloatRates stab_sp_to_rates_f(struct StabilizationSetpoint *sp);
75 
76 // helper make functions
77 extern struct StabilizationSetpoint stab_sp_from_quat_i(struct Int32Quat *quat);
78 extern struct StabilizationSetpoint stab_sp_from_quat_f(struct FloatQuat *quat);
79 extern struct StabilizationSetpoint stab_sp_from_quat_ff_rates_f(struct FloatQuat *quat, struct FloatRates *rates);
80 extern struct StabilizationSetpoint stab_sp_from_eulers_i(struct Int32Eulers *eulers);
81 extern struct StabilizationSetpoint stab_sp_from_eulers_f(struct FloatEulers *eulers);
83 extern struct StabilizationSetpoint stab_sp_from_ltp_f(struct FloatVect2 *vect, float heading);
84 extern struct StabilizationSetpoint stab_sp_from_rates_i(struct Int32Rates *rates);
85 extern struct StabilizationSetpoint stab_sp_from_rates_f(struct FloatRates *rates);
86 
92 extern int32_t stabilization_cmd[COMMANDS_NB];
93 
94 #endif /* STABILIZATION_H */
euler angles
Roation quaternion.
angular rates
euler angles
Rotation quaternion.
angular rates
Paparazzi floating point algebra.
Paparazzi fixed point algebra.
struct StabilizationSetpoint stab_sp_from_ltp_i(struct Int32Vect2 *vect, int32_t heading)
struct FloatEulers stab_sp_to_eulers_f(struct StabilizationSetpoint *sp)
struct StabilizationSetpoint stab_sp_from_ltp_f(struct FloatVect2 *vect, float heading)
void stabilization_filter_commands(void)
struct StabilizationSetpoint stab_sp_from_rates_i(struct Int32Rates *rates)
struct Int32Rates stab_sp_to_rates_i(struct StabilizationSetpoint *sp)
struct StabilizationSetpoint stab_sp_from_quat_ff_rates_f(struct FloatQuat *quat, struct FloatRates *rates)
struct StabilizationSetpoint stab_sp_from_quat_f(struct FloatQuat *quat)
struct StabilizationSetpoint stab_sp_from_quat_i(struct Int32Quat *quat)
int32_t stabilization_cmd[COMMANDS_NB]
Stabilization commands.
Definition: stabilization.c:34
struct FloatRates stab_sp_to_rates_f(struct StabilizationSetpoint *sp)
struct StabilizationSetpoint stab_sp_from_eulers_f(struct FloatEulers *eulers)
struct Int32Quat stab_sp_to_quat_i(struct StabilizationSetpoint *sp)
struct StabilizationSetpoint stab_sp_from_eulers_i(struct Int32Eulers *eulers)
struct Int32Eulers stab_sp_to_eulers_i(struct StabilizationSetpoint *sp)
void stabilization_init(void)
Definition: stabilization.c:57
struct StabilizationSetpoint stab_sp_from_rates_f(struct FloatRates *rates)
struct FloatQuat stab_sp_to_quat_f(struct StabilizationSetpoint *sp)
Stabilization setpoint.
Definition: stabilization.h:42
enum StabilizationSetpoint::@272 format
@ STAB_SP_RATES
body rates
Definition: stabilization.h:47
@ STAB_SP_EULERS
LTP to Body orientation in euler angles.
Definition: stabilization.h:45
@ STAB_SP_LTP
banking and heading in LTP (NED) frame
Definition: stabilization.h:46
@ STAB_SP_QUAT_FF_RATE
LTP to Body orientation in unit quaternion with precomputed feedforward rates.
Definition: stabilization.h:48
@ STAB_SP_QUAT
LTP to Body orientation in unit quaternion.
Definition: stabilization.h:44
union StabilizationSetpoint::@273 sp
union StabilizationSetpoint::@274 r_sp
enum StabilizationSetpoint::@271 type
int int32_t
Typedef defining 32 bit int type.
Definition: vl53l1_types.h:83
float heading
Definition: wedgebug.c:258