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