Skip to content

Commit

Permalink
maid typo fixes, and fixed the recieve action to work properly
Browse files Browse the repository at this point in the history
  • Loading branch information
HussainGynai committed Jun 18, 2021
1 parent 5d9eee2 commit adcc0a8
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
4 changes: 3 additions & 1 deletion rj_gameplay/rj_gameplay/action/receive.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ def tick(self, intent) -> None:
return intent

def is_done(self, world_state) -> bool:
if self.robot_id is None:
return False
#TODO: Use local params for this threshold
if np.linalg.norm(world_state.ball.vel) < 0.005:
if world_state.our_robots[self.robot_id].has_ball_sense or np.linalg.norm(world_state.ball.vel) < 10**(-6):
return True
return False
2 changes: 1 addition & 1 deletion rj_gameplay/rj_gameplay/play/test_pass.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,5 @@ def tick(

return (skill_dict, skills)

def is_done(self ,world_state):
def is_done(self, world_state: rc.WorldState):
return self.pass_tactic.is_done(world_state)
5 changes: 3 additions & 2 deletions rj_gameplay/rj_gameplay/skill/capture.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from rj_gameplay.action import capture
from stp.skill.action_behavior import ActionBehavior
import stp.rc as rc
from typing import Optional

class ICapture(skill.ISkill, ABC):
...
Expand All @@ -22,8 +23,8 @@ class ICapture(skill.ISkill, ABC):
"""
class Capture(ICapture):

def __init__(self):
self.robot: rc.Robot = None
def __init__(self, robot: Optional[rc.Robot]=None):
self.robot = robot
self.__name__ = 'Capture'
self.capture = capture.Capture()
self.capture_behavior = ActionBehavior('Capture', self.capture, self.robot)
Expand Down
6 changes: 3 additions & 3 deletions rj_gameplay/rj_gameplay/skill/pivot_kick.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ class PivotKick(IPivotKick):
A pivot kick skill
"""

def __init__(self, target_point:np.array, chip:bool, kick_speed:float, robot:rc.Robot=None) -> None:
#TODO: Have something which automatically determines kick speed based on targert point distance
def __init__(self, target_point: np.array, chip: bool, kick_speed: float, robot: rc.Robot=None) -> None:
#TODO: Have something which automatically determines kick speed based on target point distance
self.__name__ = 'pivot kick'
self.robot = robot
self.chip= chip
self.chip = chip
self.kick_speed = kick_speed
self.root = Sequence("Sequence")
self.target_point = target_point
Expand Down

0 comments on commit adcc0a8

Please sign in to comment.