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

Implement substitutions using the deploy.toml #1670

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

julianschuler
Copy link
Member

@julianschuler julianschuler commented Mar 6, 2025

Why? What?

Blocked in #1669.

This PR implements in-game substitutions using the deploy.toml.

The substitutions specified in the deploy.toml are applied in order, with the final assignment determining the currently playing robots (for pregame). The postgame is applied to all NAOs listed in the deploy.toml to ensure that all logs are retrieved.

Resolves #1660.

ToDo / Known Issues

None.

Ideas for Next Iterations (Not This PR)

None.

How to Test

cp deploy.toml.example deploy.toml
pepsi pregame
pepsi postgame first-half

Now, add a substitution to the deploy.toml and observe how the behavior of the pre- and postgame commands change regarding their player number assignments and NAOs to upload to/download from.

Comment on lines 123 to 135
fn assignments(&self) -> HashMap<PlayerNumber, NaoAddress> {
let mut assignments: HashMap<_, _> = self
.assignments
.iter()
.map(|assignment| (assignment.player_number, assignment.nao_address))
.collect();

for substitution in &self.substitutions {
assignments.insert(substitution.player_number, substitution.nao_address);
}

assignments
}
Copy link
Contributor

Choose a reason for hiding this comment

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

If you had a duplicate player number in the assignments, you would no longer throw an error anymore, correct? I don't think that's what we want

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point, I now reintroduced a check for duplicates in the initial assignment.

@oleflb oleflb self-assigned this Mar 7, 2025
@oleflb oleflb added the tools:Tooling Related to pepsi et.al. label Mar 7, 2025
@oleflb
Copy link
Contributor

oleflb commented Mar 8, 2025

Ok, iirc you wanted to check the correctness of assignments separately from the substitutions, right? Please ping me when finished

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tools:Tooling Related to pepsi et.al.
Projects
Status: Request for Review
Development

Successfully merging this pull request may close these issues.

Handle substitutes in deploy.toml
2 participants