Skip to content

Commit 71691e0

Browse files
authored
version 4.py
1 parent e034c13 commit 71691e0

File tree

1 file changed

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

1 file changed

+3
-1
lines changed

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

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import math
2+
13
from bitbots_blackboard.body_blackboard import BodyBlackboard
24
from bitbots_blackboard.capsules.pathfinding_capsule import BallGoalType
35
from dynamic_stack_decider.abstract_action_element import AbstractActionElement
@@ -26,7 +28,7 @@ def __init__(self, blackboard, dsd, parameters):
2628

2729
def perform(self, reevaluate=False):
2830
ball_position_y_relative = self.blackboard.world_model.get_ball_position_uv[1]
29-
self.side_offset = -1 * math.copysign(self.side_offset)
31+
self.side_offset = -1 * math.copysign(self.side_offset,ball_position_y_relative)
3032
pose_msg = self.blackboard.pathfinding.get_ball_goal(self.target, self.distance, self.side_offset)
3133
self.blackboard.pathfinding.publish(pose_msg)
3234

0 commit comments

Comments
 (0)