-
Notifications
You must be signed in to change notification settings - Fork 56
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
Replace player number with jersey number #1449
Replace player number with jersey number #1449
Conversation
0a55ea8
to
6f203d9
Compare
859349a
to
3f9bcc8
Compare
1d0948d
to
2f51548
Compare
f18844e
to
9d81cbf
Compare
2f6ee0e
to
19a8b91
Compare
2bfa5a4
to
37d75a7
Compare
37d75a7
to
e57a4f5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oof, I expected this to be easier
GameControllerCommand::SetGameState(game_state) => { | ||
match game_state { | ||
GameState::Ready | GameState::Standby => { | ||
for mut robot in &mut robots { | ||
let parameters = &robot.parameters; | ||
let initial_pose = parameters | ||
.localization | ||
.initial_poses | ||
.get(robot.database.main_outputs.walk_in_position_index) | ||
.cloned() | ||
.unwrap_or_default(); | ||
robot.database.main_outputs.ground_to_field = Some( | ||
generate_initial_pose(&initial_pose, ¶meters.field_dimensions) | ||
.as_transform(), | ||
); | ||
} | ||
} | ||
_ => {} | ||
}; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this a task of the autoref?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This and the time.ticks problem are connected. The robots only generate their proper poses if localization is running, which is not the case in the behavior simulator. This needs to be called at least once between standby and ready, which explicitly calling GameState::Ready combined with the code above does. The alternative is tracking the last game state in the robots resource to call it there. @knoellle Maybe you have a suggestion of whats best practice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The alternative is to include a sorting function in the hulks_setup which sorts all of the robots ahead of time. I had this implemented before but found it to be a little bit messier than needed
}); | ||
if !send_spl_striker_message && is_lowest_number_without { | ||
new_role = Role::ReplacementKeeper; | ||
if let (Some(0), Some(x)) = ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is x
. Consider renaming your variable
@@ -461,10 +473,14 @@ fn process_role_state_machine( | |||
_ => decide_if_claiming_striker_or_other_role( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this function now has 10 arguments, just saying
Closed as benefit of having more jersey numbers does not outweigh potential drawbacks this PR introduces. See #1587 |
Pull request was closed
Why? What?
This takes apart the double task that player number was performing and splits it into jersey number and behavior dependent on active field robots, regardless of their jersey number.
Created to replace #1021 in order to not do double work on refactoring the behavior simulator.
ToDo / Known Issues
Depends on #1428
Fixes #1417
Fixes #1298
- [ ] HULKs aufstellung in intercept ball?node.rs
Ideas for Next Iterations (Not This PR)
How to Test
The CI being green is the first sign that on the behavior side everything seems to work.
The rest needs to be tested in test games with various
playeruhh jersey number configurations.