Paparazzi UAS  v5.14.0_stable-0-g3f680d1
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
stabilization_indi.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) Ewoud Smeur <ewoud_smeur@msn.com>
3  * MAVLab Delft University of Technology
4  *
5  * This file is part of paparazzi.
6  *
7  * paparazzi is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2, or (at your option)
10  * any later version.
11  *
12  * paparazzi is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with paparazzi; see the file COPYING. If not, write to
19  * the Free Software Foundation, 59 Temple Place - Suite 330,
20  * Boston, MA 02111-1307, USA.
21  */
22 
23 #ifndef STABILIZATION_INDI
24 #define STABILIZATION_INDI
25 
28 
29 //only 4 actuators supported for now
30 #define INDI_NUM_ACT 4
31 // outputs: roll, pitch, yaw, thrust
32 #define INDI_OUTPUTS 4
33 // Scaling for the control effectiveness to make it readible
34 #define INDI_G_SCALING 1000.0
35 
36 extern struct Int32Quat stab_att_sp_quat;
37 extern struct Int32Eulers stab_att_sp_euler;
38 extern float g1g2[INDI_OUTPUTS][INDI_NUM_ACT];
39 
40 extern bool indi_use_adaptive;
41 
43  float err_p;
44  float err_q;
45  float err_r;
46  float rate_p;
47  float rate_q;
48  float rate_r;
49 };
50 
52 
53 extern void stabilization_indi_init(void);
54 extern void stabilization_indi_enter(void);
56 extern void stabilization_indi_set_rpy_setpoint_i(struct Int32Eulers *rpy);
58 extern void stabilization_indi_run(bool in_flight, bool rate_control);
59 extern void stabilization_indi_read_rc(bool in_flight, bool in_carefree, bool coordinated_turn);
60 
61 #endif /* STABILIZATION_INDI */
62 
struct ReferenceSystem reference_acceleration
void stabilization_indi_set_earth_cmd_i(struct Int32Vect2 *cmd, int32_t heading)
Set attitude setpoint from command in earth axes.
bool indi_use_adaptive
struct Int32Quat stab_att_sp_quat
with INT32_QUAT_FRAC
static float heading
Definition: ahrs_infrared.c:45
void stabilization_indi_set_rpy_setpoint_i(struct Int32Eulers *rpy)
Set attitude quaternion setpoint from rpy.
void stabilization_indi_run(bool in_flight, bool rate_control)
runs stabilization indi
void stabilization_indi_set_failsafe_setpoint(void)
Function that calculates the failsafe setpoint.
Common data structures shared by euler and quaternion int implementations.
euler angles
#define INDI_NUM_ACT
struct Int32Eulers stab_att_sp_euler
with INT32_ANGLE_FRAC
signed long int32_t
Definition: types.h:19
#define INDI_OUTPUTS
void stabilization_indi_enter(void)
Function that resets important values upon engaging INDI.
void stabilization_indi_read_rc(bool in_flight, bool in_carefree, bool coordinated_turn)
This function reads rc commands.
Rotorcraft attitude reference generation.
Rotation quaternion.
float g1g2[INDI_OUTPUTS][INDI_NUM_ACT]
void stabilization_indi_init(void)
Function that initializes important values upon engaging INDI.