@@ -35,7 +35,7 @@ using namespace std;
35
35
36
36
void testPendulum ();
37
37
void testPendulumExternalLoad ();
38
- void testPendulumExternalLoadWithPointInGround ();
38
+ void testPendulumExternalLoadWithPointInGround ();
39
39
void testArm26 ();
40
40
void testGait2354 ();
41
41
void testGait2354WithController ();
@@ -95,7 +95,7 @@ void testPendulumExternalLoad() {
95
95
ASSERT (results.getLastTime () == 1.0 );
96
96
97
97
Storage standard (" Results/pendulum_states.sto" );
98
-
98
+
99
99
100
100
Array<double > data;
101
101
int i = results.getSize () - 1 ;
@@ -104,10 +104,10 @@ void testPendulumExternalLoad() {
104
104
data.setSize (state->getSize ());
105
105
standard.getDataAtTime (time, state->getSize (), data);
106
106
int nc = forward.getModel ().getNumCoordinates ();
107
- for (int j = 0 ; j < nc; ++j) {
107
+ for (int j = 0 ; j < nc; ++j) {
108
108
stringstream message;
109
- message << " t=" << time <<" state# " << j << " "
110
- << standard.getColumnLabels ()[j+1 ] << " std=" << data[j]
109
+ message << " t=" << time <<" state# " << j << " "
110
+ << standard.getColumnLabels ()[j+1 ] << " std=" << data[j]
111
111
<<" computed=" << state->getData ()[j];
112
112
ASSERT_EQUAL (data[j], state->getData ()[j], 1e-2 ,
113
113
__FILE__, __LINE__, " ASSERT_EQUAL FAILED " + message.str ());
@@ -132,7 +132,7 @@ void testPendulumExternalLoadWithPointInGround() {
132
132
data.setSize (state->getSize ());
133
133
standard.getDataAtTime (time, state->getSize (), data);
134
134
int nc = forward.getModel ().getNumCoordinates ();
135
- for (int j = 0 ; j < nc; ++j) {
135
+ for (int j = 0 ; j < nc; ++j) {
136
136
stringstream message;
137
137
message << " t=" << time <<" state# " << j << " " << standard.getColumnLabels ()[j+1 ]
138
138
<< " std=" << data[j] <<" computed=" << state->getData ()[j];
@@ -160,7 +160,7 @@ void testArm26() {
160
160
for (int j = 0 ; j < state->getSize (); ++j) {
161
161
stringstream message;
162
162
message << " t=" << time <<" state# " << j << " " << standard->getColumnLabels ()[j+1 ] << " std=" << data[j] <<" computed=" << state->getData ()[j] << endl;
163
- ASSERT_EQUAL (data[j], state->getData ()[j], 5.0e-3 ,
163
+ ASSERT_EQUAL (data[j], state->getData ()[j], 5.0e-3 ,
164
164
__FILE__, __LINE__, " ASSERT_EQUAL FAILED " + message.str ());
165
165
cout << " ASSERT_EQUAL PASSED " << message.str ();
166
166
}
@@ -173,7 +173,7 @@ void testArm26() {
173
173
for (int j = 0 ; j < state->getSize (); ++j) {
174
174
stringstream message;
175
175
message << " t=" << time <<" state# " << j << " " << standard->getColumnLabels ()[j+1 ] << " std=" << data[j] <<" computed=" << state->getData ()[j] << endl;
176
- ASSERT_EQUAL (data[j], state->getData ()[j], 5.0e-3 ,
176
+ ASSERT_EQUAL (data[j], state->getData ()[j], 5.0e-3 ,
177
177
__FILE__, __LINE__, " ASSERT_EQUAL FAILED " + message.str ());
178
178
cout << " ASSERT_EQUAL PASSED " << message.str ();
179
179
}
@@ -189,7 +189,7 @@ void testGait2354()
189
189
Storage* standard = new Storage ();
190
190
string statesFileName (" std_subject01_walk1_states.sto" );
191
191
forward.loadStatesStorage ( statesFileName, standard );
192
-
192
+
193
193
int nstates = forward.getModel ().getNumStateVariables ();
194
194
int nq = forward.getModel ().getNumCoordinates ();
195
195
std::vector<double > rms_tols (2 *nstates, 0.001 ); // activations and fiber-lengths
@@ -198,11 +198,12 @@ void testGait2354()
198
198
rms_tols[2 *i] = 0.035 ; // coordinates at less than 2degrees
199
199
rms_tols[2 *i+1 ] = 2.5 ; // speeds can deviate by a lot due to open-loop test
200
200
}
201
-
202
- CHECK_STORAGE_AGAINST_STANDARD (results, *standard, rms_tols,
201
+
202
+ CHECK_STORAGE_AGAINST_STANDARD (results, *standard, rms_tols,
203
203
__FILE__, __LINE__, " testGait2354 failed" );
204
204
}
205
205
206
+
206
207
void testGait2354WithController () {
207
208
ForwardTool forward (" subject01_Setup_Forward_Controller.xml" );
208
209
forward.run ();
@@ -220,7 +221,7 @@ void testGait2354WithController() {
220
221
rms_tols[2 *i] = 0.01 ; // coordinates at less than 0.6 degree
221
222
rms_tols[2 *i+1 ] = 0.1 ; // speeds should deviate less with feedback controller
222
223
}
223
-
224
+
224
225
CHECK_STORAGE_AGAINST_STANDARD (results, *standard, rms_tols,
225
226
__FILE__, __LINE__, " testGait2354WithController failed" );
226
227
}
@@ -242,8 +243,6 @@ void testGait2354WithControllerGUI() {
242
243
forward.updateModelForces (*model, " " );
243
244
forward.setModel (*model);
244
245
245
- model->initSystem ();
246
-
247
246
forward.run ();
248
247
249
248
// For good measure we'll make sure we still get the identical results
0 commit comments