Skip to content

Commit

Permalink
accept only cube for given size
Browse files Browse the repository at this point in the history
  • Loading branch information
martind committed Sep 27, 2016
1 parent 4520561 commit 6225a38
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cube.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
from apyros.metalog import MetaLog, disableAsserts

import numpy as np
import math


def load_background():
Expand Down Expand Up @@ -67,10 +68,13 @@ def detect_cubes(raw_laser_data, verbose=False):
while right_index < len(arr) and arr[right_index] < cube_max_dist:
right_index += 1
center_index = (left_index + right_index)/2
cube_size = math.radians(right_index - left_index) * arr[center_index]/1000.0
if verbose:
print left_index, index, right_index, '->', center_index
print arr[left_index:right_index+1]
return [(center_index, arr[center_index])]
print "CUBE SIZE", cube_size
if 0.1 < cube_size < 0.25:
return [(center_index, arr[center_index])]
return []

if __name__ == "__main__":
Expand Down

0 comments on commit 6225a38

Please sign in to comment.