fixed sort by yaw feeder

This commit is contained in:
iperov 2019-01-07 09:40:00 +04:00
parent 3b0b1a7dec
commit 12dd7fcae5

View file

@ -72,9 +72,9 @@ class SampleLoader:
return sample_list return sample_list
@staticmethod @staticmethod
def upgradeToFaceYawSortedSamples( YAW_RAWS ): def upgradeToFaceYawSortedSamples( samples ):
lowest_yaw, highest_yaw = -32, +32 lowest_yaw, highest_yaw = -256, +256
gradations = 64 gradations = 64
diff_rot_per_grad = abs(highest_yaw-lowest_yaw) / gradations diff_rot_per_grad = abs(highest_yaw-lowest_yaw) / gradations
@ -85,7 +85,7 @@ class SampleLoader:
next_yaw = lowest_yaw + (i+1)*diff_rot_per_grad next_yaw = lowest_yaw + (i+1)*diff_rot_per_grad
yaw_samples = [] yaw_samples = []
for s in YAW_RAWS: for s in samples:
s_yaw = s.yaw s_yaw = s.yaw
if (i == 0 and s_yaw < next_yaw) or \ if (i == 0 and s_yaw < next_yaw) or \
(i < gradations-1 and s_yaw >= yaw and s_yaw < next_yaw) or \ (i < gradations-1 and s_yaw >= yaw and s_yaw < next_yaw) or \