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

Wall tactic #1661

Merged
merged 28 commits into from
Jun 17, 2021
Merged

Wall tactic #1661

merged 28 commits into from
Jun 17, 2021

Conversation

kfu02
Copy link
Contributor

@kfu02 kfu02 commented Jun 13, 2021

Description

Creates wall tactic, which builds a wall of n robots between the ball and the goal.

Associated Issue

https://app.clickup.com/t/v5cpe0

Steps to test

Test Case 1

  1. Start & run sim
  2. Move ball slowly around the field (either with slow left-click + drag or kicks under 6 m/s)
  3. Kick ball toward goal

Expected result: 3 robots (ids 0-2) should move to form a wall and track the ball (relatively) smoothly. They should block the ball from being scored. They should also never enter the penalty box or touch its bounding lines.

Test Case 2

  1. Start & run sim
  2. Change the number in the init() method of gameplay's play/wall_ball.py that controls how many robots are in the wall tactic
  3. Repeat Test Case 1

Expected result: N robots should move now, same behavior as before.

Known Issues

  • Moving the ball too quickly will cause the robots to scramble
  • Sim will occasionally crash, complaining that:
[gameplay_node-11]     self.move.face_point = self.face_point
[gameplay_node-11] AttributeError: 'Move' object has no attribute 'face_point'

This is not true; both move action and move skill have a face_point. Relaunch sim if this error pops up.

Copy link
Contributor

@HussainGynai HussainGynai left a comment

Choose a reason for hiding this comment

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

You probably don't need to maintain a copy of worldstate and ball_pt

rj_gameplay/rj_gameplay/gameplay_node.py Outdated Show resolved Hide resolved
rj_gameplay/rj_gameplay/tactic/wall_tactic.py Outdated Show resolved Hide resolved
rj_gameplay/rj_gameplay/tactic/wall_tactic.py Outdated Show resolved Hide resolved
rj_gameplay/rj_gameplay/tactic/wall_tactic.py Outdated Show resolved Hide resolved
@kfu02 kfu02 requested a review from HussainGynai June 14, 2021 02:33
Copy link
Contributor

@HussainGynai HussainGynai left a comment

Choose a reason for hiding this comment

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

LGTM, just remove the bal_pt and goal_pt in the init of wall tactic

rj_gameplay/rj_gameplay/tactic/wall_tactic.py Outdated Show resolved Hide resolved
@Yudai-8-om Yudai-8-om self-requested a review June 15, 2021 03:01
Copy link
Contributor

@Yudai-8-om Yudai-8-om left a comment

Choose a reason for hiding this comment

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

LGTM!

rj_gameplay/rj_gameplay/tactic/wall_tactic.py Outdated Show resolved Hide resolved
rj_gameplay/rj_gameplay/tactic/wall_tactic.py Outdated Show resolved Hide resolved
rj_gameplay/rj_gameplay/tactic/wall_tactic.py Outdated Show resolved Hide resolved
@kfu02 kfu02 requested review from kylestach, Yudai-8-om and HussainGynai and removed request for Yudai-8-om June 16, 2021 00:35
Copy link
Contributor

@kylestach kylestach left a comment

Choose a reason for hiding this comment

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

One minor nit

rj_gameplay/rj_gameplay/tactic/wall_tactic.py Outdated Show resolved Hide resolved
@kfu02 kfu02 mentioned this pull request Jun 16, 2021
@kfu02
Copy link
Contributor Author

kfu02 commented Jun 16, 2021

'fix invisible robot assignment' fixed the flaky wall assignment issues, as some robots that weren't visible were being assigned to be part of the wall

for i in range(self.num_wallers)
}

for se, rr in role_requests.items():
Copy link
Contributor Author

Choose a reason for hiding this comment

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

take out these debug prints

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done in different PR, ignore for now

Copy link
Contributor

@HussainGynai HussainGynai left a comment

Choose a reason for hiding this comment

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

LGTM

@kfu02 kfu02 merged commit 85b116c into ros2 Jun 17, 2021
@kfu02 kfu02 deleted the wall_tactic branch June 17, 2021 15:47
@kfu02 kfu02 mentioned this pull request Jun 17, 2021
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.

4 participants