Skip to content

Passing improvements#2516

Merged
CameronLyon merged 11 commits into
ros2from
passing-improvements
Mar 18, 2026
Merged

Passing improvements#2516
CameronLyon merged 11 commits into
ros2from
passing-improvements

Conversation

@CameronLyon
Copy link
Copy Markdown
Contributor

This pull request tackles the issues with passing by basically revamping the entire code/behavior behind the communication between bots, shooting calculations, and ball interpretation fixes. Here's the current issue:

Issues:

  • No wait on pass. When the bot kicks the ball towards a teammate, the bot immediately enters seeking/stealing and proceeds to chase after the ball it just passed to its friend.
  • Passing repeatedly. After passing once, the receiver will try to pass again back to the previous bot (who is clearly not open since it passed first), causing a chain reaction of non-stop passing until they are basically next to each other.
  • No checks on whether the bot can shoot. The reason behind the repeated passing is that the bots do not check if they are able to actually shoot uninterrupted from where they are standing, only if there are any bots blocking them.
  • Ball disappearing. Whenever a bot gets possession of the ball, the simulator freaks out and teleports (or remove) the ball from where it was. This happens 70% of the time

This pull request responds to these issues with the following changes:

  • Additional communication request/acknowledgment on the pass. When the bot passes the ball, there is one more communication request that waits for the receiver to send a signal that it received it. Until then, the bot waits (unless it fails to kick the ball or if it times out). This is the reason behind the creation of pass_received_request() file.
  • can_i_shoot() function implemented. Similar to check_is_open(), but focuses more on the the bots shooting trajectory rather than the bots receiving trajectory. If the bot can shoot from where it is, it is considered open.
  • broadcast_direct_pass() function repeated throughout POSSESSION, constantly calling out for an open receiver if it can't shoot directly and defaults to SHOOTING if it can't find someone withing 5 seconds.
  • Prevention of passing over the enemy's goalie box, avoiding the silly scenario where we pass into the goalie box.
  • Commented out "portion of ball_ = WorldBall()." This is one factor towards the ball vanishing and removing this line in world.cpp helps fix the issue (but not completely). If this line is for a more important purpose and mess up other features, please revert it.

If there are any logical mistakes, vague areas that need commenting, or anything else, lmk on this PR. Thx 😀

Copy link
Copy Markdown
Contributor

@shourikb shourikb left a comment

Choose a reason for hiding this comment

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

Some minor things, other than that logically looks good

Comment thread src/rj_strategy/src/agent/position/offense.cpp Outdated
Comment thread src/rj_strategy/src/agent/position/offense.cpp Outdated
Comment thread src/rj_strategy/src/agent/position/offense.cpp
automated style fixes

Co-authored-by: CameronLyon <CameronLyon@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

@Squid5678 Squid5678 left a comment

Choose a reason for hiding this comment

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

checked IRL seems good

automated style fixes

Co-authored-by: CameronLyon <CameronLyon@users.noreply.github.com>
@CameronLyon CameronLyon merged commit a16de47 into ros2 Mar 18, 2026
2 checks passed
@CameronLyon CameronLyon deleted the passing-improvements branch March 18, 2026 00:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants