-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
57 lines (46 loc) · 1.3 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
#include <iostream>
#include "HistogramGrid.h"
#include "PolarHistogram.h"
#include "Utils.h"
#include "VFHPather.h"
#include "RobotTest.h"
#include <chrono>
#include <thread>
#include "Plotter.h"
int getIndex(int a, int n) {
return ((a % n) + n) % n;
}
int main()
{
// Start the robot at (30,30)
discretePoint init;
init.x = 30;
init.y = 30;
// TODO: Draw a thick line out of the center of the robot to indicate which
// direction it's traveling. - Josh
// double angle_init = 0.78; // pi/4
double angle_init = 90; // != pi/4
double speed_init = 0.5;
// TODO: I don't quite understand why you needed an entire new class for the
// execution of the program. You have something against the main method? - Josh
RobotTest bot(init, angle_init, speed_init);
int timestep = 100;
for(int i = 0; i < timestep; ++i)
{
std::cout<<i<<"th timestep: ";
bot.move();
bot.talk();
// bot.draw(gnuplot);
bot.draw();
std::this_thread::sleep_for(std::chrono::milliseconds(500));
std::cout << "\n\n\n\n\n\n";
}
// // VFHPather pather;
// // discretePoint robotLoc;
// // robotLoc.x = 25;
// // robotLoc.y = 25;
//
// // pather.updateRobotPosition(robotLoc);
// //pather.generateHistogram();
// // std:: cout << pather.computeTravelDirection();
}