root / branches / lemmings / code / behaviors / smart_run_around_fsm / orbit_fsm.h @ 496
History | View | Annotate | Download (849 Bytes)
1 |
//Obstacle Avoid Numbers
|
---|---|
2 |
|
3 |
|
4 |
#ifndef _ORBIT_FSM_H_
|
5 |
#define _ORBIT_FSM_H_
|
6 |
|
7 |
//The States:
|
8 |
#define SEEK 12 //Move straight towards robot |
9 |
#define TO_ORBIT 13 //Rotate into orbit |
10 |
#define ORBIT 15 //Orbit robot |
11 |
#define STOP 16 //Stop. The default state, (Something broke). |
12 |
|
13 |
|
14 |
#define STRAIGHT_SPEED 160 |
15 |
|
16 |
|
17 |
#define ORBIT_DIRECTION 4 // if 4, then orbit to the right; if -4, then orbit to the left |
18 |
|
19 |
#define ORBIT_DISTANCE 250 // orbit distance as measured by rangefinders |
20 |
|
21 |
|
22 |
int state; /*State machine variable.*/ |
23 |
|
24 |
int otherRobot; /* must be set prior to running FSM */ |
25 |
|
26 |
|
27 |
int pControl; /*Proportional control variable, determines turn direction.*/ |
28 |
int d1,d2,d3,d4,d5; /*The five distances taken in by IR.*/ |
29 |
int bom; /* bom data */ |
30 |
|
31 |
void orbit_init(int robot); |
32 |
void orbit_fsm(void); |
33 |
void evaluate_state(void); |
34 |
|
35 |
#endif
|