Paparazzi UAS  v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
guidance_v_ref.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2008-2009 Antoine Drouin <poinix@gmail.com>
3  * Copyright (C) 2013 Gautier Hattenberger
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 
28 #ifndef GUIDANCE_V_REF_H
29 #define GUIDANCE_V_REF_H
30 
31 #include "inttypes.h"
32 #include "math/pprz_algebra.h"
33 #include "math/pprz_algebra_int.h"
34 #include "generated/airframe.h"
35 
36 #ifndef GUIDANCE_V_REF_MIN_ZD
37 #define GUIDANCE_V_REF_MIN_ZD (-3.)
38 #endif
39 
40 #ifndef GUIDANCE_V_REF_MAX_ZD
41 #define GUIDANCE_V_REF_MAX_ZD ( 3.)
42 #endif
43 
44 
47 #define GV_FREQ_FRAC 9
48 #define GV_FREQ (1<<GV_FREQ_FRAC)
49 
54 extern int32_t gv_zdd_ref;
55 
57 #define GV_ZDD_REF_FRAC 8
58 
63 extern int32_t gv_zd_ref;
64 
66 #define GV_ZD_REF_FRAC (GV_ZDD_REF_FRAC + GV_FREQ_FRAC)
67 
72 extern int64_t gv_z_ref;
73 
75 #define GV_Z_REF_FRAC (GV_ZD_REF_FRAC + GV_FREQ_FRAC)
76 
77 extern void gv_set_ref(int32_t alt, int32_t speed, int32_t accel);
78 extern void gv_update_ref_from_z_sp(int32_t z_sp);
79 
84 extern void gv_update_ref_from_zd_sp(int32_t zd_sp, int32_t z_pos);
85 
86 #endif /* GUIDANCE_V_REF_H */
gv_update_ref_from_zd_sp
void gv_update_ref_from_zd_sp(int32_t zd_sp, int32_t z_pos)
update vertical reference from speed setpoint.
Definition: guidance_v_ref.c:129
int64_t
signed long long int64_t
Definition: types.h:21
pprz_algebra_int.h
Paparazzi fixed point algebra.
gv_z_ref
int64_t gv_z_ref
reference model altitude in meters (output) fixed point representation with GV_Z_REF_FRAC Q37....
Definition: guidance_v_ref.c:47
gv_update_ref_from_z_sp
void gv_update_ref_from_z_sp(int32_t z_sp)
Definition: guidance_v_ref.c:95
int32_t
signed long int32_t
Definition: types.h:19
gv_zdd_ref
int32_t gv_zdd_ref
reference model vertical accel in meters/s^2 (output) fixed point representation with GV_ZDD_REF_FRAC...
Definition: guidance_v_ref.c:35
gv_set_ref
void gv_set_ref(int32_t alt, int32_t speed, int32_t accel)
Definition: guidance_v_ref.c:87
pprz_algebra.h
Paparazzi generic algebra macros.
inttypes.h
gv_zd_ref
int32_t gv_zd_ref
reference model vertical speed in meters/sec (output) fixed point representation with GV_ZD_REF_FRAC ...
Definition: guidance_v_ref.c:41