-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmain.cpp
76 lines (62 loc) · 1.61 KB
/
main.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
// 11970720
// Vincent Jadraque
#include <iostream> // cout
#include <unistd.h> // usleep
#include "ranger.h"
#include "laser.h"
#include "sonar.h"
#include "radar.h"
#include "user_interface.h"
#include "ranger_fusion.h"
using namespace std;
int main(int argc, char *argv[])
{
// initialise laser sensor
Laser laser;
// query fixed parameters
showFixedParameters(laser);
cout << "Field of View ............. " << laser.getFieldOfView() << "\n\n" << endl;
// configure rest of parameters
askBaud(laser);
askPort(laser);
askAngularResolution(laser);
showNumberOfSamples(laser);
std::cout << "\n\n" << std::endl;
// printReadings(laser);
// initialise radar sensor
Radar radar;
// query fixed parameters
showFixedParameters(radar);
// configure rest of parameters
askFOV(radar);
askBaud(radar);
askPort(radar);
showNumberOfSamples(radar);
std::cout << "\n\n" << std::endl;
// printReadings(radar);
// initialise sonar sensor
Sonar sonar;
// query fixed parameters
showFixedParameters(sonar);
cout << "Field of View ............. " << sonar.getFieldOfView() << "\n\n" << endl;
// configure rest of parameters
askBaud(sonar);
askPort(sonar);
showNumberOfSamples(sonar);
std::cout << "\n\n" << std::endl;
// printReadings(sonar);
std::vector<Ranger*> rangers;
rangers = {&laser, &radar, &sonar};
RangerFusion fusion(rangers);
int a = 1;
askFusionType(fusion);
while(1)
{
std::cout << "\n\nData set " << a << ":" << std::endl;
printRawData(fusion);
printFusedData(fusion);
usleep(2000000);
a++;
}
return 0;
}