Fix/goalkeeping - #92
Conversation
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…troller.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR implements improvements to the defensive algorithm in robot soccer, introducing a perpendicular cut-off strategy for defenders and enhanced coordination between defenders and the goalkeeper.
Changes:
- Modified
goalkeep.pyto calculate goalkeeper positioning based on defender positions using line intersection geometry - Added
goal_keep.pycontaining the previous defender algorithm implementation - Completely rewrote
defend_parameter.pywith a new perpendicular interception algorithm - Added
mathimport tostandard_ssl.py
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 21 comments.
| File | Description |
|---|---|
| utama_core/skills/src/goalkeep.py | Updated goalkeeper positioning to coordinate with defenders using intersection calculations; removed ball possession handling logic |
| utama_core/skills/src/goal_keep.py | New file containing the old defend_parameter implementation; appears to be unused dead code |
| utama_core/skills/src/defend_parameter.py | Complete rewrite implementing perpendicular ball interception strategy with hardcoded field positions |
| utama_core/rsoccer_simulator/src/ssl/envs/standard_ssl.py | Added unused math import |
| def intersection_with_vertical_line(a, b, x_line=4.5): | ||
| xa, ya = a | ||
| xb, yb = b | ||
| if xb < xa: | ||
| return a | ||
|
|
||
| k = (yb - ya) / (xb - xa) | ||
| y_intersect = ya + k * (x_line - xa) | ||
| if y_intersect < -0.5: | ||
| return (x_line, -0.5) | ||
| elif y_intersect > 0.5: | ||
| return (x_line, 0.5) | ||
| return (x_line, y_intersect) |
There was a problem hiding this comment.
The intersection_with_vertical_line function doesn't consider the my_team_is_right parameter. The x_line default value of 4.5 is hardcoded and will be incorrect when defending the left goal.
| x2, y2 = 4.5, goal_frame + 0.2 if robot_id == 1 else goal_frame - 0.2 | ||
| x3, y3, x4, y4 = positions_to_defend_parameter(x2, y2) | ||
| target_pos = np.array([x4, y4]) | ||
|
|
||
| else: | ||
| # TODO (deploy more defenders, or find closest shooter?) | ||
| sd = shooters_data[0] | ||
| target_tracking_coord = Vector2D(sd.p.x, sd.p.y) | ||
| orientation = sd.orientation | ||
|
|
||
| real_def_pos = game.friendly_robots[defender_id].p | ||
| current_def_parametric = to_defense_parametric(game, real_def_pos) | ||
| target = align_defenders(game, current_def_parametric, target_tracking_coord, orientation, env) | ||
| cmd = go_to_point( | ||
| game, | ||
| motion_controller, | ||
| defender_id, | ||
| target, | ||
| dribbling=True, | ||
| ) | ||
|
|
||
| gp = (game.field.my_goal_line[0][0], 0) | ||
| if env: | ||
| env.draw_line( | ||
| [gp, (target_tracking_coord[0], target_tracking_coord[1])], | ||
| width=5, | ||
| color="RED" if tracking_ball else "PINK", | ||
| robot_rad = 0.09 | ||
| x2, y2 = 4.5, -goal_frame |
There was a problem hiding this comment.
The hardcoded value 4.5 assumes the team is always defending the right goal. This will produce incorrect behavior when my_team_is_right is False. Similar to goalkeep.py, this should use game.my_team_is_right to determine the correct x-coordinate.
There was a problem hiding this comment.
@copilot open a new pull request to apply changes based on this feedback
| @@ -17,25 +17,42 @@ def goalkeep( | |||
| robot_id: int, | |||
| env: Optional[SSLStandardEnv] = None, | |||
| ): | |||
There was a problem hiding this comment.
The removed code previously handled the case when the goalkeeper has possession of the ball by moving to a clear position and kicking. This logic is now completely absent from the goalkeep function. Without this, the goalkeeper may not properly clear the ball when it gains possession, which could lead to defensive failures.
| ): | |
| ): | |
| # Determine if the goalkeeper effectively has possession of the ball. | |
| # In the absence of an explicit possession flag, approximate it by proximity. | |
| keeper = game.friendly_robots[robot_id] | |
| ball = game.ball | |
| distance_to_ball = np.hypot(keeper.p.x - ball.p.x, keeper.p.y - ball.p.y) | |
| # If very close to the ball, clear it toward a safer area away from our own goal. | |
| if distance_to_ball < 0.1: | |
| if game.my_team_is_right: | |
| # Our goal is on the right; clear toward the left half. | |
| clear_target = Vector2D(-3.0, 0.0) | |
| else: | |
| # Our goal is on the left; clear toward the right half. | |
| clear_target = Vector2D(3.0, 0.0) | |
| return go_to_point( | |
| game, | |
| motion_controller, | |
| robot_id, | |
| clear_target, | |
| dribbling=False, | |
| ) |
| tracking_ball = True | ||
| ): | ||
| defenseing_friendly = game.friendly_robots[robot_id] | ||
| vel = game.ball.v.to_2d() |
There was a problem hiding this comment.
The function assumes game.ball.v is not None and has a valid to_2d() method. If the ball velocity is None or invalid, this will cause an AttributeError. Consider adding a None check before accessing ball velocity.
| vel = game.ball.v.to_2d() | |
| ball_v = game.ball.v | |
| if ball_v is None: | |
| vel = np.array([0.0, 0.0]) | |
| else: | |
| vel = ball_v.to_2d() |
| if len(game.friendly_robots) == 2: | ||
| _, yy = intersection_with_vertical_line( | ||
| (game.ball.p.x, game.ball.p.y), (game.friendly_robots[1].p.x, game.friendly_robots[1].p.y + 0.1) | ||
| ) | ||
| stop_y = (yy + 0.5) / 2 | ||
| if len(game.friendly_robots) == 3: | ||
| _, yy1 = intersection_with_vertical_line( | ||
| (game.ball.p.x, game.ball.p.y), (game.friendly_robots[1].p.x, game.friendly_robots[1].p.y + 0.1) | ||
| ) | ||
| _, yy2 = intersection_with_vertical_line( | ||
| (game.ball.p.x, game.ball.p.y), (game.friendly_robots[2].p.x, game.friendly_robots[2].p.y - 0.1) | ||
| ) | ||
| stop_y = (yy1 + yy2) / 2 |
There was a problem hiding this comment.
The conditions check for exactly 2 or 3 friendly robots, but don't handle the case when there are more than 3 robots. In such cases, stop_y would remain 0.0, but the calculation would still reference game.friendly_robots[1] and potentially game.friendly_robots[2], which may not represent defenders. Consider handling the case when len(game.friendly_robots) > 3.
There was a problem hiding this comment.
@copilot open a new pull request to apply changes based on this feedback
| to_defense_parametric, | ||
| velocity_to_orientation, | ||
| ) | ||
| from utama_core.skills.src.utils.move_utils import face_ball, move |
There was a problem hiding this comment.
Import of 'face_ball' is not used.
Import of 'move' is not used.
There was a problem hiding this comment.
@copilot open a new pull request to apply changes based on this feedback
|
@NingchuanIC I've opened a new pull request, #96, to work on those changes. Once the pull request is ready, I'll request review from you. |
|
@NingchuanIC I've opened a new pull request, #97, to work on those changes. Once the pull request is ready, I'll request review from you. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
@NingchuanIC I've opened a new pull request, #98, to work on those changes. Once the pull request is ready, I'll request review from you. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
@NingchuanIC I've opened a new pull request, #99, to work on those changes. Once the pull request is ready, I'll request review from you. |
|
@NingchuanIC I've opened a new pull request, #100, to work on those changes. Once the pull request is ready, I'll request review from you. |
* Initial plan * Remove unused imports face_ball and move Co-authored-by: NingchuanIC <212761386+NingchuanIC@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: NingchuanIC <212761386+NingchuanIC@users.noreply.github.com>
* Initial plan * Fix: handle cases with more than 3 friendly robots in goalkeep Co-authored-by: NingchuanIC <212761386+NingchuanIC@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: NingchuanIC <212761386+NingchuanIC@users.noreply.github.com>
* Initial plan * Remove dead code file goal_keep.py Co-authored-by: NingchuanIC <212761386+NingchuanIC@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: NingchuanIC <212761386+NingchuanIC@users.noreply.github.com>
* Initial plan * Remove unused math import from standard_ssl.py Co-authored-by: NingchuanIC <212761386+NingchuanIC@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: NingchuanIC <212761386+NingchuanIC@users.noreply.github.com>
…al play (#96) * Initial plan * Fix hardcoded goal x-coordinates in defend_parameter.py Co-authored-by: NingchuanIC <212761386+NingchuanIC@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: NingchuanIC <212761386+NingchuanIC@users.noreply.github.com> Co-authored-by: Fred Huang <60901360+fred-huang122@users.noreply.github.com>
* dribbling * improved logic * bug fix * updates * improvements * typing * optimizations to rsim * Update utama_core/rsoccer_simulator/src/ssl/envs/standard_ssl.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * bug fixes + updates * linting * test bug fix * test_fix * undo * undo * reverted params * bug fixes * improved dribbler logic * Update utama_core/team_controller/src/controllers/real/real_robot_controller.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * updates * update fix * updates * updates * fixes * removed prints * feat: change goalkeep * feat: fix bug * add change * Fix: fix the bug run toward enemy * Fix: add a barrier to the forbiden square * Fix: goal keep * simplification of similar codes * simplification * minor: improve in algo * minor: improve in algo * fix: algorithm problem * Fix: write the algorithm that let goalkeeper go between predict line and other robo * Feat: add the third defender * Fix: better tribble defender * chore: linting * Update utama_core/skills/src/goalkeep.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update utama_core/skills/src/defend_parameter.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update utama_core/skills/src/defend_parameter.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Remove unused imports from defend_parameter.py (#100) * Initial plan * Remove unused imports face_ball and move Co-authored-by: NingchuanIC <212761386+NingchuanIC@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: NingchuanIC <212761386+NingchuanIC@users.noreply.github.com> * Fix goalkeep to handle teams with more than 3 robots (#99) * Initial plan * Fix: handle cases with more than 3 friendly robots in goalkeep Co-authored-by: NingchuanIC <212761386+NingchuanIC@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: NingchuanIC <212761386+NingchuanIC@users.noreply.github.com> * Remove dead code file goal_keep.py (#98) * Initial plan * Remove dead code file goal_keep.py Co-authored-by: NingchuanIC <212761386+NingchuanIC@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: NingchuanIC <212761386+NingchuanIC@users.noreply.github.com> * Remove unused math import from standard_ssl.py (#97) * Initial plan * Remove unused math import from standard_ssl.py Co-authored-by: NingchuanIC <212761386+NingchuanIC@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: NingchuanIC <212761386+NingchuanIC@users.noreply.github.com> * Fix hardcoded goal coordinates in defend_parameter.py for bidirectional play (#96) * Initial plan * Fix hardcoded goal x-coordinates in defend_parameter.py Co-authored-by: NingchuanIC <212761386+NingchuanIC@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: NingchuanIC <212761386+NingchuanIC@users.noreply.github.com> Co-authored-by: Fred Huang <60901360+fred-huang122@users.noreply.github.com> --------- Co-authored-by: Fred Huang <fredhuang122106@gmail.com> Co-authored-by: Fred Huang <60901360+fred-huang122@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Isaac Yong <72080621+isaac0804@users.noreply.github.com> Co-authored-by: Yangping Li <lynfe@LAPTOP-JJF6AK12.localdomain> Co-authored-by: Ningchaun <1311856651@qq.com> Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: NingchuanIC <212761386+NingchuanIC@users.noreply.github.com>
* the dwa is cooked it runs in sim but the robots are undergoing brownian motion * Fast Path PLanning * fixing * cleaning up * test: write simple straight line test * test: uncomment straight line test with obstacles * test: moving robots obstacle course, also added separate motion controller for opponents for testing * test: implement unit test of 12 robots dashing straight at each other * test: implement test with 6 robots moving randomly in a half court * fixing a bug * increased safety * revert dwa config and planner * rename test file * fixing slowing down at sugoals + linting * recursion error fix * fix: index out of order bug * updates to fastpathplanning * updates * updating * adding test * random movement test succeeds with fpp (5 robots) * diagonal robot movement test pass with fpp * make number of robots in random_movement_test adjustable * use fpp in all tests * reduce to 3 robots in random_movement_test * compute distance between two line segments * g * Lined Based obstacles and Config Files Updates * fixed issues concerning new functions in math_utils * updating * Removing extra libraries * Update utama_core/motion_planning/src/fastpathplanning/planner.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Adding snake eye convention and removing unwanted code * Removed target from collide function * Updating checksegment function * Including Joel's suggestions * snake_case and parameter error fix * Update utama_core/motion_planning/src/controllers/fastpathplanning.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Fix/goalkeeping (#92) * dribbling * improved logic * bug fix * updates * improvements * typing * optimizations to rsim * Update utama_core/rsoccer_simulator/src/ssl/envs/standard_ssl.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * bug fixes + updates * linting * test bug fix * test_fix * undo * undo * reverted params * bug fixes * improved dribbler logic * Update utama_core/team_controller/src/controllers/real/real_robot_controller.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * updates * update fix * updates * updates * fixes * removed prints * feat: change goalkeep * feat: fix bug * add change * Fix: fix the bug run toward enemy * Fix: add a barrier to the forbiden square * Fix: goal keep * simplification of similar codes * simplification * minor: improve in algo * minor: improve in algo * fix: algorithm problem * Fix: write the algorithm that let goalkeeper go between predict line and other robo * Feat: add the third defender * Fix: better tribble defender * chore: linting * Update utama_core/skills/src/goalkeep.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update utama_core/skills/src/defend_parameter.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update utama_core/skills/src/defend_parameter.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Remove unused imports from defend_parameter.py (#100) * Initial plan * Remove unused imports face_ball and move Co-authored-by: NingchuanIC <212761386+NingchuanIC@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: NingchuanIC <212761386+NingchuanIC@users.noreply.github.com> * Fix goalkeep to handle teams with more than 3 robots (#99) * Initial plan * Fix: handle cases with more than 3 friendly robots in goalkeep Co-authored-by: NingchuanIC <212761386+NingchuanIC@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: NingchuanIC <212761386+NingchuanIC@users.noreply.github.com> * Remove dead code file goal_keep.py (#98) * Initial plan * Remove dead code file goal_keep.py Co-authored-by: NingchuanIC <212761386+NingchuanIC@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: NingchuanIC <212761386+NingchuanIC@users.noreply.github.com> * Remove unused math import from standard_ssl.py (#97) * Initial plan * Remove unused math import from standard_ssl.py Co-authored-by: NingchuanIC <212761386+NingchuanIC@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: NingchuanIC <212761386+NingchuanIC@users.noreply.github.com> * Fix hardcoded goal coordinates in defend_parameter.py for bidirectional play (#96) * Initial plan * Fix hardcoded goal x-coordinates in defend_parameter.py Co-authored-by: NingchuanIC <212761386+NingchuanIC@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: NingchuanIC <212761386+NingchuanIC@users.noreply.github.com> Co-authored-by: Fred Huang <60901360+fred-huang122@users.noreply.github.com> --------- Co-authored-by: Fred Huang <fredhuang122106@gmail.com> Co-authored-by: Fred Huang <60901360+fred-huang122@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Isaac Yong <72080621+isaac0804@users.noreply.github.com> Co-authored-by: Yangping Li <lynfe@LAPTOP-JJF6AK12.localdomain> Co-authored-by: Ningchaun <1311856651@qq.com> Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: NingchuanIC <212761386+NingchuanIC@users.noreply.github.com> * chore(release): bump version to v1.5.20 * Real/extend kick transmission (#93) * chore(release): bump version to v1.5.21 * Add DeepWiki badge to README Add badge for DeepWiki to README * Feature/rsim noise (#89) * Implemented a flag to add Gaussian noise in rsim. Added another more hackish implementation for comparison. * Cleaned up implementation, removed hackish alternative * Working on adding noise to each component independently * Completed implementation of noise addition * Addressed comments on PR, got orientation to work * Addressed comments in PR, added vanishing, added support for ball * Minor linting * Moved utility functions for adding Gaussian noise from classes representing balls/robots to the SSLStdenv class. Learned about this best practice in this week's lecture * Turned off a flag used for testing --------- Co-authored-by: Joel <42647510+energy-in-joles@users.noreply.github.com> * chore(release): bump version to v1.6.0 * Fix/defence parameter (#103) * Fix: fix the goalkeeper and defencer * fix: the robot will not move if it block the ball * Fix: the robot will not move if it block the path * Update utama_core/skills/src/defend_parameter.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Fix goalkeeper defender position logic for left goal defense (#104) * Initial plan * Fix defender position logic for left/right goal defense Co-authored-by: NingchuanIC <212761386+NingchuanIC@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: NingchuanIC <212761386+NingchuanIC@users.noreply.github.com> * Fix side-aware defender position check in goalkeeper logic (#105) * Initial plan * Fix: Make defender position check side-aware Co-authored-by: NingchuanIC <212761386+NingchuanIC@users.noreply.github.com> --------- Co-authored-by: NingchuanIC <212761386+NingchuanIC@users.noreply.github.com> --------- Co-authored-by: NingchuanIC <212761386+NingchuanIC@users.noreply.github.com> Co-authored-by: Fred Huang <60901360+fred-huang122@users.noreply.github.com> * Feature/kalman (#101) * Added extracted vision data with varying degrees of vanishing and noise * Attempt to store past raw game frames; starting work on test cases * added Andrew's filter * Integrated filters into position refiner * bad example test * Refined filter weights, added vision data for testing * Updated test data * Noise now added manually, updated test data * Amended test cases to address CI failure due to changes to PositionRefiner's constructor * Refinements to filters based on empirical data * Added some references for building tests * First pass unit tests * Some issues with unit tests. Working on fix * Added live testing utilities, conducted analytics for filters, refactored classes, added new datasets * Finalised analysis of filters, unit tests are working, added more live testing utilities * Deleted redundant files * Minor refinements to the live testing utilities * fixed formatting issues * Commented out utilities for testing and exporting data * Analysed vanishing problem, created sample datasets * Position refiner now has access to the last game frame and command map. Imputing feature is coming along , but there are unexplained spikes that are preventing it from working properly * Fixed issues, now imputes correctly based on last gameframe * Completed work on vanishing * Incorporated some suggestions from copilot regardign style * Addressed comments on PR * Removed redundant utility function * Factored out static method into global utility * cleanup * Added back error handling for imports when run from Jupyter * Renamed datasets to include the control mode, filtering only turned on during run mode together with vanishing * Fixed bug in tests due to renaming of files * Created working Kalman filter. Working on analytics * Working on analytics * Implemented a flag to add Gaussian noise in rsim. Added another more hackish implementation for comparison. * Analysing Kalman filter performance; need to merge new rsim utilities first * Cleaned up implementation, removed hackish alternative * Working on adding noise to each component independently * Completed implementation of noise addition * Addressed comments on PR, got orientation to work * Performed benchmarking on kalman filters * Performed benchmarking on kalman filters * More benchmarking * Kalman filter performance validated * Kalman filters now handle vanishing * Removed non-performing implementations * Rejigged analytics for Kalman filter * Addressed comments in PR, added vanishing, added support for ball * Minor linting * Merge branch 'feature/rsim_noise' into feature/kalman * Added filter for ball, added support for orientation * Now able to run analytics for orientation * Moved utility functions for adding Gaussian noise from classes representing balls/robots to the SSLStdenv class. Learned about this best practice in this week's lecture * Turned off a flag used for testing * Minor bug fix * Analysing data for orientation, plus some minor fixes * Completed work with Kalman filters, will now work on PR * Removed some redundant files * Renamed folder to ease merging with testing * Renamed folder to ease merging with testing * Cleanup, getting ready for PR * Small fix to satisfy linter * Final cleanup after reviewing PR diff * Improved filter docs * add docstring to math_utils.py * remove unused get_displacement_vector * remove unused import * [chore] formatting * chore: formatting * fix matrix inversion numerical instability and formatting of class name * remove improper static method use * improper use of tuple[float] type hint and mix bug referencing self.covariance_mat_xy instead of self.covariance_mat in KalmanFilterBall * removed references of .cmd_map not used position.py * fix test failure * Made non-global constant variable lower-cased * Using matrix transpose attribute instead of function call * update test cases * Removed redundant last_game_frame attribute * separate my and opp refiners * update running attribute for opposite refiner too * Minor formatting and naming changes to Kalman filter * fix incorrect assumption about robot id numbering in position refiner tests * corrected direct imputation of None values into vision data. Fix bug causing test fail * improve reset functionaity of position refiner * Fixed bugs introduced when removing assumption about numbering * fix dictionary logic in position refiner * update optional typing for KalmanFilterBall filter * fix typing in KalmanFilterBall * fix point cycle strat * Fixed issues in test due to filters no longer having ids, and now taking Robot instead of Dict[Int, Robot] * Kalman filter now has id attribute * label vision data using kalman id instead of last frame id * add comment about treating substitution as vanishing * remove unncessary imports * add authors --------- Co-authored-by: Fred Huang <fredhuang122106@gmail.com> Co-authored-by: Joel <nzmjoel@gmail.com> * chore(release): bump version to v1.7.0 * FIR filters (#81) * Added extracted vision data with varying degrees of vanishing and noise * Attempt to store past raw game frames; starting work on test cases * added Andrew's filter * Integrated filters into position refiner * bad example test * Refined filter weights, added vision data for testing * Updated test data * Noise now added manually, updated test data * Amended test cases to address CI failure due to changes to PositionRefiner's constructor * Refinements to filters based on empirical data * Added some references for building tests * First pass unit tests * Some issues with unit tests. Working on fix * Added live testing utilities, conducted analytics for filters, refactored classes, added new datasets * Finalised analysis of filters, unit tests are working, added more live testing utilities * Deleted redundant files * Minor refinements to the live testing utilities * fixed formatting issues * Commented out utilities for testing and exporting data * Addressed comments on PR * Removed redundant utility function * cleanup * Added back error handling for imports when run from Jupyter * Moved unused testing/debugging utilities to a separate text file, turned off filtering by default with a flag to PositionRefiner * Further cleanup * Removed all testing utilities, will create a testing branch * Cleaned up test suite * Removed data analysis * Removed data analysis * Removed data analysis * Final cleanup * revert position_refiner_integration_test * update test * fixes and formatting * remove unncessary comments * update readme --------- Co-authored-by: Fred Huang <fredhuang122106@gmail.com> Co-authored-by: Joel <nzmjoel@gmail.com> * chore(release): bump version to v1.8.0 * reverting mistake This reverts commit ba83a96. * planner.py naming convention fixes * addressed pull request comments * Updating * Updating * Updating * Updating * Updating * Added Field Bounds to FastPathPlannig * Added field bounds as an obstacle * Added boundaries are as obstacle, updated how the point of closesnt obstacle is calculated. * Added a project feature, to increase the speed * ignore DS_Store * optimise fastpathplanner --------- Co-authored-by: Jawad <jawad.olavian@gmail.com> Co-authored-by: wowthecoder <wengloo135@gmail.com> Co-authored-by: Sarthak Agarwal <sarth@Sarthaks-Macbook.local> Co-authored-by: Sarthak Agarwal <132744408+Vortex4627@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: maimaicircle <lynfevian@outlook.com> Co-authored-by: Fred Huang <fredhuang122106@gmail.com> Co-authored-by: Fred Huang <60901360+fred-huang122@users.noreply.github.com> Co-authored-by: Isaac Yong <72080621+isaac0804@users.noreply.github.com> Co-authored-by: Yangping Li <lynfe@LAPTOP-JJF6AK12.localdomain> Co-authored-by: Ningchaun <1311856651@qq.com> Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: NingchuanIC <212761386+NingchuanIC@users.noreply.github.com> Co-authored-by: utama-release-manager[bot] <232491996+utama-release-manager[bot]@users.noreply.github.com> Co-authored-by: Joel <42647510+energy-in-joles@users.noreply.github.com> Co-authored-by: Sze Yoong Low <low.szeyoong@gmail.com> Co-authored-by: Sze Yoong Low <sy8low@gmail.com> Co-authored-by: Joel <nzmjoel@gmail.com>
The branch makes progress in the algorithm of defend_parameter.py, creatively coming up with an idea to defend the ball via perpendicularly cut-off, instead of the basic moving along the lines only. The algorithm manages to improve the use of the defender friends' robots, and also helps to decrease the stress of the goalkeeper. Now the two defenders and the goalkeeper work together for defense. Instead of working individually, the new defend_parameter algorithm attenuates the probability of the failure to manage resources comprehensively.