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 update: Kicking team filtering #1571

Closed

Conversation

ThagonDuarte
Copy link
Contributor

@ThagonDuarte ThagonDuarte commented Jan 11, 2025

Why? What?

This PR expands and depends on #1646. It uses the detected free kick signals and uses them to filter the kicking team. In the case, we are not sent a kicking team, the filter either determines it by use of the last ball position, or uses the detected free kick signal. This is then propagated to the FilteredGameControllerState.

Fixes #1476

ToDo / Known Issues

  • Handle not knowing the kicking_team
  • 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

Ideas for Next Iterations (Not This PR)

  • Determine kicking_team directly by looking at the Penalty set in the same GameControllerMessage as the transition to the SubState PushingFreeKick.
  • Also use team_ball in KickingTeamFilter. Depends on Time to reach rework #1634

How to Test

  • In play, trigger the four free kicks CornerKick, GoalKick, KickIn, and PushingFreeKick.
    • 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 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 4 times, most recently from cc47d34 to 34d4a28 Compare January 14, 2025 09:07
@ThagonDuarte ThagonDuarte force-pushed the visual-referee-2025-rule-update branch 2 times, most recently from 14ee607 to cd31aff Compare January 22, 2025 18:06
@ThagonDuarte ThagonDuarte force-pushed the visual-referee-2025-rule-update branch from cd31aff to f32c27a Compare January 29, 2025 15:05
@ThagonDuarte ThagonDuarte changed the title Visual Referee during free kicks Visual Referee update: kicking team filtering Feb 20, 2025
@ThagonDuarte ThagonDuarte changed the title Visual Referee update: kicking team filtering Visual referee update: Kicking team filtering Feb 20, 2025
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: Done
Development

Successfully merging this pull request may close these issues.

Rule Changes: Visual Referee
1 participant