Commit 0f0a2ce5 authored by Matthew Hausknecht's avatar Matthew Hausknecht

Fixed bug in goal detection.

parent 46abc1fe
...@@ -430,7 +430,7 @@ class Trainer(object): ...@@ -430,7 +430,7 @@ class Trainer(object):
def isGoal(self): def isGoal(self):
""" Returns true if a goal has been scored. """ """ Returns true if a goal has been scored. """
return (self._ballPosition[0] > self._allowedBallX[1]) \ return (self._ballPosition[0] > self._allowedBallX[1]) \
and (numpy.abs(self._ballPosition[1]) < self._SP['goal_width']) and (numpy.abs(self._ballPosition[1]) <= 0.5 * self._SP['goal_width'])
def isOOB(self): def isOOB(self):
""" Returns true if the ball is out of bounds. """ """ Returns true if the ball is out of bounds. """
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment