@@ -21,11 +21,9 @@ int take_baseline(int R_state_l, int R_state_old_l, steps* p_steps_l, int* p_fla
21
21
{
22
22
p_steps_l->peak = 0 ;
23
23
p_steps_l->flag_start_plant = false ;
24
- // Serial.println(" BASE Dorsi too short");
25
24
return 0 ;
26
25
} else {
27
26
p_steps_l->flag_start_plant = true ; // Parameters inizialized Start a step
28
- // Serial.println(" BASE Start Plantar");
29
27
}
30
28
}
31
29
}
@@ -37,7 +35,6 @@ int take_baseline(int R_state_l, int R_state_old_l, steps* p_steps_l, int* p_fla
37
35
// if you transit from 3 to 1 plantar flexion is completed and start dorsiflexion
38
36
39
37
if ((R_state_old_l == 3 ) && (R_state_l == 1 || R_state_l == 2 )) {
40
- // Serial.println(" BASE Start Dorsi");
41
38
42
39
// start dorsiflexion
43
40
@@ -48,21 +45,16 @@ int take_baseline(int R_state_l, int R_state_old_l, steps* p_steps_l, int* p_fla
48
45
if (p_steps_l->plant_time <= step_time_length)
49
46
{
50
47
p_steps_l->flag_start_plant = false ;
51
- // Serial.println("BASE Plant too short"); // it means is a glitch not a real step
52
48
return 0 ;
53
49
} else {
54
50
p_steps_l->flag_start_plant = false ; // you have provided one plant
55
- // Serial.println("Increase Plant number");
56
51
p_steps_l->count_plant_base ++; // you have accomplished a step
57
- // Serial.println(p_steps_l->count_plant_base);
58
52
}
59
53
60
- // Serial.print(" BASE Plant Time = ");
61
- // Serial.println(p_steps_l->plant_time);
62
54
63
55
if ((p_steps_l->count_plant_base ) >= 2 ) { // avoid the first step just to be sure
64
56
65
- // // this is the time window of the filter for the dorsiflexion
57
+ // this is the time window of the filter for the dorsiflexion
66
58
if (((p_steps_l->count_plant_base ) - 2 ) >= n_step_baseline) {
67
59
68
60
p_steps_l->dorsi_mean = 0 ;
@@ -96,29 +88,19 @@ int take_baseline(int R_state_l, int R_state_old_l, steps* p_steps_l, int* p_fla
96
88
p_steps_l->plant_peak_mean_temp = 1.0 * (p_steps_l->plant_peak_mean_temp ) / n_step_baseline; // Gain (1.0) was 0.9 2/25/2019 GO
97
89
98
90
// HERE
99
-
100
- // Serial.println("BASE before return");
101
- // Serial.print(" Peak ");
102
- // Serial.println(p_steps_l->peak);
103
- // Serial.print(" N ");
104
- // Serial.println(p_steps_l->count_plant_base);
105
91
}
106
92
else {
107
93
p_steps_l->four_step_dorsi_time [p_steps_l->count_plant_base - 2 ] = p_steps_l->dorsi_time ;
108
94
109
95
p_steps_l->four_step_plant_time [p_steps_l->count_plant_base - 2 ] = p_steps_l->plant_time ;
110
96
111
97
p_steps_l->four_step_plant_peak [p_steps_l->count_plant_base - 2 ] = p_steps_l->peak ;
112
- // Serial.println("Inside Peak vector ");
113
98
114
99
for (int i = 0 ; i < n_step_baseline; i++) {
115
- // Serial.println(p_steps_l->four_step_plant_peak[i]);
116
100
}
117
101
}
118
102
119
103
if (((p_steps_l->count_plant_base ) - 2 ) >= n_step_baseline) {
120
- // Serial.print("BASE return peak mean temporary");
121
- // Serial.println(p_steps_l->plant_peak_mean_temp);
122
104
}
123
105
if (((p_steps_l->count_plant_base ) - 2 ) >= n_step_baseline) {
124
106
(p_steps_l->count_plant_base ) = 0 ;
@@ -181,10 +163,6 @@ double Control_Adjustment(Leg* leg, int R_state_l, int R_state_old_l, steps* p_s
181
163
182
164
183
165
if (taking_baseline_l == 0 && p_steps_l->plant_peak_mean_temp != p_steps_l->plant_peak_mean ) {
184
- // Serial.println("Updated peak mean values");
185
- // Serial.print(p_steps_l->plant_peak_mean);
186
- // Serial.print(" -> ");
187
- // Serial.println(p_steps_l->plant_peak_mean_temp);
188
166
p_steps_l->plant_peak_mean = p_steps_l->plant_peak_mean_temp ;
189
167
}
190
168
@@ -263,14 +241,6 @@ double Control_Adjustment(Leg* leg, int R_state_l, int R_state_old_l, steps* p_s
263
241
// start dorsiflexion
264
242
p_steps_l->dorsi_time = millis ();
265
243
266
- // if (p_steps_l->flag_N3_adjustment_time) { // If you wanted to adjust the smoothing as a function of the speed
267
- // // check for the first step in order to see if everything started properly
268
- // if (p_steps_l->n_steps == 1) {
269
- // Serial.println(" N3 Adj activated");
270
- // }
271
- // p_steps_l->n_steps++;
272
- // }
273
-
274
244
// calculate plantarflexion
275
245
p_steps_l->plant_time = millis () - (p_steps_l->plant_time );
276
246
@@ -284,9 +254,6 @@ double Control_Adjustment(Leg* leg, int R_state_l, int R_state_old_l, steps* p_s
284
254
285
255
p_steps_l->flag_start_plant = false ; // you have provided one step
286
256
287
- // Serial.print(" Plant Time = ");
288
- // Serial.println(p_steps_l->plant_time);
289
-
290
257
if (p_steps_l->count_plant >= 2 ) {
291
258
// this is the time window of the filter for the plantarflexion
292
259
if (p_steps_l->count_plant - 2 >= n_step_baseline) {
@@ -309,12 +276,6 @@ double Control_Adjustment(Leg* leg, int R_state_l, int R_state_old_l, steps* p_s
309
276
p_steps_l->plant_mean = p_steps_l->plant_mean / n_step_baseline;
310
277
}
311
278
312
- // if (p_steps_l->flag_N3_adjustment_time) {
313
- // N3_l = round((p_steps_l->plant_mean) * p_steps_l->perc_l);
314
- // if (N3_l <= 4) N3_l = 4;
315
- // if (N3_l >= 500) N3_l = 500;
316
- // }
317
-
318
279
319
280
}// end if R old 3 i.e. finish plantarflexion
320
281
}// end if flag_start_plant
0 commit comments