-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathKnowledgeBase.cpp
50 lines (41 loc) · 1.16 KB
/
KnowledgeBase.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
#include "KnowledgeBase.hpp"
CKnowledgeBase::CKnowledgeBase () {
OdometryPositionData.fX = 0.0;
OdometryPositionData.fY = 0.0;
OdometryPositionData.fTheta = 0.0;
LidarPositionData.fX = 0.0;
LidarPositionData.fY = 0.0;
LidarPositionData.fTheta = 0.0;
m_fCalculatedDrivingDirection = 0;
m_fTargetDrivingAngle = 0;
m_nMainLoopTicksPerSecond = 0;
m_fCurrentBattteryVoltage = 0.0;
m_bIsConnected = false;
for (int i=0;i<271;i++) {
m_nScannerData[i] = 0;
}
for (int i=0;i<4;i++) {
m_nOdometryTicks[i] = 0;
}
for (int i=0;i<4;i++) {
m_nCurrentMotorPower[i] = 0;
}
}
void CKnowledgeBase::SetScannerData (unsigned short int nScanerData[]) {
for (int i=0; i<271;i++) {
m_nScannerData[i] = nScanerData[i];
}
}
void CKnowledgeBase::SetOdometryTicks (int nOdometryTicks[]) {
for (int i=0; i<4;i++) {
m_nOdometryTicks[i] += nOdometryTicks[i];
}
}
void CKnowledgeBase::SetOdometryTicksSinceLastUpdate (int nOdometryTicks[]) {
for (int i=0; i<4;i++) {
m_nOdometryTicksSinceLastupdate[i] = nOdometryTicks[i];
}
}
void CKnowledgeBase::SetCurrentMotorPower (int nMotorNumber, int nCurrentMotorPower) {
m_nCurrentMotorPower[nMotorNumber-1] = nCurrentMotorPower;
}