Skip to content

Feature/visualization#5

Merged
cgpadwick merged 8 commits into
mainfrom
feature/visualization
Feb 6, 2026
Merged

Feature/visualization#5
cgpadwick merged 8 commits into
mainfrom
feature/visualization

Conversation

@cgpadwick

@cgpadwick cgpadwick commented Feb 6, 2026

Copy link
Copy Markdown
Contributor

add a simple web visualization feature. Fix some physics bugs. Get rid of curriculum learning as it is hurting performance.

cgpadwick and others added 8 commits February 4, 2026 01:02
- Add browser-based Three.js visualization (visualize.py + template)
  that loads trained models and renders animated ball trajectories
- Fix path generator falling back to stationary at high speeds by
  scaling min_duration based on zone geometry and sampled speed
- Remove all curriculum learning code (caused catastrophic forgetting
  and paths were too short for meaningful high-speed training)
- Clean up train.py: remove --no-curriculum flag, unused SAC import

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Physics: replace height-window hit detection with plane-crossing approach
that checks where the ball descends through z=HUB_OPENING_HEIGHT and
whether the (x,y) landing is within the hub circle. Reward: add velocity
penalty (-0.3 at max velocity) to discourage mortar-style high-arc shots.
Also includes path generator refactor, config cleanup, and expanded tests.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Penalize peak trajectory height above 4m (-0.2 per excess meter) instead
of velocity. This discourages mortar-style high-arc shots at long range
while still allowing close-range lobs where the peak stays under 4m.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Replace hard 4m threshold with smooth gradient from hub_height + 2 ball
diameters (2.13m). Penalty is -0.1 per meter of excess, so flatter shots
are always preferred but close-range lobs incur minimal cost.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Physics: detect when ball passes through hub cylinder on the way UP
(ascending collision) and mark as a miss. Previously only checked
descending crossings, allowing shots that went up through the hub.

Visualization: fix play/pause button width, default to --no-browser.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Detect when ball passes through the hub cylinder while ascending (going
up through where the hub structure would be). Only ascending trajectories
trigger collision; descending balls entering through the top opening are
valid hits. Updated test to use trajectory that misses laterally without
hub collision.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Replace heuristic-based ascending crossing checks with a cleaner physical
model: the hub is a cylinder with a top scoring surface and solid walls.

- Ball entering cylinder radius at z < HUB_OPENING_HEIGHT = wall collision (miss)
- Ball entering from above (z >= hub height) and descending through = valid hit
- Track first entry into cylinder radius to determine entry point

Add wall collision tests for close-range shots that would "cheat" by going
up through the hub opening.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Increase hub opacity from 0.3 to 0.5 for better visibility
- Add visualization section to README with usage examples
- Update CLAUDE.md physics description for wall collision model
- Add visualize.py and template to project structure

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@cgpadwick cgpadwick merged commit 553d708 into main Feb 6, 2026
3 checks passed
@cgpadwick cgpadwick deleted the feature/visualization branch February 6, 2026 13:32
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.

1 participant