-
Notifications
You must be signed in to change notification settings - Fork 0
/
naointerface.cpp
76 lines (63 loc) · 2.16 KB
/
naointerface.cpp
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#include "naointerface.h"
using namespace IAL;
NaoInterface::NaoInterface(boost::shared_ptr<AL::ALBroker> broker,
const std::string &name):
AL::ALModule(broker, name)
{
setModuleDescription("Inteface to NAO important functionality.");
// Bindings
functionName("startBallDetection", getName(), "Starts ball detection.");
addMethodExample("python",
"# Starts ball detection\n"
"naointefaceProxy = ALProxy(\"IAL::NaoInterface\", \"127.0.0.1\", 9559)\n"
"naointefaceProxy.startBallDetection()\n"
);
addParam("trackingOn", "Turn on tracking of the ball. Defaults to false.");
BIND_METHOD(NaoInterface::startBallDetection);
functionName("stopDetection", getName(), "Stops ball detection.");
addMethodExample("python",
"# Starts ball detection\n"
"naointefaceProxy = ALProxy(\"IAL::NaoInterface\", \"127.0.0.1\", 9559)\n"
"naointefaceProxy.stopBallDetection()\n"
);
BIND_METHOD(NaoInterface::stopBallDetection);
functionName("startBallTracking", getName(), "Starts ball tracking.");
addMethodExample("python",
"# Starts ball tracking\n"
"naointefaceProxy = ALProxy(\"IAL::NaoInterface\", \"127.0.0.1\", 9559)\n"
"naointefaceProxy.startBallTracking()\n"
);
BIND_METHOD(NaoInterface::startBallTracking);
functionName("stopBallTracking", getName(), "Stops ball tracking.");
addMethodExample("python",
"# Stops ball tracking\n"
"naointefaceProxy = ALProxy(\"IAL::NaoInterface\", \"127.0.0.1\", 9559)\n"
"naointefaceProxy.stopBallTracking()\n"
);
BIND_METHOD(NaoInterface::stopBallTracking);
mBallDetector = new BallDetector(broker);
}
NaoInterface::~NaoInterface()
{
stopBallDetection();
}
void NaoInterface::init()
{
startBallDetection();
}
void NaoInterface::startBallDetection(const bool & trackingOn)
{
mBallDetector->startDetection(trackingOn);
}
void NaoInterface::stopBallDetection()
{
mBallDetector->stopDetection();
}
void NaoInterface::startBallTracking()
{
mBallDetector->startTracking();
}
void NaoInterface::stopBallTracking()
{
mBallDetector->stopTracking();
}