Repository navigation
fix: motion planning detours & hysteresis, custom referee rules, and benchmark metrics - #147
Merged
Merged
Conversation
…e detours - FastPathPlanner (C++ and Python): key obstacle detour memory on obstacle ID rather than shifting contact points, eliminating dithering oscillations. - TrajectorySamplingPlanner: add temporal speed-modulation candidates (0.75x, 0.55x) and Sumatra-style angular deviation penalty, cutting crossing detour from 1.55x (5.10s) to 1.09x (3.43s) with zero brake events. - TrajectorySamplingPlanner: constrain candidate targets to forward/lateral hemisphere (<= 90 deg), eliminating the 180-deg backward candidate that caused robots to reverse away from dynamic pinches (pinching_contest 4.68s -> 2.57s). - Update visual comparisons and motion planning documentation.
- Add excess_distance_m (path length minus direct Euclidean distance) and near_miss_ratio (% of moving ticks where clearance < 0.15m) to BenchmarkManager. - Record both metrics in results JSON, aggregate summaries, and Markdown report. - Include excess distance (+X.XXm) in terminal progress printout.
… and crashing rule - actions.py: clamp restart positions outside 0.80m keep-out arc (fixing 0.79m floating-point precision boundary penalty). - actions.py: place defending penalty goalkeeper +ROBOT_RADIUS offset on defense line and attacking keeper on own goal line. - crashing_rule.py: do not penalize separating robots when relative crash speed <= threshold. - double_touch_rule.py: correctly attribute double-touch fouls to the last kicker. - Add regression tests in test_custom_referee, test_pushing_crashing, and test_referee_unit.
…and tactics - pickers.py: add margin-based hysteresis to friendly_closer_to_ball to prevent rapid 60Hz role-swapping when robots are equidistant to the ball. - ClearBallTactic: expand activation thresholds (friendly distance 2.6m -> 3.0m, enemy distance 1.2m -> 1.5m) to prevent boundary flickering. - PressAndContainTactic: widen enemy distance threshold (1.4m -> 1.7m) and use Sticky[int] hysteresis for presser robot selection. - DecoyOverloadTactic: add stall/deadlock timeout when no friendly targets are reachable. - Engine/tactics: store all hysteresis state on tactic instances with reset_applicable() and module-level reset hooks for clean test isolation. - Add comprehensive regression tests in test_strategy, test_friendly_closer_to_ball, test_clear_ball_tactic, test_press_and_contain_tactic, and test_decoy_and_overload_tactic.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Comprehensive audit and stabilization across motion planning, referee overrides, and tactic partitioning:
1. Motion Planning
crossing, completion time dropped from 5.10s -> 3.43s (-1.67s), path ratio dropped from 1.55x -> 1.09x, and brake events dropped from 3.0 -> 0.0.pinching_contesttime dropped from 4.68s -> 2.57s and path ratio from 1.26x -> 1.06x).excess_distance_mandnear_miss_ratio(% of moving ticks where clearance < 0.15m) across results JSON, markdown tables, and terminal reporting.2. Custom Referee Rules & Actions
3. Strategy & Tactics Hysteresis
friendly_closer_to_ballto prevent rapid 60Hz role-swapping between equidistant robots.ClearBallTactic(2.6m -> 3.0m) andPressAndContainTactic(1.4m -> 1.7m) to prevent boundary flickering; addedSticky[int]hysteresis to presser selection.DecoyOverloadTactic.reset_applicable()and test teardown hooks.Test Verification
pixi run lint: 100% clean (black, ruff, isort).pixi run test: 12,885 passed, 83 xfailed, 0 failed.trajsample.