Skip to content

Commit

Permalink
Fixes orbit angles when not lining up for a straight kick.
Browse files Browse the repository at this point in the history
  • Loading branch information
jzalinger committed Jun 13, 2012
1 parent ad1e04d commit 8f7c159
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions src/man/noggin/kickDecider/HackKickInformation.py
Expand Up @@ -282,29 +282,36 @@ def shoot(self):
if (180 - leftScorePoint) - (rightScorePoint - 90) < 0:
#Closer to the leftScorePoint
kick = self.chooseBackKick()
kick.h = 1 #HACK
else:
kick = kicks.RIGHT_SIDE_KICK
kick.h = 90 - avgScorePoint
elif rightScorePoint > 0:
# Quadrent 1
if (90 - leftScorePoint) - (rightScorePoint - 0) < 0:
kick = kicks.RIGHT_SIDE_KICK
kick.h = 90 - avgScorePoint
else:
kick = self.chooseQuickFrontKick()
kick.h = 0 - avgScorePoint
elif rightScorePoint > -90:
# Quadrent 4
if (0 - leftScorePoint) - (rightScorePoint + 90) < 0:
kick = self.chooseQuickFrontKick()
kick.h = 0 - avgScorePoint
else:
kick = kicks.LEFT_SIDE_KICK
kick.h = -90 - avgScorePoint
else:
# Quadrent 3
if (-90 - leftScorePoint) - (rightScorePoint + 180) < 0:
kick = kicks.LEFT_SIDE_KICK
kick.h = -90 - avgScorePoint
else:
kick = self.chooseBackKick()
kick.h = 1 #HACK

if kick is not None:
kick.h = -1*avgScorePoint
return kick

#DEBUG printing
Expand Down Expand Up @@ -356,12 +363,12 @@ def kickWithLeftFoot(self):

def __str__(self):
s = ""
if self.oppLeftPostBearing is not None:
s += ("Opp left post bearing is: " + str(self.oppLeftPostBearing) +
" dist is: " + str(self.oppLeftPostDist) + "\n")
if self.oppRightPostBearing is not None:
s += ("Opp right post bearing is: " + str(self.oppRightPostBearing)
+ " dist is: " + str(self.oppRightPostDist) + "\n")
if self.farLeftPostBearing is not None:
s += ("Far left post bearing is: " + str(self.farLeftPostBearing) +
" dist is: " + str(self.farLeftPostDist) + "\n")
if self.farRightPostBearing is not None:
s += ("Far right post bearing is: " + str(self.farRightPostBearing)
+ " dist is: " + str(self.farRightPostDist) + "\n")
if self.nearLeftPostBearing is not None:
s += ("Near left post bearing is: " + str(self.nearLeftPostBearing) +
" dist is: " + str(self.nearLeftPostDist) + "\n")
Expand Down

0 comments on commit 8f7c159

Please sign in to comment.