-
-
Notifications
You must be signed in to change notification settings - Fork 95
/
Copy pathcalib.h
46 lines (36 loc) · 1.27 KB
/
calib.h
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
/*
This file is part of AutoQuad.
AutoQuad 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 3 of the License, or
(at your option) any later version.
AutoQuad 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 AutoQuad. If not, see <http://www.gnu.org/licenses/>.
Copyright © 2011-2014 Bill Nesbitt
*/
#ifndef _calib_h
#define _calib_h
#include "imu.h"
#include "aq_math.h"
#define CALIB_SAMPLES 20 // per octant
#define CALIB_MIN_ANGLE 25 // degrees
#define CALIB_EMPTY_SLOT 100.0f
#define CALIB_SCALE 2.0f
typedef struct {
float32_t *calibSamples;
float32_t lastVec[3];
float32_t min[3];
float32_t max[3];
float32_t bias[3];
float32_t U[10];
float32_t percentComplete;
} calibStruct_t;
extern calibStruct_t calibData;
extern void calibInit(void);
extern void calibDeinit(void);
extern void calibrate(void);
#endif