-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHexapod.h
53 lines (42 loc) · 1.18 KB
/
Hexapod.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
#ifndef HEXAPOD_H
#define HEXAPOD_H
#include "HexapodLeg.h"
#include <Servo.h>
enum WalkDirection { FW, BW };
enum RotateDirection { L, R };
class Hexapod
{
protected:
HexapodLeftLeg l_FL;
HexapodRightLeg l_MR;
HexapodLeftLeg l_BL;
HexapodRightLeg l_FR;
HexapodLeftLeg l_ML;
HexapodRightLeg l_BR;
static const int _slowSpeed = 1;
static const int _fastSpeed = _slowSpeed * 3;
public:
Hexapod();
~Hexapod();
// Movement //
void WriteAllServos();
// Static positions
void RestPosition();
void GoToRestPosition();
void LeftWalkPosition();
void GoToLeftWalkPosition();
void RightWalkPosition();
void GoToRightWalkPosition();
void G1LeftRotatePosition();
void GoToG1LeftRotatePosition();
void G1RightRotatePosition();
void GoToG1RightRotatePosition();
// Travelling
//void WalkForward(int steps, int delayTime); // Deprecated
//void WalkBackward(int steps, int delayTime); // Deprecated
void Walk(WalkDirection direction, int steps, int delayTime);
void Rotate(RotateDirection direction, int steps, int delayTime);
void RotateLeft(int degrees); // Currently unimplemented
void RotateRight(int degrees); // Currently unimplemented
};
#endif