Project

General

Profile

Statistics
| Revision:

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

History | View | Annotate | Download (2.72 KB)

1 1912 pdeo
#ifndef _NODE_DATABASE_
2
#define _NODE_DATABASE_
3
4 1966 alevkoy
#define NUM_FEATURES 17
5 1887 pdeo
6 1912 pdeo
7 1887 pdeo
/****************************
8 1912 pdeo
 * Node Information: 5-bit Integer
9 1966 alevkoy
 *     3 bits of node type
10
 *     2 bits of entry information
11
 *
12 1958 pdeo
 * Intersection Number stored in bits 6-12.
13 1903 jdcooper
 *
14
 * Also contains a "feature id": 4 bits in positions 13,14,15,16
15 1887 pdeo
 *
16
 ****************************/
17 1908 pdeo
18 1887 pdeo
19
 /********************************
20 1908 pdeo
 *  Feature TYPES:
21
 *
22
 ********************************/
23 1966 alevkoy
#define INTERSECTION_NODE   0
24
#define ROAD_NODE           1
25 1982 alevkoy
//Used when mapping to signify return to previously visited intersection while driving on the wrong side of the road.
26 1966 alevkoy
#define MAPPING_MARKER      NUM_FEATURES
27 1982 alevkoy
// intersection number for unused and meaningless barcodes
28
#define UNUSED_INTER        0
29 1908 pdeo
30
 /********************************
31 1912 pdeo
 *  Node TYPES:
32 1887 pdeo
 *
33 1912 pdeo
 *
34
 *  SINGLE      0
35
 *  ON_RAMP     1
36
 *  OFF_RAMP    2
37
 *  DOUBLE_C    3
38
 *  DOUBLE_T    4
39 1966 alevkoy
 *  ROAD        5
40 1958 pdeo
 *
41 1887 pdeo
 ********************************/
42 1912 pdeo
43
 /********************************
44 1887 pdeo
 *  Turn TYPES:
45 1912 pdeo
 *
46 1966 alevkoy
 *  ISTRAIGHT   0
47
 *  ILEFT       1
48
 *  IRIGHT      2
49
 *  IUTURN      3
50 1887 pdeo
 *
51
 ********************************/
52
53 1908 pdeo
 /********************************
54
 *  Road TYPES:
55
 *
56
 ********************************/
57 1966 alevkoy
#define ROAD_DOUBLE     0
58
#define ROAD_SINGLE     1
59
#define HIGHWAY         2
60 1887 pdeo
61
/********************************
62
 *  Intersection ENTRYPOINTS:
63
 *
64
 ********************************/
65
66 1912 pdeo
//DOUBLE_C intersection (Cross Intersection) positions
67 1958 pdeo
/*
68 1966 alevkoy
    CTOP
69
    ||
70
    ||
71
    ||
72 1958 pdeo
CLEFT=======CRIGHT
73 1966 alevkoy
    ||
74
    ||
75
    ||
76
    CBOT
77 1958 pdeo
*/
78 1966 alevkoy
#define CTOP        0
79
#define CRIGHT      1
80
#define CBOT        2
81
#define CLEFT       3
82 1887 pdeo
83 1912 pdeo
//DOUBLE_T intersection (T-Junction) positions
84 1887 pdeo
/*
85
TLEFT=======TRIGHT
86 1966 alevkoy
    ||
87
    ||
88
    ||
89
    TMIDDLE
90 1887 pdeo
*/
91 1966 alevkoy
#define TLEFT       0
92
#define TRIGHT      1
93
#define TMIDDLE     2
94 1887 pdeo
95
//SINGLE intersection positions
96
/*
97 1966 alevkoy
       /\
98
      /||\
99
       ||
100 1887 pdeo
SACROSS==========>
101 1966 alevkoy
       ||
102
       ||
103
       ||
104
       SUP
105 1887 pdeo
*/
106 1966 alevkoy
#define SACROSS     0
107
#define SUP         1
108 1887 pdeo
109
110
//ON_RAMP and OFF_RAMP intersection positions
111
/*
112
R_LEFT================R_RIGHT
113 1966 alevkoy
        ||
114
        ||
115
        ||
116
      R_RAMP
117 1887 pdeo
*/
118 1966 alevkoy
#define R_LEFT    0
119
#define R_RIGHT   1
120
#define R_RAMP    2
121 1887 pdeo
122 1912 pdeo
// Global variable for the intersection database.
123 1966 alevkoy
extern int NodeData[NUM_FEATURES];
124 1887 pdeo
125 1966 alevkoy
void initializeData(void);
126 1887 pdeo
127
// Functions to get data from the Database:
128 1958 pdeo
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 1887 pdeo
135
#endif