-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommon.h
109 lines (91 loc) · 1.76 KB
/
common.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
107
108
109
#ifndef _NETWORK_COMMON_H
#define _NETWORK_COMMON_H
typedef struct {
float x, y;
} BasicPoint;
typedef struct {
unsigned numGoodMessagesRecved;
unsigned numCommErrors;
unsigned numJSONRequestsRecved;
unsigned numJSONResponsesRecved;
unsigned numJSONRequestsSent;
unsigned numJSONResponsesSent;
} MSGNetstats;
typedef struct {
/// Number of targets.
unsigned nt;
/// Number of targets.
BasicPoint ra;
/// Number of arena border points.
unsigned nb;
/// Arena borders.
BasicPoint points[14];
} MSGInitialize;
typedef struct {
float x, y, v, angle, av;
} MSGMovement;
typedef struct {
uint8_t x;
uint8_t y;
} MSGPoint;
typedef struct{
uint32_t tmr3;
uint32_t tmr4;
uint32_t l_spd;
uint32_t r_spd;
uint32_t tmr_state;
double dist_x;
double dist_y;
double angle;
}TimerJGDebug;
typedef struct{
bool left;
bool right;
}MSGDebugJoeTread;
typedef struct{
uint8_t weight;
}weight_array;
typedef struct{
uint32_t tmr3;
uint32_t tmr4;
uint32_t speed_left;
uint32_t speed_right;
double left_error;
double right_error;
}TimerDebug;
typedef struct{
uint8_t left;
uint8_t mid;
uint8_t right;
}edge_detect;
typedef struct{
double ultra;
double l_photo;
double r_photo;
double prev_lphoto;
double prev_rphoto;
double l_ir;
double r_ir;
}SensorReading;
typedef struct{
double dist_x;
double dist_y;
double turn_angle;
double angle_var;
double move_var;
}ldr_move;
typedef enum{
NORTH = 1,
SOUTH,
EAST,
WEST,
}orientation;
typedef struct{
orientation ori;
MSGPoint point;
uint32_t target;
}rover_debug;
typedef struct {
double left_ir, right_ir;
} MSGProximity;
#endif