Skip to content

Split turret feedforward into separate chassis and hub gains#530

Open
phurley67 wants to merge 1 commit into
mainfrom
refactor/turret-feedforward-split
Open

Split turret feedforward into separate chassis and hub gains#530
phurley67 wants to merge 1 commit into
mainfrom
refactor/turret-feedforward-split

Conversation

@phurley67

@phurley67 phurley67 commented Apr 6, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Split kV_FEEDFORWARD into two independent constants: kV_CHASSIS_FEEDFORWARD (compensates for robot body rotation) and kV_HUB_FEEDFORWARD (compensates for apparent target motion during translation)
  • Both constants remain at 21 — no behavior change — but they can now be tuned independently
  • Cleaned up misleading parameter names (chassisOmegaRadPerSec -> chassisOmega) since the WPILib AngularVelocity type handles units internally

Test plan

  • Build compiles with no errors
  • Deploy to robot and verify turret tracking behavior is identical to before (both gains still 21)
  • Tune chassis FF: disable hub FF, spin in place aiming at target, adjust until turret holds steady
  • Tune hub FF: re-enable, drive sideways past target, adjust until smooth tracking

🤖 Generated with Claude Code

Closes #529

Previously both chassis rotation and hub angular velocity compensation
used the same kV_FEEDFORWARD gain. Split into kV_CHASSIS_FEEDFORWARD
and kV_HUB_FEEDFORWARD so they can be tuned independently.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings April 6, 2026 01:43

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the turret subsystem feedforward constants to separate compensation for chassis rotation vs. apparent target motion during translation, enabling independent tuning without changing current behavior.

Changes:

  • Replaced the single kV_FEEDFORWARD with kV_CHASSIS_FEEDFORWARD and kV_HUB_FEEDFORWARD (both default to 21).
  • Updated Turret#setAngle(...) to apply the two feedforward terms separately.
  • Cleaned up setAngle(...) parameter naming to avoid redundant unit suffixes when using WPILib AngularVelocity.

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.

Split turret feedforward into separate chassis and hub gains

2 participants