Revision 398
Commented a bit, just getting ready to start SLAM work in earnest.
data_requests.h | ||
---|---|---|
3 | 3 |
#define IR_TYPE 1 |
4 | 4 |
#define ENCODER_TYPE 2 |
5 | 5 |
|
6 |
/** |
|
7 |
* @brief I tried to leave the data in an easy manipulable form, however |
|
8 |
* the side effect is that you're going to have to reference here sometimes. |
|
9 |
* The fields are obvious... |
|
10 |
* robot_id is the id of the robot that was being looked at by robot that the |
|
11 |
* list encapsulates. |
|
12 |
* value is the 0-15 value of the IR receiver that saw the robot. (Counter clockwise |
|
13 |
* from the right side. |
|
14 |
* next is a pointer to the next BomNode (or NULL). |
|
15 |
*/ |
|
6 | 16 |
typedef struct { |
7 | 17 |
short int robot_id; |
8 | 18 |
char value; |
9 | 19 |
struct BomNode* next; |
10 | 20 |
} BomNode; |
11 | 21 |
|
12 |
typedef struct{ |
|
22 |
/*typedef struct{
|
|
13 | 23 |
unsigned char* packet; |
14 | 24 |
char type; |
15 | 25 |
int source; |
16 | 26 |
int length; |
17 |
} RawData; |
|
27 |
} RawData;*/
|
|
18 | 28 |
|
29 |
/** |
|
30 |
* @brief Initializes the Data Request functionality on the server side. |
|
31 |
* |
|
32 |
* @param void*(bom_data_handler(BomNode** head)) A function that accepts |
|
33 |
* a BomNode** as an argument and handles the bom data however you would like. |
|
34 |
* |
|
35 |
* @param void*(IR_data_handler(short** data)) A function that accepts an |
|
36 |
* array of shorts for processing. |
|
37 |
* |
|
38 |
* @param void*(encoder_data_handler(unsigned char** data)) A function that |
|
39 |
* accepts an array of unsigned chars (tentatively) as data for processing. |
|
40 |
*/ |
|
19 | 41 |
void data_requests_init( |
20 | 42 |
void(*bom_data_handler)(BomNode** head), |
21 | 43 |
void(*IR_data_handler)(short** data), |
22 | 44 |
void(*encoder_data_handler)(unsigned char** data)); |
23 | 45 |
|
46 |
/** |
|
47 |
* @brief Pings the robot for BOM data. |
|
48 |
* |
|
49 |
* @param robot_id The robot ID of the robot to ping. Typically you will need |
|
50 |
* to join (if not insert yourself into) the token ring to get a list of robot |
|
51 |
* id's. |
|
52 |
*/ |
|
24 | 53 |
void request_bom_data(int robot_id); |
54 |
|
|
55 |
/** |
|
56 |
* @brief Pings the robot for BOM data. |
|
57 |
*/ |
|
25 | 58 |
void request_IR_data(int robot_id); |
59 |
|
|
60 |
/** |
|
61 |
* @brief Pings the robot for encoder data. |
|
62 |
* NOT YET DONE (We don't have encoders yet...) |
|
63 |
*/ |
|
26 | 64 |
void request_encoder_data(int robot_id); |
27 | 65 |
|
Also available in: Unified diff