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

defender checks if goalie is active and acts like goalie if needed #608

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

Conversation

cleWu03
Copy link
Contributor

@cleWu03 cleWu03 commented Oct 31, 2024

Summary

Proposed changes

Related issues

Checklist

  • Run colcon build
  • Write documentation
  • Test on your machine
  • Test on the robot
  • Create issues for future work
  • Triage this PR and label it

@cleWu03 cleWu03 self-assigned this Oct 31, 2024
@cleWu03 cleWu03 requested review from Flova and ayin21 November 7, 2024 17:26
team_data_infos = filter(is_a_goalie, team_data_infos)

# Count valid team data infos (aka robots with valid team data)
return sum(map(self.is_valid, team_data_infos)) == 1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could use any() instead of sum() == 1. It would be slightly more performant, but for the small number of robots the gains should be negligible.

Copy link
Member

@Flova Flova left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested it, looks good to me! Good job.

@bit-bots bit-bots deleted a comment from coderabbitai bot Nov 11, 2024
@Flova
Copy link
Member

Flova commented Nov 11, 2024

Feel free to remove the draft status and merge it if you think it is ready.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: 👀 In review
Development

Successfully merging this pull request may close these issues.

2 participants