-
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.
Merge branch 'main' into feature/imu_yaw_in_odometry
- Loading branch information
Showing
25 changed files
with
493 additions
and
302 deletions.
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
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
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 |
28 changes: 28 additions & 0 deletions
28
bitbots_behavior/bitbots_body_behavior/bitbots_body_behavior/behavior_dsd/demo.dsd
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,28 @@ | ||
#SearchBall | ||
@ChangeAction + action:searching, @LookAtFieldFeatures, @WalkInPlace + duration:3, @Turn | ||
|
||
#PerformKickLeft | ||
@ChangeAction + action:kicking, @LookAtFront, @WalkKick + foot:left + r:false, @WalkInPlace + duration:1 + r:false, @ForgetBall + r:false, @WalkInPlace + duration:1 + r:false, @LookAtFieldFeatures + r:false | ||
|
||
#PerformKickRight | ||
@ChangeAction + action:kicking, @LookAtFront, @WalkKick + foot:right + r:false, @WalkInPlace + duration:1 + r:false, @ForgetBall + r:false, @WalkInPlace + duration:1 + r:false, @LookAtFieldFeatures + r:false | ||
|
||
#KickWithAvoidance | ||
$AvoidBall | ||
NO --> $BallClose + distance:%ball_reapproach_dist + angle:%ball_reapproach_angle | ||
YES --> $BallKickArea | ||
NEAR --> $FootSelection | ||
LEFT --> #PerformKickLeft | ||
RIGHT --> #PerformKickRight | ||
FAR --> @ChangeAction + action:going_to_ball, @LookAtFront, @GoToBall + target:close | ||
NO --> @ChangeAction + action:going_to_ball + r:false, @LookAtFieldFeatures + r:false, @AvoidBallActive + r:false, @GoToBall + target:close + blocking:false + distance:%ball_far_approach_dist | ||
YES --> $ReachedPathPlanningGoalPosition + threshold:%ball_far_approach_position_thresh | ||
YES --> @AvoidBallInactive | ||
NO --> @ChangeAction + action:going_to_ball, @LookAtFieldFeatures, @GoToBall + target:close + distance:%ball_far_approach_dist | ||
|
||
-->BodyBehavior | ||
$DoOnce | ||
NOT_DONE --> @Stand + duration:15 | ||
DONE --> $BallSeen | ||
YES --> #KickWithAvoidance | ||
NO --> #SearchBall |
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
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 @@ | ||
<?xml version="1.0"?> | ||
<launch> | ||
<arg name="sim" default="false" description="Whether the robot is running in simulation or on real hardware" /> | ||
<arg name="behavior_dsd_file" default="demo.dsd" description="The behavior dsd file that should be used" /> | ||
|
||
<!-- load teamplayer software stack without some unnecessary stuff, that is not needed in the demo --> | ||
<include file="$(find-pkg-share bitbots_bringup)/launch/teamplayer.launch"> | ||
<arg name="behavior_dsd_file" value="$(var behavior_dsd_file)" /> | ||
<arg name="game_controller" value="false"/> | ||
<arg name="localization" value="false" /> | ||
<arg name="sim" value="$(var sim)" /> | ||
<arg name="teamcom" value="false" /> | ||
<arg name="path_planning" value="false" /> | ||
</include> | ||
|
||
<!-- load the path planning node in dummy mode, because we are limited by the map size otherwise and together with no localization | ||
this could lead to the robot not working after a while, because due to odometry errors the robot could be outside of the map --> | ||
<include file="$(find-pkg-share bitbots_path_planning)/launch/path_planning.launch"> | ||
<arg name="sim" value="$(var sim)" /> | ||
<arg name="dummy" value="true" /> | ||
</include> | ||
</launch> |
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
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
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,19 @@ | ||
import pyamdgpuinfo | ||
|
||
|
||
def collect_all(): | ||
""" | ||
use pyamdgpuinfo to get gpu metrics | ||
:return: (load, vram_used, vram_total, temperature) | ||
""" | ||
if pyamdgpuinfo.detect_gpus() == 0: | ||
return (0, 0, 0, 0) | ||
|
||
gpu = pyamdgpuinfo.get_gpu(0) | ||
load = gpu.query_load() | ||
vram_total = gpu.memory_info["vram_size"] | ||
vram_used = gpu.query_vram_usage() | ||
temperature = gpu.query_temperature() | ||
|
||
return (load, vram_used, vram_total, temperature) |
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
Oops, something went wrong.