-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
defender checks if goalie is active and acts like goalie if needed (#608
- Loading branch information
Showing
3 changed files
with
38 additions
and
1 deletion.
There are no files selected for viewing
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
22 changes: 22 additions & 0 deletions
22
...avior/bitbots_body_behavior/bitbots_body_behavior/behavior_dsd/decisions/goalie_active.py
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
from bitbots_blackboard.body_blackboard import BodyBlackboard | ||
from dynamic_stack_decider.abstract_decision_element import AbstractDecisionElement | ||
|
||
|
||
class GoalieActive(AbstractDecisionElement): | ||
""" | ||
Decides whether the goalie is on field or not | ||
""" | ||
|
||
blackboard: BodyBlackboard | ||
|
||
def __init__(self, blackboard, dsd, parameters): | ||
super().__init__(blackboard, dsd, parameters) | ||
|
||
def perform(self, reevaluate=False): | ||
if self.blackboard.team_data.get_is_goalie_active(): | ||
return "YES" | ||
else: | ||
return "NO" | ||
|
||
def get_reevaluate(self): | ||
return True |
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