root / branches / encoders / code / behaviors / spline / server / internals.h @ 1342
History | View | Annotate | Download (798 Bytes)
1 | 1301 | ayeager | #ifndef INTERNALS_H
|
---|---|---|---|
2 | #define INTERNALS_H
|
||
3 | |||
4 | #define LS 0 |
||
5 | #define LD 1 |
||
6 | #define RS 2 |
||
7 | #define RD 3 |
||
8 | |||
9 | 1342 | ayeager | #define LEFT 0 |
10 | #define RIGHT 1 |
||
11 | |||
12 | 1301 | ayeager | #define FORWARD 1 |
13 | #define BACKWARD 0 |
||
14 | #define SENDER 1 |
||
15 | #define RECEIVER 0 |
||
16 | |||
17 | #define INFINITE -1 |
||
18 | 1342 | ayeager | #define L 13.5 |
19 | 1301 | ayeager | |
20 | 1342 | ayeager | #define DT .102 |
21 | 1301 | ayeager | |
22 | 1342 | ayeager | #define DIST(x1, y1, x2, y2) (sqrt(((x1)-(x2))*((x1)-(x2)) + ((y1)-(y2))*((y1)-(y2))))
|
23 | #define LOOK_AHEAD 30 |
||
24 | #define LOOK_AHEAD_ERR_THRES 5 |
||
25 | #define VELOCITY 20 |
||
26 | 1301 | ayeager | |
27 | typedef struct state |
||
28 | { |
||
29 | double x;
|
||
30 | double y;
|
||
31 | double theta;
|
||
32 | |||
33 | 1342 | ayeager | double vl;
|
34 | double vr;
|
||
35 | 1301 | ayeager | |
36 | 1342 | ayeager | double vl_ref;
|
37 | double vr_ref;
|
||
38 | 1301 | ayeager | } state; |
39 | |||
40 | typedef struct { |
||
41 | double *x;
|
||
42 | double *y;
|
||
43 | } curv_t; |
||
44 | |||
45 | state robot; |
||
46 | |||
47 | void updatePosition();
|
||
48 | |||
49 | void setAttriv(int file); |
||
50 | |||
51 | 1342 | ayeager | void pos_control_curve(curv_t *ref, int len); |
52 | 1301 | ayeager | |
53 | void velocityControl(double*, double*); |
||
54 | |||
55 | |||
56 | |||
57 | #endif |