Revision 1969
Traffic Navigation:
Started integration of the new intersection queue code.
(main-intersectionDebug.c, main-new.c, & traffic_navigation.h).
The new code will not be compiled by default.
Additionally, I added #defines to all orb control statements because
they were interfering with each other. To turn some orb control statements on,
define them in traffic_navigation.h
traffic_navigation.h | ||
---|---|---|
7 | 7 |
#include "intersectData.h" |
8 | 8 |
#include "validTurns.h" |
9 | 9 |
|
10 |
/* Debug Options */ |
|
11 |
#ifdef DEBUGALL |
|
12 |
#define ORB_HIGHWAY |
|
13 |
#define ORB_LINEFOLLOW |
|
14 |
#define ORB_INTERSECTON |
|
15 |
#define DEBUG_CA |
|
16 |
#define DEBUG_INTERSECTION |
|
17 |
#endif |
|
18 |
|
|
10 | 19 |
/*States*/ |
11 | 20 |
#define SROAD 0 |
12 |
#define SINTERSECTION 10 |
|
21 |
#define SINTERSECTION 9 /* for old version */ |
|
22 |
#define SINTERSECTION_ENTER 10 |
|
23 |
#define SINTERSECTION_ENTER_RESOLV 11 |
|
24 |
#define SINTERSECTION_WAIT 12 |
|
25 |
#define SINTERSECTION_DRIVE 13 |
|
13 | 26 |
#define SHIGHWAY 20 |
27 |
#define SCLEARPACKET 30 |
|
14 | 28 |
|
15 | 29 |
/*Sign Codes |
16 | 30 |
* bitwise OR labels to create a barcode or read one |
... | ... | |
42 | 56 |
#define WROADREPLY 1 //[type, fromBot, road, toBot] |
43 | 57 |
#define WROADEXIT 2 //[type, bot, road] |
44 | 58 |
#define WROADSTOP 3 //[type, bot, road] |
45 |
#define WINTERSECTIONENTRY 10 //[type, bot, intersection, fromDir, toDir] |
|
46 |
#define WINTERSECTIONREPLY 11 //[type, fromBot, intersection, toBot] |
|
47 |
#define WINTERSECTIONEXIT 12 //[type, bot, intersection] |
|
48 |
#define WINTERSECTIONGO 13 //[type, bot, intersection] |
|
59 |
#define WINTERSECTIONENTRY 10 //[type, bot, intersection, fromDir, toDir]
|
|
60 |
#define WINTERSECTIONREPLY 11 //[type, fromBot, intersection, toBot]
|
|
61 |
#define WINTERSECTIONEXIT 12 //[type, bot, intersection]
|
|
62 |
#define WINTERSECTIONGO 13 //[type, bot, intersection]
|
|
49 | 63 |
#define WINTERSECTIONPOLICEENTRY 14 |
64 |
#define WINTERSECTIONRESOLVERACE 15 //[type, bot, intersection, num] |
|
50 | 65 |
#define WHIGHWAYENTRY 20 //[type, bot, highway] |
51 | 66 |
#define WHIGHWAYREPLY 21 //[type, fromBot, highway, toBot] |
52 | 67 |
#define WHIGHWAYEXIT 22 //[type, bot, highway] |
... | ... | |
56 | 71 |
#define WPINGREPLY 33 //[type, fromBot, toBot] |
57 | 72 |
#define WCOLLISIONAVOID 41 //[type, bot, intersection, collision-int] //Note: collision is an int and thus takes two spaces |
58 | 73 |
|
74 |
/*Wireless Parsing Status |
|
75 |
* For wireless parsing - status codes describing various errors/statuses with wireless |
|
76 |
* parsing. |
|
77 |
* Errors begin with E - Note that all of these errors are actually returned as negative. |
|
78 |
* - values of >= 100 indicate a serious error |
|
79 |
* Non-Errors begin with K - returned as positive. (don't start with S because S |
|
80 |
* is for state) |
|
81 |
*/ |
|
82 |
#define ENOPACKET -10 //The received packet doesn't exist. |
|
83 |
#define ENOACTION -15 //The received packet has no defined action, and this is OK |
|
84 |
#define ENOIMPLEMENT -20 //The received packet has no defined action and needs to be implemented. |
|
85 |
#define EPACKETLEN -100 //The received packet was the wrong length |
|
86 |
#define KOK 1 |
|
87 |
#define KPLACEDINQUEUE 20 |
|
88 |
#define KFAILEDTOQUEUE 21 |
|
89 |
#define KFIRSTINQUEUE 22 |
|
90 |
#define KREPLIEDTOENTER 23 |
|
91 |
#define KRESOLVINGENTER 24 //resolving a race between bots trying to enter intersection at the same time. |
|
92 |
|
|
59 | 93 |
/*Macros |
60 | 94 |
*/ |
61 | 95 |
#define ISPING(p) ((p)[0]==WPINGGLOBAL || (p)[0]==WPINGBOT || (p)[0]==WPINGQUEUE) |
Also available in: Unified diff