root / trunk / code / projects / traffic_navigation / sendGraph.h @ 1979
History | View | Annotate | Download (1016 Bytes)
1 | 1979 | dgurjar | #include "intersectData.h" |
---|---|---|---|
2 | |||
3 | /* Data is sent in the following order
|
||
4 | * INT0_NUM OUTEDGE_0 OUTEDGE_1 ... \n
|
||
5 | * INT1_NUM OUTEDGE_0 ... \n
|
||
6 | * ...
|
||
7 | * ...
|
||
8 | */
|
||
9 | void sendIntersectionGraph();
|
||
10 | |||
11 | |||
12 | /* Representation of an edge (road) */
|
||
13 | typedef struct { |
||
14 | char to; /* Where does this edge lead to? */ |
||
15 | char dist; /* Where does it come from? */ |
||
16 | }edge; |
||
17 | |||
18 | /* Representation of an intersection on the graph */
|
||
19 | typedef struct { |
||
20 | char type; /* Note that there are at most 5 intersection types */ |
||
21 | char intNum; /* What is the intersection number */ |
||
22 | char numOut; /* Note that we can have no more than 4 outgoing edges */ |
||
23 | char outSeen; /* The number of the outgoing edges that we have seen for this intersection */ |
||
24 | edge outgoingEdges [4];
|
||
25 | }node; |
||
26 | |||
27 | /* A union that is used in wireless transmissions */
|
||
28 | typedef union { |
||
29 | node n; |
||
30 | char array[12]; |
||
31 | }node_union; |
||
32 | |||
33 | /* This array holds all of the intersections that are represented in the graph
|
||
34 | * after its creation, the graph is transmitted wirelessly */
|
||
35 | node intersections [NUM_FEATURES]; |