Skip to content

Add joint limits and motors to physics system#150

Merged
stainlu merged 1 commit intomainfrom
worktree-agent-ae9d1bf9
Apr 8, 2026
Merged

Add joint limits and motors to physics system#150
stainlu merged 1 commit intomainfrom
worktree-agent-ae9d1bf9

Conversation

@stainlu
Copy link
Copy Markdown
Owner

@stainlu stainlu commented Apr 8, 2026

Summary

  • Extend revolute joints with angle limits (min/max radians) and optional JointMotor for driving rotation toward a target angular velocity
  • Extend distance joints with min/max length limits defining a free range (no correction within bounds)
  • Add solve_velocity() for motor impulse application, has_motor() for efficient filtering
  • Thread dt and rotation data through the solver call chain in systems.rs
  • 16 unit tests covering distance limits, angle limits, motor convergence, torque clamping, and builder panic guards

Test plan

  • All 16 new joint tests pass (cargo test -p euca-physics --lib joints::tests)
  • All existing tests pass unchanged (cargo test --workspace -- 0 failures)
  • cargo clippy --workspace -- -D warnings clean
  • cargo fmt --all -- --check clean

🤖 Generated with Claude Code

Extend revolute joints with angle limits and optional motors, and
distance joints with min/max length limits. This enables constrained
hinges (e.g. door stops, elbow joints) and motor-driven rotation
(e.g. wheels, powered mechanisms).

- JointMotor struct drives revolute joints toward a target angular velocity
- Distance limits define a free range; no correction within [min, max]
- Angle limits clamp revolute rotation via position-level correction
- solve() now receives rotations for angle-limit computation
- solve_velocity() applies clamped motor impulses per timestep
- Builder methods: with_angle_limits, with_motor, with_distance_limits
- 16 unit tests covering limits, motors, convergence, and builder panics

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying euca-engine with  Cloudflare Pages  Cloudflare Pages

Latest commit: 4d5e87f
Status: ✅  Deploy successful!
Preview URL: https://bee57643.euca-engine.pages.dev
Branch Preview URL: https://worktree-agent-ae9d1bf9.euca-engine.pages.dev

View logs

@stainlu stainlu merged commit 85ca50f into main Apr 8, 2026
6 of 8 checks passed
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