Project

General

Profile

Revision 1966

Added test map data encoding to intersectData.c. Fixe a whole bunch of stuff so
that at least this traffic_navigation compiles without warnings. Symlinked to
needed files in linefollow. Changed function declaration style. Added
delclaration of read_line to analog.h. You're welcome. Fixed several #includes.
You're all welcome.

View differences:

intersectData.h
1 1
#ifndef _NODE_DATABASE_
2 2
#define _NODE_DATABASE_
3 3

  
4
#define NUM_FEATURES 8
4
#define NUM_FEATURES 17
5 5

  
6 6

  
7 7
/****************************
8 8
 * Node Information: 5-bit Integer
9
 * 	3 bits of node type
10
 * 	2 bits of entry information
11
 * 	
9
 *     3 bits of node type
10
 *     2 bits of entry information
11
 *     
12 12
 * Intersection Number stored in bits 6-12.
13 13
 *
14 14
 * Also contains a "feature id": 4 bits in positions 13,14,15,16
......
20 20
 *  Feature TYPES:
21 21
 *
22 22
 ********************************/
23
#define INTERSECTION_NODE	0
24
#define ROAD_NODE			1
25
#define MAPPING_MARKER		NUM_FEATURES
23
#define INTERSECTION_NODE   0
24
#define ROAD_NODE           1
25
#define MAPPING_MARKER      NUM_FEATURES
26 26
//Used when mapping to signify return to previously visited intersection while driving on the wrong side of the road.
27 27
 
28 28
 /********************************
......
34 34
 *  OFF_RAMP    2
35 35
 *  DOUBLE_C    3
36 36
 *  DOUBLE_T    4
37
 *  ROAD		5
37
 *  ROAD        5
38 38
 * 
39 39
 ********************************/
40 40
 
41 41
 /********************************
42 42
 *  Turn TYPES:
43 43
 *  
44
 *  ISTRAIGHT	0
45
 *  ILEFT		1
46
 *  IRIGHT		2
47
 *  IUTURN		3
44
 *  ISTRAIGHT   0
45
 *  ILEFT       1
46
 *  IRIGHT      2
47
 *  IUTURN      3
48 48
 *
49 49
 ********************************/
50 50

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

  
59 59
/********************************
60 60
 *  Intersection ENTRYPOINTS:
......
63 63

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

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

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

  
107 107

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

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

  
123
void initializeData();
123
void initializeData(void);
124 124

  
125 125
// Functions to get data from the Database:
126 126
int getFeatureId(int key); //Returns value in Feature TYPES (see above)

Also available in: Unified diff