-
Notifications
You must be signed in to change notification settings - Fork 2
/
PSCS_AHRS.h
77 lines (64 loc) · 1.14 KB
/
PSCS_AHRS.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
/**
* @file PSCS_AHRS.h
* @author SeungMin Shin, Haneulbit Kim, Chan Lee
* @license This project is released under the MIT License (MIT)
* @copyright Copyright (c) 2018 Asgardia
* @date June 2018
* @brief ...
*/
#ifndef PSCS_AHRS_h
#define PSCS_AHRS_h
#include "Arduino.h"
struct AhrsInfo {
float roll;
float pitch;
float yaw;
float ax;
float ay;
float az;
};
struct GyroInfo {
float roll;
float pitch;
float yaw;
};
struct AcceleroInfo {
float ax;
float ay;
float az;
};
class MngAhrs
{
public:
void readAhrsData(); //Measure GPS value
bool isAhrsDataReady();
void ahrsBegin();
void rx_empty();
float roll;
float pitch;
float yaw;
float ax;
float ay;
float az;
private:
float _sbuf[6];
};
class TskAhrs
{
public:
void begin();
void update();
GyroInfo getGyro();
AcceleroInfo getAccelero();
float getMotionAcceleration();
void caculrateMotionAcceleration();
bool isAhrsDataNew();
void printAhrsInfo();
void rx_empty();
private:
MngAhrs _manager_ahrs;
bool _ahrs_data_flag;
float _motion_acceleration;
int _print_count;
};
#endif