-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
stabilization_indi.h
62 lines (51 loc) · 2.21 KB
/
stabilization_indi.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/*
* Copyright (C) Ewoud Smeur <ewoud_smeur@msn.com>
* MAVLab Delft University of Technology
*
* This file is part of paparazzi.
*
* paparazzi is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* paparazzi is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with paparazzi; see the file COPYING. If not, write to
* the Free Software Foundation, 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef STABILIZATION_INDI
#define STABILIZATION_INDI
#include "firmwares/rotorcraft/stabilization/stabilization_attitude_common_int.h"
#include "firmwares/rotorcraft/stabilization/stabilization_attitude_ref_quat_int.h"
// Scaling for the control effectiveness to make it readible
#define INDI_G_SCALING 1000.0
extern struct Int32Quat stab_att_sp_quat; ///< with #INT32_QUAT_FRAC
extern struct Int32Eulers stab_att_sp_euler; ///< with #INT32_ANGLE_FRAC
extern float g1g2[INDI_OUTPUTS][INDI_NUM_ACT];
extern float actuator_state_filt_vect[INDI_NUM_ACT];
extern bool indi_use_adaptive;
extern float *Bwls[INDI_OUTPUTS];
struct ReferenceSystem {
float err_p;
float err_q;
float err_r;
float rate_p;
float rate_q;
float rate_r;
};
extern struct ReferenceSystem reference_acceleration;
extern void stabilization_indi_init(void);
extern void stabilization_indi_enter(void);
extern void stabilization_indi_set_failsafe_setpoint(void);
extern void stabilization_indi_set_rpy_setpoint_i(struct Int32Eulers *rpy);
extern void stabilization_indi_set_earth_cmd_i(struct Int32Vect2 *cmd, int32_t heading);
extern void stabilization_indi_calc_cmd(struct FloatRates rate_ref, bool in_flight)
extern void stabilization_indi_attitude_run(bool in_flight, struct Int32Quat quat_sp)
extern void stabilization_indi_read_rc(bool in_flight, bool in_carefree, bool coordinated_turn);
#endif /* STABILIZATION_INDI */