-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGoroLog.h
106 lines (82 loc) · 1.88 KB
/
GoroLog.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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
/*
* Aca van a ir la lista de comandos que le envia el mega al 328
*
*/
#ifndef _GOROLOG_H
#define _GOROLOG_H
#define GOROL_CLIENT Serial1
#define GOROL_SPEED 57600
#define GOROL_MAX_LONG_DATO 64
#define GOROL_INICIALIZACION 'I' //TODO: analizar si tiene sentido
#define GOROL_QUERY_ESTADO 'Q'
#define GOROL_MOTORES_ARMADOS 'A'
#define GOROL_MOTORES_DESARMADOS 'D'
#define GOROL_UPTIME 'u'
#define GOROL_COMPASS 'c'
#define GOROL_HEADING 'a'
#define GOROL_ALTITUDE 'h'
#define GOROL_GPS 'g'
#define GOROL_PRUEBA1 '1'
#define GOROL_PRUEBA2 '2'
#define GOROL_ESTADO_GRABANDO_FIX 'g'
#define GOROL_ESTADO_GRABANDO_AUTO 'G'
#define GOROL_ESTADO_ESPERANDO 'N'
#define GOROL_ESTADO_SIN_GRABAR 'n'
#define GOROL_ESTADO_ERROR 'E'
struct compass_data_t {
float hdgX;
float hdgY;
float measuredMagX;
float measuredMagY;
float measuredMagZ;
};
struct flight_angle_data_t {
float angleRoll;
float anglePitch;
float angleYaw;
};
struct altitude_data_t {
float data;
};
struct position_data_t {
long lat;
long lon;
//TODO: agregar satelites, dop?, si es FIX o no
};
struct home_data_t {
long lat;
long lon;
float headingYaw;
float groundAltitude;
};
struct motors_data_t {
uint8_t num_motors;
int motorCommand[LASTMOTOR];
};
// TODO agregar la data de bateria
struct receiver_data_t {
int transmitterCommand[LASTCHANNEL];
};
struct gps_data_t {
long lat;
long lon;
unsigned long fix_age;
unsigned long chars;
unsigned short good_sentences;
unsigned short failed_cs;
};
union binary_data_t {
uint8_t dato[GOROL_MAX_LONG_DATO];
long largo;
unsigned long largo_sin_signo;
float flotante;
compass_data_t compass;
flight_angle_data_t myFlightAngle;
altitude_data_t myAltitude;
position_data_t myPosition;
home_data_t myHome;
motors_data_t myMotors;
receiver_data_t myReceiver;
gps_data_t myGps;
};
#endif