Revision 1865
header file for the function called when entering an intersection that
determines whether or not a turn is valid based on the intersection type
and position of the robot. Currently uses random number generators (i.e.
rangefinders) to determine intersection type, position, and turn type.
trunk/code/projects/traffic_navigation/validTurns.h | ||
---|---|---|
1 |
#ifndef _VALID_TURNS_ |
|
2 |
#define _VALID_TURNS_ |
|
3 |
|
|
4 |
#include "lineFollow.h" |
|
5 |
#include "lineDrive.h" |
|
6 |
|
|
7 |
//To differenciate between T and Cross Intersections |
|
8 |
#define DOUBLE_C 4 |
|
9 |
#define DOUBLE_T 5 |
|
10 |
|
|
11 |
//DOUBLE intersection (Cross Intersection) positions |
|
12 |
//use T-Junction positions |
|
13 |
|
|
14 |
//DOUBLE intersection (T-Junction) positions |
|
15 |
/* |
|
16 |
TLEFT=======TRIGHT |
|
17 |
|| |
|
18 |
|| |
|
19 |
|| |
|
20 |
TMIDDLE |
|
21 |
*/ |
|
22 |
#define TLEFT 0 |
|
23 |
#define TRIGHT 1 |
|
24 |
#define TMIDDLE 2 |
|
25 |
|
|
26 |
//SINGLE intersection positions |
|
27 |
/* |
|
28 |
/\ |
|
29 |
/||\ |
|
30 |
|| |
|
31 |
SACROSS==========> |
|
32 |
|| |
|
33 |
|| |
|
34 |
|| |
|
35 |
SUP |
|
36 |
*/ |
|
37 |
#define SACROSS 0 |
|
38 |
#define SUP 1 |
|
39 |
|
|
40 |
|
|
41 |
//ON_RAMP and OFF_RAMP intersection positions |
|
42 |
/* |
|
43 |
R_LEFT================R_RIGHT |
|
44 |
|| |
|
45 |
|| |
|
46 |
|| |
|
47 |
R_RAMP |
|
48 |
*/ |
|
49 |
#define R_LEFT 0 |
|
50 |
#define R_RIGHT 1 |
|
51 |
#define R_RAMP 2 |
|
52 |
|
|
53 |
int getCrossType(int barcode); |
|
54 |
|
|
55 |
int getCrossPos(int barcode, int max); |
|
56 |
|
|
57 |
int getTurnType(); |
|
58 |
|
|
59 |
int validateTurn(int barcode); |
|
60 |
|
|
61 |
#endif |
|
0 | 62 |
Also available in: Unified diff