-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcheckwall.cpp
More file actions
40 lines (40 loc) · 905 Bytes
/
checkwall.cpp
File metadata and controls
40 lines (40 loc) · 905 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
40
#include <iostream>
#include <vector>
#include "data.cpp"
#include <math.h>
class Checkwall {
IR* ir1;
IR* ir2;
IR* ir3;
IR* ir4;
float dis1, dis2, dis3, dis4;
Location* wall;
bool runinwall;
const float DT=10.0;
public:
Checkwall (IR* _ir1, IR* _ir2, IR* _ir3, IR* _ir4) {
ir1 = _ir1;
ir2 = _ir2;
ir3 = _ir3;
ir4 = _ir4;
dis1 = 20.0; dis2 = 20.0; dis3 = 20.0; dis4 = 15.0;
runinwall = false;
}
bool check() {
float dis1 = ir1->getDistance();
float dis2 = ir2->getDistance();
float dis3 = ir3->getDistance();
float dis4 = ir4->getDistance();
return ((dis1>DT)||(dis2>DT)||(dis3>DT)||(dis4>DT));
}
std::vector<Location> location_of_wall(){
std::vector<Location> list;
list.push_back(asdfasdf);
list.push_back(asdffad);
return list;
std::vector<Location> list = wall.location_of_wall();
for (int i = 0; i < list.size(); ++i) {
Location loc = list[i];
}
}
}