forked from JustinSi/ROCIN_prototype
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtestROCIN.cpp
85 lines (64 loc) · 2.39 KB
/
testROCIN.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
77
78
79
80
81
82
83
84
85
// INCLUDE
#include <OpenSim/Simulation/Model/Model.h>
#include <OpenSim/Simulation/Model/AnalysisSet.h>
#include "ROCINTool.h"
#include <OpenSim/Tools/ForwardTool.h>
#include <OpenSim/Auxiliary/auxiliaryTestFunctions.h>
using namespace OpenSim;
using namespace std;
void testROCINSingleMuscle();
void testROCINArm();
void testSub01();
int main() {
SimTK::Array_<std::string> failures;
//try { testROCINSingleMuscle(); }
//try{ testROCINArm(); }
try{ testSub01(); }
catch (const std::exception& e)
{
cout << e.what() << endl; failures.push_back("testROCINArm_rigid");
}
// redo with the Millard2012EquilibriumMuscle
// Object::renameType("Thelen2003Muscle", "Millard2012EquilibriumMuscle");
/* Object::renameType("Millard2012EquilibriumMuscle", "Thelen2003Muscle");
try { testROCINSingleMuscle(); }
catch (const std::exception& e)
{
cout << e.what() << endl;
failures.push_back("testROCINSingleMuscle_Thelen");
}
if (!failures.empty()) {
cout << "Done, with failure(s): " << failures << endl;
return 1;
}*/
cout << "Done" << endl;
return 0;
}
void testROCINSingleMuscle() {
cout << "\n******************************************************************" << endl;
cout << "* testROCINSingleMuscle *" << endl;
cout << "******************************************************************\n" << endl;
ForwardTool forward("block_hanging_from_muscle_Setup_Forward.xml");
forward.run();
ROCINTool rocin("block_hanging_from_muscle_Setup_ROCIN.xml");
rocin.run();
Storage fwd_result("block_hanging_from_muscle_ForwardResults/block_hanging_from_muscle_states.sto");
Storage rocin_result("block_hanging_from_muscle_ResultsROCIN/ROCIN_states.sto");
//Array<double> tols(0.0005, 4);
Array<double> tols(0.5, 4);
//const string& muscleType = rocin.getModel().getMuscles()[0].getConcreteClassName();
//string base = "testROCINSingleMuscle " + muscleType;
string base = "testROCINSingleMuscle ";
CHECK_STORAGE_AGAINST_STANDARD(rocin_result, fwd_result, tols, __FILE__, __LINE__, base + " failed");
cout << "\n" << base << " passed\n" << endl;
}
void testROCINArm()
{
ROCINTool rocin("arm26_Setup_ROCIN.xml");
rocin.run();
}
void testSub01()
{
ROCINTool rocin("walk2D_skeleton_Setup_ROCIN.xml");
rocin.run();
}