root / branches / orbit / code / behaviors / bfs_fsm / bfs_fsm.h @ 591
History | View | Annotate | Download (1.21 KB)
1 |
// BFS FSM header file
|
---|---|
2 |
|
3 |
|
4 |
#ifndef _BFS_FSM_H_
|
5 |
#define _BFS_FSM_H_
|
6 |
|
7 |
//The States:
|
8 |
#define BFS_SEEK 12 //do run around |
9 |
#define BFS_FOLLOW 13 //follow other robots to location |
10 |
#define BFS_ORBIT 15 //Orbit robot |
11 |
#define BFS_STOP 16 //Stop. The default and ending state |
12 |
|
13 |
|
14 |
#define BFS_STRAIGHT_SPEED 160 |
15 |
|
16 |
#define BFS_ORBIT_DISTANCE 120 /* distance to start orbit around robot */ |
17 |
|
18 |
#define BFS_MAX_ROBOTS 20 /* max id of robot in project */ |
19 |
|
20 |
#define BFS_NO_VAL 255 |
21 |
|
22 |
|
23 |
|
24 |
int bfs_state; /*State machine variable.*/ |
25 |
|
26 |
int bfs_otherRobot; /* the robot we are seeking */ |
27 |
int bfs_my_id; /* my wireless id */ |
28 |
int bfs_follow_id; /* robot to follow */ |
29 |
|
30 |
|
31 |
int bfs_pControl; /*Proportional control variable, determines turn direction.*/ |
32 |
int bfs_d1,bfs_d2,bfs_d3,bfs_d4,bfs_d5; /*The five distances taken in by IR.*/ |
33 |
int bfs_bom; /* bom data */ |
34 |
int bfs_bom_count;
|
35 |
|
36 |
#define BFS_MAX_BOM_COUNT 5 /* number of missing bom packets before reverting to seek state */ |
37 |
|
38 |
/* bfs_init
|
39 |
argument: robot_id that you want to find
|
40 |
notes: must call before bfs_fsm
|
41 |
*/
|
42 |
void bfs_init(int robot); |
43 |
|
44 |
|
45 |
/* bfs_fsm
|
46 |
argument: none
|
47 |
notes: call in a while loop to perform FSM action
|
48 |
*/
|
49 |
void bfs_fsm(void); |
50 |
|
51 |
#endif
|