Project

General

Profile

Statistics
| Revision:

root / trunk / code / projects / traffic_navigation / collision_avoid.h @ 1990

History | View | Annotate | Download (1.08 KB)

1
#ifndef COLLISION_AVOID_H
2
#define COLLISION_AVOID_H
3
/* 
4
 * Map of Intersection:
5
 *       |D0 |
6
 *       |   |
7
 * ______|E X|______  Center 0-3 are Intersection Blocks
8
 * D1   X 0I1 E   D3
9
 * _____E 2I3 X_____
10
 *       |X E|
11
 *       |   |
12
 *       |D2 |
13
 *        
14
 * Naming scheme:
15
 * First Letter:
16
 *         D: Direction
17
 *         I: Intersection
18
 * Second Number:
19
 *         #of Direction or Intersection Block
20
 * Third Letter: Only applicable for Directions
21
 *         E for enter direction
22
 *         X for exit direction
23
 */
24
//don't change this ordering unless you're sure it'll work for rotating the intersection
25
#define D0E 1<<0
26
#define D0X 1<<4
27
#define D1E 1<<1
28
#define D1X 1<<5
29
#define D2E 1<<2
30
#define D2X 1<<6
31
#define D3E 1<<3
32
#define D3X 1<<7
33
#define I0 1<<8
34
#define I1 1<<9
35
#define I2 1<<11
36
#define I3 1<<10
37
/*rotation groups
38
 * Naming scheme is the same, except instead of numbers in the second field, we have A for any
39
 * If there is an S at the end, it is a shift value for getting all the bits to be aligned to the LSB.
40
 */
41
#define DAE 0x000f
42
#define DAX 0x00f0
43
#define DAXS 4
44
#define IA 0x0f00
45
#define IAS 8
46
#endif