Created
September 15, 2017 21:10
-
-
Save JNeiger/55098286cb0f7262138f1ed6b28c71e0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import play | |
import behavior | |
import robocup | |
import main | |
import constants | |
class TestIdle(play.Play): | |
def __init__(self): | |
super().__init__(continuous=True) | |
self.add_transition(behavior.Behavior.State.start, | |
behavior.Behavior.State.running, lambda: True, | |
"immediately") | |
self.win_eval = robocup.WindowEvaluator(main.system_state()) | |
def execute_running(self): | |
start = robocup.Point(0,4) | |
windows, best = self.win_eval.eval_pt_to_our_goal(start) | |
# draw shot triangle | |
pts = [start, | |
best.segment.get_pt(0), | |
best.segment.get_pt(1)] | |
shot_color = (255, 0, 0, 150) # translucent red | |
main.system_state().draw_polygon(pts, shot_color, | |
"Defense") | |
main.system_state().draw_segment( | |
best.segment, constants.Colors.Red, | |
"Defense") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment