Skip to content

Commit ee2d6d8

Browse files
authored
Assume the volume of goal post while decide to kick straight (#804)
2 parents 6155b36 + a756a8a commit ee2d6d8

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/bitbots_behavior/bitbots_blackboard/bitbots_blackboard/capsules/pathfinding_capsule.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,8 @@ def get_ball_goal(self, target: BallGoalType, distance: float, side_offset: floa
160160
ball_x, ball_y = self._blackboard.world_model.get_ball_position_xy()
161161

162162
# Play in any part of the opponents goal, not just the center
163-
if abs(ball_y) < self._blackboard.world_model.goal_width / 2:
163+
# Adjust for the goal post width (-0.06)
164+
if abs(ball_y) < self._blackboard.world_model.goal_width / 2 - 0.06:
164165
goal_angle = 0
165166
# Play in the opposite direction if the ball is near the opponent goal back line
166167
elif ball_x > self._blackboard.world_model.field_length / 2 - 0.2:

0 commit comments

Comments
 (0)