add kick test script

This commit is contained in:
徐学颢
2026-04-19 21:16:41 +08:00
parent 2568fc1a9a
commit c8080d0815
5 changed files with 42 additions and 35 deletions

View File

@@ -104,7 +104,7 @@ class Agent:
self.agent.skills_manager.execute("Neutral")
else:
# self.execute_support_behavior()
self.agent.skills_manager.execute("Neutral")
self.kick_ball()
self.agent.robot.commit_motor_targets_pd()
@@ -205,22 +205,22 @@ class Agent:
b=target_point,
)
kick_offset = MathOps.rotate_2d_vec(np.array([0.0, -0.1]), desired_orientation)
close_to_ball = my_to_ball_dist <= 0.24
good_orientation = orientation_error <= 14.0
good_orientation = orientation_error <= 8.0
good_lateral_offset = lateral_error_to_shot_line <= 0.16
in_shooting_range = ball_to_target_dist <= 12.0
can_shoot = (
close_to_ball
and behind_ball
and good_orientation
and good_lateral_offset
and in_shooting_range
)
if not can_shoot:
prepare_offset = 0.06
prepare_pos = ball_pos - ball_to_target_dir * prepare_offset
prepare_offset = 0.1
prepare_pos = ball_pos - ball_to_target_dir * prepare_offset + kick_offset
self.agent.skills_manager.execute(
"Walk",