Skip to content

Remove DomeDrive inheritance — roboclaw dome drive is now self-contained#66

Merged
thePunderWoman merged 1 commit intomainfrom
refactor/dome-drive-roboclaw-self-contained
Apr 21, 2026
Merged

Remove DomeDrive inheritance — roboclaw dome drive is now self-contained#66
thePunderWoman merged 1 commit intomainfrom
refactor/dome-drive-roboclaw-self-contained

Conversation

@thePunderWoman
Copy link
Copy Markdown
Owner

Summary

  • DomeDriveRoboClaw no longer inherits from DomeDrive. It inherits only SetupEvent and AnimatedEvent (the two ReelTwo event-loop hooks) and owns all its state directly.
  • All dome movement logic — joystick drive, homing, calibration, go-to-angle, random wander, absolute-stick — lives entirely in this class with no ReelTwo drive-class dependency.

What changed

New driveFromJoystick() replaces DomeDrive::animate()
Implements the same joystick path that was buried inside DomeDrive::domeStick():

  • Raw stick → [-1, 1] mapping
  • 0.2 deadband + pow(..., 1.4) power curve
  • L2/R2 trigger speed boost above configured maximum
  • Invert flag for reversed motor wiring

Owned state (moved out of DomeDrive base)
fDomeStick, fMaxSpeed, fUseLeftStick, fInverted, fEnabled, fMoving

Compatibility stubs
setScaling(), setThrottleAccelerationScale(), setThrottleDecelerationScale() kept as no-ops — they were already having no effect (setScaling(false) was being called at init).

config.cpp
Changed DomeDrive* domeDrive to auto* domeDrive so each build deduces its own concrete drive type without needing a common base pointer.

Test plan

  • Build passes (pio run)
  • All 409 native unit tests pass (pio test -e native)
  • Joystick drives the dome normally in both directions
  • L2/R2 trigger boosts speed above configured max
  • domeflip=1 config inverts direction correctly
  • All automated modes (homing, calibration, go-to-angle, random, abs-stick) still work

🤖 Generated with Claude Code

DomeDriveRoboClaw now inherits only AnimatedEvent + SetupEvent (the ReelTwo
event-loop hooks) and has zero dependency on DomeDrive or any ReelTwo drive
class.  All dome movement logic — joystick drive, homing, calibration,
go-to-angle, random wander, absolute-stick — lives entirely in this class.

Changes:
- Inherit SetupEvent + AnimatedEvent instead of DomeDrive
- Replace DomeDrive::animate() call with new driveFromJoystick(), which
  implements the same joystick path (deadband, power curve, L2/R2 trigger
  boost, invert flag) without any DomeDrive machinery
- Move fDomeStick, fMaxSpeed, fUseLeftStick, fInverted, fEnabled, fMoving
  into DomeDriveRoboClaw as owned members
- Add setEnable/setInverted/setMaxSpeed/setUseLeftStick/isMoving directly;
  keep setScaling/setThrottleAccelerationScale/DecelerationScale as no-ops
  for call-site compatibility (acceleration smoothing is not implemented —
  dome motor inertia is sufficient in practice)
- Remove motor() virtual override; driveFromJoystick() calls sendMotorCommand()
  directly
- Remove DomeDrive::stop() call; stop() now just zeroes fMoving
- Define DOME_RANDOM_MOVE_MIN_DEGREES in dome_drive_roboclaw.h (was in DomeDrive.h)
- config.cpp: use auto* for domeDrive local to avoid DomeDrive base dependency

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@thePunderWoman thePunderWoman merged commit 6008b1d into main Apr 21, 2026
1 check passed
@thePunderWoman thePunderWoman deleted the refactor/dome-drive-roboclaw-self-contained branch April 21, 2026 02:28
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