Paparazzi UAS  v7.0_unstable
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 */
int32_t gv_zdd_ref
reference model vertical accel in meters/s^2 (output) fixed point representation with GV_ZDD_REF_FRAC...
int64_t gv_z_ref
reference model altitude in meters (output) fixed point representation with GV_Z_REF_FRAC Q37....
void gv_set_ref(int32_t alt, int32_t speed, int32_t accel)
void gv_update_ref_from_z_sp(int32_t z_sp)
void gv_update_ref_from_zd_sp(int32_t zd_sp, int32_t z_pos)
update vertical reference from speed setpoint.
int32_t gv_zd_ref
reference model vertical speed in meters/sec (output) fixed point representation with GV_ZD_REF_FRAC ...
Paparazzi generic algebra macros.
Paparazzi fixed point algebra.
int int32_t
Typedef defining 32 bit int type.
Definition: vl53l1_types.h:83