# Untitled

unknown
plain_text
7 days ago
1.8 kB
3
Indexable
Never
```#_fr - number of frame    prep_fr, jerk_fr, takeoff_fr, peak_fr, landing_fr, damping_fr, recup_fr = 0, 0, 0, 0, 0, 0, -1
hip_prep, hip_jerk, hip_peak, hip_damping, hip_takeoff = hipy[0], hipy[0], hipy[0], hipy[0], hipy[0]    toe_takeoff, v_takeoff = toey[0], vhipy[0]
for i in range(10, len(vhipy)):
if (angles['kne_angle'][i]<160) and (vhipy[i]<-0.1):            prep_fr = i
hip_prep = hipy[i]            break
for i in range(prep_fr, len(vhipy)):        if vhipy[i] > 0.1:
jerk_fr = i            hip_jerk = hipy[i]
break    for i in range(jerk_fr, len(vtoey)):
if  (toey[i]>toey[prep_fr:i].mean()+3*toey[prep_fr:i].std()) and vtoey[i]>0.1:  #            takeoff_fr = i
hip_takeoff = hipy[i]            toe_takeoff = toey[i]
v_takeoff = vhipy[i]            break
#TODO: more stable algorythm
for i in range(takeoff_fr+1, len(ahipy)):        if (vhipy[i]*vhipy[i-1]<=0) and (ahipy[i]<0):
peak_fr = i            hip_peak = hipy[i]
break
for i in range(peak_fr+1, len(toey)):        if (toey[i]-toe_takeoff)*(toey[i-1]-toe_takeoff)<=0:
landing_fr = i            break
for i in range(landing_fr+1, len(ahipy)):        if (vhipy[i]*vhipy[i-1]<=0) and (ahipy[i]>0):
damping_fr = i            hip_damping = hipy[i]
break    for i in range(damping_fr+1, len(ahipy)):
if ahipy[i]<0 and vhipy[i]>0 and vhipy[i]<0.05 or hipy[i]>hip_prep:            recup_fr = i
break    for i in range(takeoff_fr, landing_fr):
grf[i]=0     for i in range(len(grf)):
if grf[i]<0:            grf[i]=0
power = grf*vhipy*G
for i in range(len(power)):        if power[i]<0:
power[i]=0```