Skip to content

Commit

Permalink
Merge pull request #310 from JdeRobot/issue-308
Browse files Browse the repository at this point in the history
Removed unneeded code from keras brain
  • Loading branch information
sergiopaniego authored Feb 4, 2022
2 parents 1e5c35f + 4369742 commit ee35ffa
Showing 1 changed file with 0 additions and 17 deletions.
17 changes: 0 additions & 17 deletions behavior_metrics/brains/f1/brain_f1_keras.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,23 +72,6 @@ def update_frame(self, frame_id, data):
"""
self.handler.update_frame(frame_id, data)

def check_center(self, position_x):
if (len(position_x[0]) > 1):
x_middle = (position_x[0][0] + position_x[0][len(position_x[0]) - 1]) / 2
not_found = False
else:
# The center of the line is in position 326
x_middle = 326
not_found = True
return x_middle, not_found

def get_point(self, index, img):
mid = 0
if np.count_nonzero(img[index]) > 0:
left = np.min(np.nonzero(img[index]))
right = np.max(np.nonzero(img[index]))
mid = np.abs(left - right) / 2 + left
return int(mid)

def execute(self):
"""Main loop of the brain. This will be called iteratively each TIME_CYCLE (see pilot.py)"""
Expand Down

0 comments on commit ee35ffa

Please sign in to comment.