Paparazzi UAS  v5.0.5_stable-7-g4b8bbb7
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
vf_int.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2008-2009 Antoine Drouin <poinix@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 
29 #ifndef VF_INT_H
30 #define VF_INT_H
31 
32 #include "std.h"
33 #include "booz_geometry_int.h"
34 
35 extern void vfi_init( int32_t z0, int32_t zd0, int32_t bias0 );
36 extern void vfi_propagate( int32_t accel_reading );
37 
38 /* z_meas : altitude measurement in meter */
39 /* Q23.8 : accuracy 0.004m range 8388km */
40 extern void vfi_update( int32_t z_meas );
41 #define VFI_Z_MEAS_FRAC IPOS_FRAC
42 
43 /* propagate frequency : 512 Hz */
44 #define VFI_F_UPDATE_FRAC 9
45 #define VFI_F_UPDATE (1<<VFI_F_UPDATE_RES)
46 
47 /* vertical acceleration in m/s^2 */
48 /* Q21.10 : accuracy 0.001m/s^2, range 2097km/s2 */
49 extern int32_t vfi_zdd;
50 #define VFI_ZDD_FRAC IACCEL_RES
51 
52 /* vertical accelerometer bias in m/s^2 */
53 /* Q21.10 : accuracy 0.001m/s^2, range 2097km/s2 */
54 extern int32_t vfi_abias;
55 #define VFI_BIAS_FRAC IACCEL_RES
56 
57 /* vertical speed in m/s */
58 /* Q12.19 : accuracy 0.000002 , range 4096m/s2 */
59 extern int32_t vfi_zd;
60 #define VFI_ZD_FRAC (VFI_ZDD_FRAC + VFI_F_UPDATE_FRAC)
61 
62 /* altitude in m */
63 /* Q35.28 : accuracy 3.7e-9 , range 3.4e10m */
64 extern int64_t vfi_z;
65 #define VFI_Z_FRAC (VFI_ZD_FRAC + VFI_F_UPDATE_FRAC)
66 
67 /* Kalman filter state */
68 #define VFI_S_Z 0
69 #define VFI_S_ZD 1
70 #define VFI_S_AB 2
71 #define VFI_S_SIZE 3
72 /* Kalman filter covariance */
73 /* Q3.28 */
75 #define VFI_P_FRAC 28
76 
77 
78 
79 
80 #endif /* VF_INT_H */
int32_t vfi_abias
Definition: vf_int.c:35
void vfi_init(int32_t z0, int32_t zd0, int32_t bias0)
Definition: vf_int.c:54
signed long long int64_t
Definition: types.h:21
int32_t vfi_P[VFI_S_SIZE][VFI_S_SIZE]
Definition: vf_int.c:37
void vfi_update(int32_t z_meas)
Definition: vf_int.c:128
signed long int32_t
Definition: types.h:19
int64_t vfi_z
Definition: vf_int.c:33
void vfi_propagate(int32_t accel_reading)
Definition: vf_int.c:90
#define VFI_S_SIZE
Definition: vf_int.h:71
int32_t vfi_zdd
Definition: vf_int.c:36
int32_t vfi_zd
Definition: vf_int.c:34