Skip to content

OTF: account for robot rotation and use future-pose hub velocity#538

Open
phurley67 wants to merge 1 commit into
fix/otf-spline-convergencefrom
fix/otf-rotation-future-pose
Open

OTF: account for robot rotation and use future-pose hub velocity#538
phurley67 wants to merge 1 commit into
fix/otf-spline-convergencefrom
fix/otf-rotation-future-pose

Conversation

@phurley67

Copy link
Copy Markdown
Contributor

Summary

  • Use midpoint heading (trapezoidal approximation) for displacement prediction so the OTF loop correctly handles robot rotation during ball flight
  • Compute shooter offset at the future heading since the shooter physically rotates with the robot
  • Calculate hub angular velocity from the future pose/distance instead of the current pose, so the turret feedforward matches where we're actually aiming
  • Update Swerve.getFuturePoseFromTime with the same midpoint-heading approach and correct twist omega

Note: This PR depends on #536 (fix/otf-spline-convergence).

Closes #537

Test plan

  • Deploy and verify OTF shots land accurately when the robot is driving in a straight line (no rotation) -- behavior should be unchanged
  • Test OTF shots while the robot is spinning (e.g., driver turning while moving). Shots should be noticeably more accurate than before
  • Check that the "Future Pose" on Shuffleboard looks reasonable -- it should show the predicted position AND heading
  • Verify convergence loop still converges within 15 iterations by logging iteration count
  • Test at various distances (close, mid, far) while spinning to confirm the turret feedforward tracks smoothly

🤖 Generated with Claude Code

Use midpoint heading for displacement prediction during rotation.
Compute shooter offset at future heading. Calculate hub angular
velocity from future pose for accurate turret feedforward.
Update Swerve.getFuturePoseFromTime with same midpoint approach.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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