-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathConfiguration.h
85 lines (69 loc) · 2.35 KB
/
Configuration.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#ifndef _CONFIGURATION_ADC_H_
#define _CONFIGURATION_ADC_H_
#include <iostream>
#include <Eigen/Dense>
#include "sensors/GY87.h"
using namespace Eigen;
class Configuration
{
public:
// System
float dt = 0.005; // in seconds
float g = 9.80151; // Beijing
float seaLevelPressure = 101500;
// GY87
uint8_t MPU6050DLPFMode = MPU6050_DLPF_BW_42;
int16_t MPU6050Rate = 200;
uint8_t MPU6050GyroFsr = MPU6050_GYRO_FS_2000;
uint8_t MPU6050AccelFSr = MPU6050_ACCEL_FS_2;
int16_t MPU6050Offsets[6] = {-1685, 3937, 1803, 0, -17, 109};
uint8_t HMC5883LSampleAveraging = HMC5883L_AVERAGING_8;
uint8_t HMC5883LDataRate = HMC5883L_RATE_75;
// Caliberator
Matrix3f axisRotationMatrix;
bool calibrateCompass = true;
Vector3f calibrateCompassMax;
Vector3f calibrateCompassMin;
bool calibrateCompassEllipsoid = true;
Vector3f calibrateCompassEllipsoidOffset;
Matrix3f calibrateCompassEllipsoidMatrix;
bool calibrateAccel = true;
float calibrateAccelMin[3];
float calibrateAccelMax[3];
// UKF
Vector3f accOffset;
Vector3f magneticField;
// ESC controller
int controlled_esc[4] = {6, 13, 19, 26};
int ESCSanity[4] = {12, 12, 12, 12};
int ESCFrequency = 400; // Hz
int ESCOutMin = 1200;
int ESCOutMax = 1800;
// PID system
float ratePIDSystemConfig[3][7] =
{
{100, 1, 0, 200, -200, 400, -400},
{300, 1, 0, 200, -200, 400, -400},
{300, 1, 0, 200, -200, 400, -400}
};
float attitudePIDSystemConfig[3][7] =
{
{100, 1, 0.03, 200, -200, 400, -400},
{300, 1, 0.02, 200, -200, 400, -400},
{300, 1, 0.02, 200, -200, 400, -400}
};
float ZPIDSystemConfig[4][7] =
{
{20, 20, 20, 25, 0, 600, 0},
{20, 20, 20, 25, 0, 600, 0},
{20, 20, 20, 25, 0, 600, 0},
{20, 20, 20, 25, 0, 600, 0},
};
int yprtSanity[4] = {8, 8, 8, 3};
};
using std::ostream;
using std::istream;
using std::endl;
std::ostream& operator<<(std::ostream& stream, configuration const& data);
std::istream& operator>>(std::istream& stream, configuration& data);
#endif // _CONFIGURATION_ADC_H_