Skip to content

Commit a734a20

Browse files
authored
Update go_to_ball.py
1 parent 440e04f commit a734a20

File tree

1 file changed

+3
-0
lines changed
  • bitbots_behavior/bitbots_body_behavior/bitbots_body_behavior/behavior_dsd/actions

1 file changed

+3
-0
lines changed

bitbots_behavior/bitbots_body_behavior/bitbots_body_behavior/behavior_dsd/actions/go_to_ball.py

+3
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ def __init__(self, blackboard, dsd, parameters):
2525
self.side_offset = parameters.get("side_offset", 0.08)
2626

2727
def perform(self, reevaluate=False):
28+
ball_position_y_relative = self.blackboard.world_model.field_width(self)[1]
29+
if ball_position_y_relative > 0:
30+
self.side_offset = - self.side_offset
2831
pose_msg = self.blackboard.pathfinding.get_ball_goal(self.target, self.distance, self.side_offset)
2932
self.blackboard.pathfinding.publish(pose_msg)
3033

0 commit comments

Comments
 (0)