-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathK9.cpp
More file actions
39 lines (30 loc) · 745 Bytes
/
Copy pathK9.cpp
File metadata and controls
39 lines (30 loc) · 745 Bytes
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
#include "K9.h"
K9::K9(){
k9 = this;
// Init sensors
this->sensorLeft = new Sensor(-10, 20, WEST);
this->sensorRight = new Sensor(10, 20, EAST);
this->sensorFront = new Sensor(0, 40, NORTH);
// Init sensorHelpers
this->sensorHelperLeft = NULL;
this->sensorHelperRight = NULL;
// Init PositionControl
this->positionControl = new PositionControl();
// Init Graph
this->graph = new Graph();
}
K9::~K9(){
// Free sensors
delete this->sensorLeft;
delete this->sensorRight;
delete this->sensorFront;
// Free sensorHelpers
if(sensorHelperLeft != NULL)
delete sensorHelperLeft;
if(sensorHelperRight != NULL)
delete sensorHelperRight;
// Free PositionControl
delete this->positionControl;
// Free Graph
delete graph;
}