Project

General

Profile

Statistics
| Revision:

root / trunk / code / behaviors / bfs_fsm / orbit_fsm.h @ 1523

History | View | Annotate | Download (1.46 KB)

1
//Obstacle Avoid Numbers
2

    
3

    
4
#ifndef _ORBIT_FSM_H_
5
#define _ORBIT_FSM_H_
6

    
7
//The States: 
8
#define ORBIT_SEEK      12           //Move straight towards robot
9
#define ORBIT_INSERTION 13           //Rotate into orbit
10
#define ORBIT_ORBITING  15           //Orbit robot
11
#define ORBIT_STOP      16           //Stop.  The default and ending state
12

    
13

    
14
#define ORBIT_STRAIGHT_SPEED 160
15
#define ORBIT_CORRECTION 9
16

    
17

    
18
#define ORBIT_DIRECTION 4     // if 4, then orbit to the right; if -4, then orbit to the left
19

    
20
#define ORBIT_DISTANCE 175 // orbit distance as measured by rangefinders
21
#define ORBIT_STOP_DISTANCE 120
22

    
23

    
24
int orbit_state;    /*State machine variable.*/
25

    
26
int orbit_otherRobot; /* must be set prior to running FSM */
27

    
28

    
29
int orbit_pControl;                /*Proportional control variable, determines turn direction.*/
30
int orbit_d1,orbit_d2,orbit_d3,orbit_d4,orbit_d5;        /*The five distances taken in by IR.*/
31
int orbit_bom; /* bom data */
32
int orbit_theta; /* number of degrees traveled in orbit */
33
int orbit_theta_stop; /* stop condition in number of degrees traveled */
34

    
35
/* orbit_init
36
   argument: robot_id that you want to orbit
37
   notes: must call before orbit_fsm
38
*/
39
void orbit_init(int robot);
40

    
41
/* orbit_init_theta
42
   argument: robot_id that you want to orbit
43
             theta that you want to stop orbiting at
44
   notes: must call before orbit_fsm
45
*/
46
void orbit_init_theta(int robot,int theta);
47

    
48
/* orbit_fsm
49
   argument: none
50
   notes: call in a while loop to perform FSM action
51
*/
52
void orbit_fsm(void);
53

    
54
#endif