Newer
Older
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
#include "fishingNet.h"
#ifdef ROBOTHW
#include "interfaceServosNumeriques.h"
#endif
FishingNet* FishingNet::getSingleton()
{
static FishingNet* instance = 0;
if(instance == 0)
instance = new FishingNet();
return instance;
}
FishingNet::FishingNet()
{
close();
}
void FishingNet::moveArm(int __attribute__((__unused__)) destAngle)
{
#ifdef ROBOTHW
ServosNumeriques::moveTo(destAngle, SERVO_EXT_ID);
#endif
}
void FishingNet::rotateArm(int __attribute__((__unused__)) destAngle)
{
#ifdef ROBOTHW
ServosNumeriques::moveTo(destAngle, SERVO_INT_ID);
#endif
}
void FishingNet::close()
{
rotateArm(SERVO_INT_RAISED_POS);
moveArm(SERVO_EXT_CLOSED_POS);
}
void FishingNet::deploy()
{
moveArm(SERVO_EXT_DEPLOYED_POS);
rotateArm(SERVO_INT_RAISED_POS);
}
void FishingNet::lowerNet()
{
rotateArm(SERVO_INT_LOWERED_POS);
}
void FishingNet::raiseNet()
{
rotateArm(SERVO_INT_RAISED_POS);
}
void FishingNet::raiseArm()
{
moveArm(SERVO_EXT_RAISED_POS);
}