Skip to content

Commit

Permalink
Merge pull request #68 from ultrainstinct30/VariableThresh
Browse files Browse the repository at this point in the history
Variable threshold of getPointBehindTheBall
  • Loading branch information
thebhatman authored Jun 25, 2019
2 parents 6031170 + 1bcd93a commit a26583f
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions utils/math_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,9 @@ def direction(vector):
return math.atan2(vector.y, vector.x)


def getPointBehindTheBall(point, theta):
x = point.x - (3.5 * BOT_RADIUS) * (math.cos(theta))
y = point.y - (3.5 * BOT_RADIUS) * (math.sin(theta))
def getPointBehindTheBall(point, theta, factor=3.5):
x = point.x + (factor * BOT_RADIUS) * (math.cos(theta))
y = point.y + (factor * BOT_RADIUS) * (math.sin(theta))
return Vector2D(int(x), int(y))

def getPointToGo(point, theta):
Expand Down Expand Up @@ -244,12 +244,6 @@ def stan_inverse(self,y,x):
else:
return atan2(y,x)+3.14159265


def getPointBehindTheBall(point ,theta, factor=3.5):
x = point.x +(factor * BOT_RADIUS) *(math.cos(theta))
y = point.y +(factor * BOT_RADIUS) *(math.sin(theta))
return Vector2D(int(x), int(y))

def vicinity_points(point1, point2, thresh=10):
return dist(point1, point2) < thresh

Expand Down

0 comments on commit a26583f

Please sign in to comment.