-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmain.cpp
49 lines (38 loc) · 1.05 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
#include "ROCINTool.h"
#include <OpenSim/OpenSim.h>
#include <OpenSim/Simulation/Manager/Manager.h>
#include "TestHelper.h"
#include <time.h>
using namespace OpenSim;
int main(int argc, const char* argv[])
{
if(argc!=2 && argc!=6)
{
std::cout<<"Bad arguments !"<<std::endl;
std::cout<<"Usage: ROCIN [setUpFile] "<<std::endl;
std::cout<<" Or: ROCIN eval [modelFile] [file1] [file2] [errFile] "<<std::endl;
exit(1);
}
// This is generally how we call ROCIN controller
if(argc == 2)
{
std::string filename = argv[1];
ROCINTool* rocinTool = new ROCINTool(filename);
rocinTool->run();
}
//This is to print out coord tracking error given two files (e.g. desired kinematics file and a state file)
else
{
if(strcmp(argv[1],"eval")!=0)
{
std::cout<<"Unrecognized option "<<argv[1]<<"!!!"<<std::endl;
exit(1);
}
std::string modelFile = argv[2];
std::string file1 = argv[3];
std::string file2 = argv[4];
std::string errFile = argv[5];
ROCINTool::evalCoordTrackingErrs(modelFile,file1,file2,errFile);
}
return 0;
}