Project

General

Profile

Statistics
| Revision:

root / trunk / code / projects / traffic_navigation / intersectData.h @ 1982

History | View | Annotate | Download (2.72 KB)

1
#ifndef _NODE_DATABASE_
2
#define _NODE_DATABASE_
3

    
4
#define NUM_FEATURES 17
5

    
6

    
7
/****************************
8
 * Node Information: 5-bit Integer
9
 *     3 bits of node type
10
 *     2 bits of entry information
11
 *     
12
 * Intersection Number stored in bits 6-12.
13
 *
14
 * Also contains a "feature id": 4 bits in positions 13,14,15,16
15
 * 
16
 ****************************/
17

    
18
 
19
 /********************************
20
 *  Feature TYPES:
21
 *
22
 ********************************/
23
#define INTERSECTION_NODE   0
24
#define ROAD_NODE           1
25
//Used when mapping to signify return to previously visited intersection while driving on the wrong side of the road.
26
#define MAPPING_MARKER      NUM_FEATURES
27
// intersection number for unused and meaningless barcodes
28
#define UNUSED_INTER        0
29
 
30
 /********************************
31
 *  Node TYPES:
32
 *
33
 *
34
 *  SINGLE      0
35
 *  ON_RAMP     1
36
 *  OFF_RAMP    2
37
 *  DOUBLE_C    3
38
 *  DOUBLE_T    4
39
 *  ROAD        5
40
 * 
41
 ********************************/
42
 
43
 /********************************
44
 *  Turn TYPES:
45
 *  
46
 *  ISTRAIGHT   0
47
 *  ILEFT       1
48
 *  IRIGHT      2
49
 *  IUTURN      3
50
 *
51
 ********************************/
52

    
53
 /********************************
54
 *  Road TYPES:
55
 *
56
 ********************************/
57
#define ROAD_DOUBLE     0
58
#define ROAD_SINGLE     1
59
#define HIGHWAY         2
60

    
61
/********************************
62
 *  Intersection ENTRYPOINTS:
63
 *
64
 ********************************/
65

    
66
//DOUBLE_C intersection (Cross Intersection) positions
67
/*
68
    CTOP
69
    ||
70
    ||
71
    ||
72
CLEFT=======CRIGHT
73
    ||
74
    ||
75
    ||
76
    CBOT
77
*/
78
#define CTOP        0
79
#define CRIGHT      1
80
#define CBOT        2
81
#define CLEFT       3
82

    
83
//DOUBLE_T intersection (T-Junction) positions
84
/*
85
TLEFT=======TRIGHT
86
    ||
87
    ||
88
    ||
89
    TMIDDLE
90
*/
91
#define TLEFT       0
92
#define TRIGHT      1
93
#define TMIDDLE     2
94

    
95
//SINGLE intersection positions
96
/*
97
       /\
98
      /||\
99
       ||
100
SACROSS==========>
101
       ||
102
       ||
103
       ||
104
       SUP
105
*/
106
#define SACROSS     0
107
#define SUP         1
108

    
109

    
110
//ON_RAMP and OFF_RAMP intersection positions
111
/*
112
R_LEFT================R_RIGHT
113
        ||
114
        ||
115
        ||
116
      R_RAMP
117
*/
118
#define R_LEFT    0
119
#define R_RIGHT   1
120
#define R_RAMP    2
121

    
122
// Global variable for the intersection database.
123
extern int NodeData[NUM_FEATURES];
124

    
125
void initializeData(void);
126

    
127
// Functions to get data from the Database:
128
int getFeatureId(int key); //Returns value in Feature TYPES (see above)
129
int getIntersectType(int key); //Returns value in Node TYPE (values 0-4) (see above)
130
int getIntersectPos(int key); //Returns value in Intersect ENTRYPOINTS (see above)
131
int getRoadType(int key);  //Returns value in Node TYPE (values 5) (see above) 
132
int getRoadInfo(int key);  //Returns value in Road TYPES (see above) 
133
int getIntersectNum(int key); //Returns number of intersection
134

    
135
#endif