-
Notifications
You must be signed in to change notification settings - Fork 2
/
SmartKhepera.cpp
76 lines (59 loc) · 1.21 KB
/
SmartKhepera.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 "SmartKhepera.h"
CSmartKhepera::CSmartKhepera()
{
m_pUtil = new CKheperaUtility();
m_pControl = new CController(m_pUtil);
m_pOperate = new COperator(m_pUtil);
m_pValues = new CValueSystem(m_pUtil);
}
CSmartKhepera::~CSmartKhepera()
{
StopLearning();
StopRobot();
delete m_pValues;
delete m_pOperate;
delete m_pControl;
delete m_pUtil;
}
void CSmartKhepera::StartRobot()
{
m_pControl->Start();
m_pOperate->Start();
}
void CSmartKhepera::StopRobot()
{
StopLearning();
m_pOperate->Stop();
m_pControl->Stop();
m_pUtil->SetSpeed({ {0,0} });
m_pControl->ListNodes();
}
void CSmartKhepera::StartLearning()
{
m_pValues->Start();
}
void CSmartKhepera::StopLearning()
{
m_pValues->Stop();
}
void CSmartKhepera::StopMoving()
{
m_pOperate->Stop();
m_pUtil->SetSpeed({ {0,0} });
}
void CSmartKhepera::StartVerbosity()
{
m_pUtil->SetVerbosity(true);
}
void CSmartKhepera::StopVerbosity()
{
m_pUtil->SetVerbosity(false);
}
void CSmartKhepera::SaveNodes(std::string path)
{
m_pControl->SaveNodesToFile(path);
}
void CSmartKhepera::LoadNodes(std::string path)
{
m_pControl->LoadNodesFromFile(path);
}