-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathkalman.h
More file actions
58 lines (53 loc) · 1.85 KB
/
Copy pathkalman.h
File metadata and controls
58 lines (53 loc) · 1.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/* -*- indent-tabs-mode:T; c-basic-offset:8; tab-width:8; -*- vi: set ts=8:
* $Id: tilt.h,v 1.1 2003/07/09 18:23:29 john Exp $
*
* 1 dimensional tilt sensor using a dual axis accelerometer
* and single axis angular rate gyro. The two sensors are fused
* via a two state Kalman filter, with one state being the angle
* and the other state being the gyro bias.
*
* Gyro bias is automatically tracked by the filter. This seems
* like magic.
*
* Please see the file tilt.c for more details on the implementation.
* This header only has comments for the use of the module, not the
* inner workings.
*
* (c) 2003 Trammell Hudson <hudson@rotomotion.com>
*
*************
*
* This file is part of the autopilot onboard code package.
*
* Autopilot is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* Autopilot is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Autopilot; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#if !defined( KALMAN_H )
#define KALMAN_H
#include <libopencm3/cm3/common.h>
struct KALMAN {
double angle;
double dt;
double J[2][2];
double P[2][2];
double x_hat[2];
double P_medicion;
double P_gyro_bias;
double P_teta;
};
extern struct KALMAN k[2];
void kalman_setup();
void KalmanUpdate(u8 n, s32 *acelerometer_average);//struct KALMAN *k, double teta, double gyro);
#endif