Skip to content

Fix goToAngle/goToRelative: bypass broken ReelTwo path#64

Merged
thePunderWoman merged 1 commit intomainfrom
fix/dome-goto-angle-bypass-reeltwo
Apr 21, 2026
Merged

Fix goToAngle/goToRelative: bypass broken ReelTwo path#64
thePunderWoman merged 1 commit intomainfrom
fix/dome-goto-angle-bypass-reeltwo

Conversation

@thePunderWoman
Copy link
Copy Markdown
Owner

Summary

  • goToAngle() and goToRelative() were routing through DomeDrive::domeStick() via DomePosition::kTarget mode, which has three bugs for an encoder-based drive
  • Adds a new kStateGoToAngle state that calls driveClosedLoop() directly — the same closed-loop path already used by absolute-stick and random-wander modes

Root cause — three compounding bugs

  1. Gated on joystick connectivity. domeStick() only executes when a controller is connected, so programmatic moves silently did nothing without one.
  2. Built-in 6-second delay. kTarget mode waits for getDomeTargetMinDelay() (default 6 s) before moving — we never configured this parameter.
  3. Inverted sign convention. moveDomeToTarget() treats clockwise distance as negative speed, opposite to our encoder's convention, so the dome drove away from its target.

Test plan

  • Build passes (pio run)
  • All 409 native unit tests pass (pio test -e native)
  • Dome goes to front (0°) after homing completes without needing a controller connected
  • dome=<angle> serial command drives to the correct position
  • goToRelative (used by sequence moves) arrives at the right heading

🤖 Generated with Claude Code

The old implementation delegated to DomeDrive::domeStick() via
DomePosition::kTarget mode. This had three bugs:
1. domeStick() only runs when a joystick is connected, so programmatic
   moves silently did nothing without a controller plugged in.
2. kTarget mode has a built-in 6-second idle delay (getDomeTargetMinDelay
   defaults to 6 s) before commanding the motor — we never configured it.
3. DomeDrive::moveDomeToTarget() uses the opposite sign convention from
   our encoder, driving the dome away from its target.

Replace with a new kStateGoToAngle state that calls driveClosedLoop()
directly — the same path already used by handleAbsoluteStick() and
handleRandomMode(), which work correctly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@thePunderWoman thePunderWoman merged commit 419243d into main Apr 21, 2026
1 check passed
@thePunderWoman thePunderWoman deleted the fix/dome-goto-angle-bypass-reeltwo branch April 21, 2026 00:52
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