-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
executable file
·39 lines (33 loc) · 922 Bytes
/
main.cpp
File metadata and controls
executable file
·39 lines (33 loc) · 922 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 <cstdlib>
#include <cstring>
#include <iostream>
#include <math.h>
#include "node.h"
#include "pendulum.h"
#include "point.h"
using namespace std;
#ifndef st_type
#define st_type
typedef vector<double> state_type;
#endif
int main(int argc, char* argv[]) {
//cout << (fmod((-6.3*3.14),(2*3.14))/3.14) << endl;
Point goal;
int iterations;
if (argc == 6) {
iterations = atoi(argv[1]);
goal.x = atof(argv[2]);
goal.v = atof(argv[3]);
goal.theta = atof(argv[4]);
goal.w = atof(argv[5]);
} else{
cout << "Wrong number of arguments, exiting.\n";
exit(0);
}
vector<double> times;
vector<state_type> trajectory;
Node* start = new Node(0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, NULL, times, trajectory);
Pendulum* p = new Pendulum(start, goal);
p->FindOptimalPathIterations(iterations);
p->PhaseDiagram(&argc, argv);
}