root / trunk / code / projects / traffic_navigation / validTurns.h @ 1884
History | View | Annotate | Download (1.29 KB)
1 | 1865 | pdeo | #ifndef _VALID_TURNS_
|
---|---|---|---|
2 | #define _VALID_TURNS_
|
||
3 | |||
4 | |||
5 | 1879 | pdeo | #include "lineDrive.h" |
6 | |||
7 | 1884 | jdcooper | /****************************
|
8 | * Intersection Information: 5-bit Integer
|
||
9 | * 3 bits of intersection type
|
||
10 | * 2 bits of entry information
|
||
11 | *
|
||
12 | ****************************/
|
||
13 | 1865 | pdeo | |
14 | 1884 | jdcooper | /********************************
|
15 | * Intersection TYPES:
|
||
16 | *
|
||
17 | ********************************/
|
||
18 | |||
19 | |||
20 | #define INTERSECTION_SINGLE (1 << 2) |
||
21 | #define INTERSECTION_ON_RAMP (2 << 2) |
||
22 | #define INTERSECTION_OFF_RAMP (3 << 2) |
||
23 | #define INTERSECTION_DOUBLE_C (4 << 2) |
||
24 | #define INTERSECTION_DOUBLE_T (5 << 2) |
||
25 | |||
26 | |||
27 | /********************************
|
||
28 | * Intersection ENTRYPOINTS:
|
||
29 | *
|
||
30 | ********************************/
|
||
31 | |||
32 | 1865 | pdeo | //DOUBLE intersection (Cross Intersection) positions
|
33 | //use T-Junction positions
|
||
34 | |||
35 | //DOUBLE intersection (T-Junction) positions
|
||
36 | /*
|
||
37 | TLEFT=======TRIGHT
|
||
38 | ||
|
||
39 | ||
|
||
40 | ||
|
||
41 | TMIDDLE
|
||
42 | */
|
||
43 | #define TLEFT 0 |
||
44 | #define TRIGHT 1 |
||
45 | #define TMIDDLE 2 |
||
46 | |||
47 | //SINGLE intersection positions
|
||
48 | /*
|
||
49 | /\
|
||
50 | /||\
|
||
51 | ||
|
||
52 | SACROSS==========>
|
||
53 | ||
|
||
54 | ||
|
||
55 | ||
|
||
56 | SUP
|
||
57 | */
|
||
58 | #define SACROSS 0 |
||
59 | #define SUP 1 |
||
60 | |||
61 | |||
62 | //ON_RAMP and OFF_RAMP intersection positions
|
||
63 | /*
|
||
64 | R_LEFT================R_RIGHT
|
||
65 | ||
|
||
66 | ||
|
||
67 | ||
|
||
68 | R_RAMP
|
||
69 | */
|
||
70 | #define R_LEFT 0 |
||
71 | #define R_RIGHT 1 |
||
72 | #define R_RAMP 2 |
||
73 | |||
74 | int getCrossType(int barcode); |
||
75 | |||
76 | int getCrossPos(int barcode, int max); |
||
77 | |||
78 | 1879 | pdeo | int validateTurn(int barcode, int turn_type); |
79 | 1865 | pdeo | |
80 | #endif |