add agressive and defensive ready positions depending on robot availability - #2942
JackyBloxx wants to merge 2 commits into
Conversation
e896dd5 to
723bbeb
Compare
| }, | ||
| goalkeeper_pose: { position: [-4.2, 0.0], rotation: 0.0 }, | ||
| striker_pose: { position: [-0.6, 0.0], rotation: 0.0 }, | ||
| // Remaining players fill these support slots in descending player-number order. |
There was a problem hiding this comment.
Why are these comments different from the ones in the code?
| While playing, behavior periodically creates a State message. It contains the | ||
| player number, the robot pose, and the observed ball position and age when a | ||
| ball is available. A message is sent only when the robot has a field pose, the | ||
| send interval has elapsed, and the remaining game message budget is high | ||
| enough. | ||
| During Playing, behavior periodically creates a State message. It | ||
| contains the player number, the robot pose, and the observed ball position and | ||
| age when a ball is available. A message is sent only when the robot has a field | ||
| pose, the send interval has elapsed, and the remaining game message budget is | ||
| high enough. | ||
|
|
||
| The interval is configured by `network.hsl_playing_state_message_send_interval` | ||
| (300 ms by default). Received teammate states expire after | ||
| `player_states_receiver.playing_maximum_age` (one second). | ||
|
|
||
| Ready formation assignment uses the GameController lineup and sends no team | ||
| State messages. GameController return messages are sent independently during | ||
| Ready and the other states. | ||
|
|
||
| Received teammate states provide the poses used for closest-to-ball selection | ||
| and supporter positioning. Team communication can be absent or delayed, so the | ||
| tree retains branches for simple operation, the last active robot, and missing | ||
| ball information. | ||
| and supporter positioning during Playing. Team communication can be absent or | ||
| delayed, so the tree retains branches for simple operation, the last active | ||
| robot, and missing ball information. |
| While playing, behavior periodically creates a State message. It contains the | ||
| player number, the robot pose, and the observed ball position and age when a | ||
| ball is available. A message is sent only when the robot has a field pose, the | ||
| send interval has elapsed, and the remaining game message budget is high | ||
| enough. | ||
| During Playing, behavior periodically creates a State message. It | ||
| contains the player number, the robot pose, and the observed ball position and | ||
| age when a ball is available. A message is sent only when the robot has a field | ||
| pose, the send interval has elapsed, and the remaining game message budget is | ||
| high enough. |
| ## Ready Formations | ||
|
|
||
| Ready uses static poses from `behavior_node.kickoff`, expressed in field | ||
| coordinates (meters, with the own goal at negative x) and rotations in radians. |
There was a problem hiding this comment.
Specifying these units and coordinate frames here is redundant. We use these everywhere.
| - On opponent or unknown kickoff, all field players fill `defensive_positions` | ||
| in the same order. | ||
|
|
||
| The GameController's unpenalized lineup determines the active players. |
There was a problem hiding this comment.
"the GameController's lineup"?
what?
| let Some(ground_to_field) = blackboard.world_state.robot.ground_to_field else { | ||
| return Status::Failure; | ||
| }; |
There was a problem hiding this comment.
| let Some(ground_to_field) = blackboard.world_state.robot.ground_to_field else { | |
| return Status::Failure; | |
| }; | |
| let ground_to_field = blackboard.world_state.robot.ground_to_field.ok_or(Status::Failure)? |
There was a problem hiding this comment.
the function returns a Status and not a option of a status that is because i wrote it like that
| let Some(kickoff_pose) = select_kickoff_pose( | ||
| &blackboard.world_state, | ||
| blackboard.parameters.goalkeeper.player_number, | ||
| &blackboard.parameters.kickoff, | ||
| ) else { | ||
| return Status::Failure; | ||
| }; |
There was a problem hiding this comment.
| let Some(kickoff_pose) = select_kickoff_pose( | |
| &blackboard.world_state, | |
| blackboard.parameters.goalkeeper.player_number, | |
| &blackboard.parameters.kickoff, | |
| ) else { | |
| return Status::Failure; | |
| }; | |
| let kickoff_pose = select_kickoff_pose( | |
| &blackboard.world_state, | |
| blackboard.parameters.goalkeeper.player_number, | |
| &blackboard.parameters.kickoff, | |
| )?; |
There was a problem hiding this comment.
the function returns a Status and not a option of a status that is because i wrote it like that
| let kickoff_pose_in_field = | ||
| Pose2::from_parts(target_position, Orientation2::new(standard_pose.rotation)); | ||
| fn select_kickoff_pose( | ||
| world_state: &WorldState, |
There was a problem hiding this comment.
This is only used to short-circuit if we are penalized. Do that in the outer function pleasel.
Then you can drop the Option in the return type.
| kickoff_pose.position, | ||
| Orientation2::new(kickoff_pose.rotation), | ||
| ); | ||
| let walk_and_stand = blackboard.parameters.walking.walk_and_stand; |
There was a problem hiding this comment.
We are already in a "walk and stand" context. Calling this variable "walk and stand" is not useful.
Please call it something with "parameters".
5ae9c3d to
723bbeb
Compare
Why? What?
Currently every Robot number has fixed ready pose the problem: if there is no player with the number 3 there is no Robot to take the kickoff.
Whith this pr we now have a agressive and devensive player positioning and they replace each other if for example number 1,2 and 3 are on the field and 3 i penalized then in the next ready phase 2 would walk up to the kickoff position
Ideas for Next Iterations (Not This PR)
idea for the next iteration is that we have different ready poses for different number of player and not only a list where they fille each other spot up from top to bottom
How to Test
Test with 3 players how they walk in in ready if we have kickoff and not and with only player 1 and 2
player 2 should walk up to the kickoff position