Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Visual Referee during free kicks #1571

Draft
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

ThagonDuarte
Copy link
Contributor

@ThagonDuarte ThagonDuarte commented Jan 11, 2025

Why? What?

The rule update for the 2025 season introduces a change to the set play of free kicks. Instead of sending the kicking team in the game controller message during all free kicks, now, during CornerKick, GoalKick, KickIn, and PushingFreeKick no kicking team will be sent in the game controller message. Instead, the head referee will give a visual signal to indicate the direction of play for the kicking team. This means a signal in the direction of the goal of the HULKs indicates that the Opponent is the kicking team. This signal can be seen below:

Set play visual referee signal

This expands our current visual referee implementation to now also detect this free kick visual referee signal.
We only try to detect the visual referee signal in KickIn and PushingFreeKick, since the kicking_team during CornerKick and GoalKick can be deduced from the current ball position and the teams GlobalFieldSide, i.e. whether their are home or away. During KickIn and PushingFreeKick, when Home the DefenderRight and MidfielderRight should look at the referee and do the detection. When Away, this is done by DefenderLeft and MidfielderLeft.

Fixes #1476

ToDo / Known Issues

  • Handle not knowing the kicking_team
  • Implement behavior for looking at the referee for pose detection during set plays.
  • Implement detection logic and filtering.
  • Use detection to set kicking_team and propagate to other Naos.
  • Filter kicking_team to directly compute it in the SubStates CornerKick and GoalKick.
  • Implement bevyhavior simulator scenarios for
    • Check that all roles only perform passive Actions while kicking_team is not known yet (is None), i.e. that no NAO directly walks to the ball and tries to kick it.
    • Check that None as kicking_team is handled correctly
    • Check KickingTeamFilter works as intended
    • Check behavior for visual referee during free kicks works correctly

Ideas for Next Iterations (Not This PR)

How to Test

  • In play, trigger the four free kicks CornerKick, GoalKick, KickIn, and PushingFreeKick.
    • Check that during KickIn and PushingFreeKick the only the correct defender and midfielder look at the referee and do the visual signal detection.
    • Check that during GoalKick and CornerKick the correct kicking_team is produced by KickingTeamFilter and is correctly propagated to all nodes ready kicking_team.
    • Check that the visual referee free kick pose signal is detected, filtered, and interpreted correctly.
  • Check that the detected kicking_team is propagated correctly to all nodes importing kicking_team.

Please also test where behavior had to be adapted to not knowing the kicking_team some of the time:

  • In ball_state_composer.rs a side_factor uses the kicking_team. What is its value for kicking_team == None`?
  • In stand.rs the kicking_team is read multiple times to determine the Half.
  • In localization.rs the kicking_team is used to modify_state().
  • In rule_obstacle_composer.rs the create_penalty_box() uses the kicking_team.
  • In search_suggestor.rs uses the kicking_team to determine the Half.
  • The PathDeserialize implementation of Option requires a default to be defined for the underlying type T. Here this means Team has to receive a default value. Is Opponent a reasonable choice for this?

@ThagonDuarte ThagonDuarte added the rules:2025 Changes needed to comply to rule changes for the SPL 2025 Season. label Jan 11, 2025
@ThagonDuarte ThagonDuarte added this to the Seasongoal 2025 milestone Jan 11, 2025
@ThagonDuarte ThagonDuarte self-assigned this Jan 11, 2025
@ThagonDuarte ThagonDuarte changed the title Determine kicking_team during free kick set plays Visual Referee during free kicks Jan 11, 2025
@ThagonDuarte ThagonDuarte force-pushed the visual-referee-2025-rule-update branch 3 times, most recently from 3822b94 to cc47d34 Compare January 12, 2025 12:03
@ThagonDuarte ThagonDuarte force-pushed the visual-referee-2025-rule-update branch from cc47d34 to 34d4a28 Compare January 14, 2025 09:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rules:2025 Changes needed to comply to rule changes for the SPL 2025 Season.
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

Rule Changes: Visual Referee
1 participant