-
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
Split player and role numbers #1021
Conversation
de709d1
to
aa07881
Compare
a4c51c7
to
2d660a8
Compare
a863fe2
to
0707b34
Compare
dfc8b9b
to
2947b6d
Compare
Naming suggestion |
Do we actually need the |
I talked to @h3ndrk at some point about this as well and theoretically no, the roles enum containing numbers
Not sure whats the best here |
2947b6d
to
ee04f51
Compare
ee04f51
to
9c3ea7f
Compare
9c3ea7f
to
2fdbc99
Compare
c99d0f1
to
734fc43
Compare
dc8c3ee
to
73c3fcb
Compare
73c3fcb
to
613fda7
Compare
Closed in favor of #1449 |
Pull request was closed
Introduced Changes
This PR splits apart player and role numbers.This is just the foundational work to split the actual enums etc.
It does not yet enable us to play with other jersey number/role combinations.
However, to keep this PR relatively small the implementation of a mapping from playernumbers to roles for the purpose of penalties will be a separate PR.
ToDo / Known Issues
- [x] Fixplayers.rs
and probably add aroles.rs
- [X] Fixrole_assignment.rs
according to mapping above- [X] Fix behavior simulatorAfter talking with @schmidma the idea is to completely remove the player/role number enum, and make role assignment all dependent on increasing jersey numbers, with the exception of the goalkeeper.
We should rely more on information we receive from the game controller about which robots are in play and use that information to make decisions.
-[ ] How do we deal with the initial setup positions, especially if we pick up a robot after deployment and no longer have time to move all other robots around to other positions if we make the positions jersey number dependentAfter some brainstorming the problem and solution are actually quite simple:
This is what @schmidma and I discussed, The main issue we noticed from this is the following:
All robots are placed on the touchlines during the initial phase. For example consider jersey numbers 1,2,3,5,7,9,13.
They are placed starting with 1 where we normally place the goalkeeper, 2, and 3 on the same side, and then wrapping around to the other side 5,7,9,13, such that the 13 stands closest to the goal opposite the goal keeper.
The issue now is that if during the initial phase we last minute decide to remove a single robot, and no longer are able to reposition all others, the initial position hypothesis is off. For example, if we remove the 3 and positions are assigned lowest to highest, it means that the 5 will now think it is in the position of the 3, aka on the opposite side of the field, resulting in immediate flipping.
However, all of this was under the assumptions that the robots sort themselves by jersey number based on robots which have no penalty according to the game controller.
The solution is simply to sort robots according to jersey number based on if they don't have a substitute penalty, i.e. they are one of the playing 7 robots. Thus if last minute a robot is picked up and receives a picked up penalty, it is still considered as one of the 7 playing and the positions do not need to be shifted at all.
Ideas for Next Iterations (Not This PR)
- [ ] Implement a mapping of role numbers to player numbers, so that when checking if for example the striker is penalized the check goes throughpenalties[mapping[striker number]]
and correctly determines if the striker is in fact penalized- [ ] Deal with robots leaving and entering the field when a substitution occurs, i.e. end a single team message from the robot that has entered the field and update the mapping with itHow to Test
The robots and pepsi can be used the same as before, i.e.pepsi playernumber 35:1 32:2
etc.Behavior in game should not be different than before.
Other assignments such as
32:1:1, 34:9:2, 35:10
should fail.