Paparazzi UAS  v4.0.4_stable-3-gf39211a
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
vf_int.h
Go to the documentation of this file.
1 /*
2  * $Id$
3  *
4  * Copyright (C) 2008-2009 Antoine Drouin <poinix@gmail.com>
5  *
6  * This file is part of paparazzi.
7  *
8  * paparazzi is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2, or (at your option)
11  * any later version.
12  *
13  * paparazzi is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with paparazzi; see the file COPYING. If not, write to
20  * the Free Software Foundation, 59 Temple Place - Suite 330,
21  * Boston, MA 02111-1307, USA.
22  */
23 
24 #ifndef VF_INT_H
25 #define VF_INT_H
26 
27 #include "std.h"
28 #include "booz_geometry_int.h"
29 
30 extern void vfi_init( int32_t z0, int32_t zd0, int32_t bias0 );
31 extern void vfi_propagate( int32_t accel_reading );
32 
33 /* z_meas : altitude measurement in meter */
34 /* Q23.8 : accuracy 0.004m range 8388km */
35 extern void vfi_update( int32_t z_meas );
36 #define VFI_Z_MEAS_FRAC IPOS_FRAC
37 
38 /* propagate frequency : 512 Hz */
39 #define VFI_F_UPDATE_FRAC 9
40 #define VFI_F_UPDATE (1<<VFI_F_UPDATE_RES)
41 
42 /* vertical acceleration in m/s^2 */
43 /* Q21.10 : accuracy 0.001m/s^2, range 2097km/s2 */
44 extern int32_t vfi_zdd;
45 #define VFI_ZDD_FRAC IACCEL_RES
46 
47 /* vertical accelerometer bias in m/s^2 */
48 /* Q21.10 : accuracy 0.001m/s^2, range 2097km/s2 */
49 extern int32_t vfi_abias;
50 #define VFI_BIAS_FRAC IACCEL_RES
51 
52 /* vertical speed in m/s */
53 /* Q12.19 : accuracy 0.000002 , range 4096m/s2 */
54 extern int32_t vfi_zd;
55 #define VFI_ZD_FRAC (VFI_ZDD_FRAC + VFI_F_UPDATE_FRAC)
56 
57 /* altitude in m */
58 /* Q35.28 : accuracy 3.7e-9 , range 3.4e10m */
59 extern int64_t vfi_z;
60 #define VFI_Z_FRAC (VFI_ZD_FRAC + VFI_F_UPDATE_FRAC)
61 
62 /* Kalman filter state */
63 #define VFI_S_Z 0
64 #define VFI_S_ZD 1
65 #define VFI_S_AB 2
66 #define VFI_S_SIZE 3
67 /* Kalman filter covariance */
68 /* Q3.28 */
70 #define VFI_P_FRAC 28
71 
72 
73 
74 
75 #endif /* VF_INT_H */
int32_t vfi_abias
Definition: vf_int.c:30
void vfi_init(int32_t z0, int32_t zd0, int32_t bias0)
Definition: vf_int.c:49
signed long long int64_t
Definition: types.h:21
int32_t vfi_P[VFI_S_SIZE][VFI_S_SIZE]
Definition: vf_int.c:32
void vfi_update(int32_t z_meas)
Definition: vf_int.c:123
signed long int32_t
Definition: types.h:19
int64_t vfi_z
Definition: vf_int.c:28
void vfi_propagate(int32_t accel_reading)
Definition: vf_int.c:85
#define VFI_S_SIZE
Definition: vf_int.h:66
int32_t vfi_zdd
Definition: vf_int.c:31
int32_t vfi_zd
Definition: vf_int.c:29