-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathSpider.h
62 lines (54 loc) · 1.51 KB
/
Spider.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#ifndef SPIDER_H
#define SPIDER_H
#include<Leg.h>
struct Mover {
Angle leftTop;
Angle leftCenter;
Angle leftBottom;
Angle rightTop;
Angle rightCenter;
Angle rightBottom;
};
const Mover MOVE_TURN_LEFT = {LEG_FORWARD, LEG_FORWARD, LEG_FORWARD, LEG_BACK, LEG_BACK, LEG_BACK};
const Mover MOVE_TURN_RIGHT = {LEG_BACK, LEG_BACK, LEG_BACK, LEG_FORWARD, LEG_FORWARD, LEG_FORWARD};
const Mover MOVE_CROUCH = {LEG_CROUCH, LEG_CROUCH, LEG_CROUCH, LEG_CROUCH, LEG_CROUCH, LEG_CROUCH};
const Mover MOVE_STANDUP = {LEG_STD, LEG_STD, LEG_STD, LEG_STD, LEG_STD, LEG_STD};
struct SpiderAdapter {
Leg leftTop;
Leg leftCenter;
Leg leftBottom;
Leg rightTop;
Leg rightCenter;
Leg rightBottom;
};
//const SpiderAdapter STANDART_SPIDER_ADAPTER;
class Spider
{
public:
Spider(SpiderAdapter spiderAdapter);
Spider(
Leg leftTop,
Leg leftCenter,
Leg leftBottom,
Leg rightTop,
Leg rightCenter,
Leg rightBottom );
Spider();
void setLegs(
Leg leftTop,
Leg leftCenter,
Leg leftBottom,
Leg rightTop,
Leg rightCenter,
Leg rightBottom );
//void dance();
void moving(Mover mover, int del = 10);
private:
Leg leftTop;
Leg leftCenter;
Leg leftBottom;
Leg rightTop;
Leg rightCenter;
Leg rightBottom;
};
#endif // SPIDER_H