Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
guidance_indi_hybrid.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2015 Ewoud Smeur <ewoud.smeur@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 GUIDANCE_INDI_HYBRID_H
31 #define GUIDANCE_INDI_HYBRID_H
32 
33 #include "std.h"
34 #include "math/pprz_algebra_int.h"
39 
40 
41 #ifndef GUIDANCE_INDI_HYBRID_U
42 #error Please use guidance_indi_hybrid_tailsitter or guidance_indi_hybrid_quadplane in your airframe file.
43 #endif
44 
45 
46 // TODO change names for _indi_hybrid_
47 
48 extern void guidance_indi_init(void);
49 extern void guidance_indi_enter(void);
50 extern float guidance_indi_get_liftd(float pitch, float theta);
51 extern void guidance_indi_calcg_wing(float Gmat[GUIDANCE_INDI_HYBRID_V][GUIDANCE_INDI_HYBRID_U], struct FloatVect3 a_diff, float v_body[GUIDANCE_INDI_HYBRID_V]);
52 
53 #if GUIDANCE_INDI_HYBRID_USE_WLS
54 #include "math/wls/wls_alloc.h"
55 extern struct WLS_t wls_guid_p;
56 extern void guidance_indi_hybrid_set_wls_settings(float body_v[3], float roll_angle, float pitch_angle);
57 #endif
58 
63 };
64 
69 };
70 
71 extern struct StabilizationSetpoint guidance_indi_run(struct FloatVect3 *accep_sp, float heading_sp);
72 extern struct StabilizationSetpoint guidance_indi_run_mode(bool in_flight, struct HorizontalGuidance *gh, struct VerticalGuidance *gv, enum GuidanceIndiHybrid_HMode h_mode, enum GuidanceIndiHybrid_VMode v_mode);
73 
75  float pos_gain;
76  float pos_gainz;
77  float speed_gain;
78  float speed_gainz;
80  float liftd_asq;
81  float liftd_p80;
82  float liftd_p50;
83 };
84 
85 extern struct FloatVect3 sp_accel;
86 extern struct FloatVect3 gi_speed_sp;
87 
88 extern float guidance_indi_pitch_pref_deg;
89 
90 #if GUIDANCE_INDI_HYBRID_USE_WLS
91 extern float Wu_gih[GUIDANCE_INDI_HYBRID_U];
92 extern float Wv_gih[GUIDANCE_INDI_HYBRID_V];
93 extern float du_min_gih[GUIDANCE_INDI_HYBRID_U];
94 extern float du_max_gih[GUIDANCE_INDI_HYBRID_U];
95 extern float du_pref_gih[GUIDANCE_INDI_HYBRID_U];
96 #endif
97 
98 extern float guidance_indi_thrust_z_eff;
99 
102 extern float guidance_indi_max_airspeed;
103 extern bool take_heading_control;
104 extern float guidance_indi_max_bank;
105 extern float guidance_indi_min_pitch;
106 extern bool force_forward;
108 
109 #endif /* GUIDANCE_INDI_HYBRID_H */
void guidance_indi_calcg_wing(float Gmat[GUIDANCE_INDI_HYBRID_V][GUIDANCE_INDI_HYBRID_U], struct FloatVect3 a_diff, float v_body[GUIDANCE_INDI_HYBRID_V])
Perform WLS.
bool force_forward
forward flight for hybrid nav
float guidance_indi_thrust_z_eff
float guidance_indi_get_liftd(float pitch, float theta)
struct guidance_indi_hybrid_params gih_params
struct FloatVect3 gi_speed_sp
float guidance_indi_min_pitch
float guidance_indi_max_bank
GuidanceIndiHybrid_VMode
@ GUIDANCE_INDI_HYBRID_V_POS
@ GUIDANCE_INDI_HYBRID_V_SPEED
@ GUIDANCE_INDI_HYBRID_V_ACCEL
struct StabilizationSetpoint guidance_indi_run_mode(bool in_flight, struct HorizontalGuidance *gh, struct VerticalGuidance *gv, enum GuidanceIndiHybrid_HMode h_mode, enum GuidanceIndiHybrid_VMode v_mode)
struct FloatVect3 sp_accel
Definition: guidance_indi.c:74
float guidance_indi_pitch_pref_deg
void guidance_indi_enter(void)
Call upon entering indi guidance.
bool take_heading_control
void guidance_indi_init(void)
Init function.
GuidanceIndiHybrid_HMode
@ GUIDANCE_INDI_HYBRID_H_SPEED
@ GUIDANCE_INDI_HYBRID_H_ACCEL
@ GUIDANCE_INDI_HYBRID_H_POS
float guidance_indi_specific_force_gain
float guidance_indi_max_airspeed
bool guidance_indi_airspeed_filtering
struct StabilizationSetpoint guidance_indi_run(struct FloatVect3 *accep_sp, float heading_sp)
void WEAK guidance_indi_hybrid_set_wls_settings(float body_v[3], float roll_angle, float pitch_angle)
Simple high pass filter with double precision.
Paparazzi floating point algebra.
Paparazzi fixed point algebra.
General stabilization interface for rotorcrafts.
Stabilization setpoint.
Definition: stabilization.h:53