Remove DomeDrive inheritance — roboclaw dome drive is now self-contained#66
Merged
thePunderWoman merged 1 commit intomainfrom Apr 21, 2026
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
DomeDriveRoboClawno longer inherits fromDomeDrive. It inherits onlySetupEventandAnimatedEvent(the two ReelTwo event-loop hooks) and owns all its state directly.What changed
New
driveFromJoystick()replacesDomeDrive::animate()Implements the same joystick path that was buried inside
DomeDrive::domeStick():pow(..., 1.4)power curveOwned state (moved out of DomeDrive base)
fDomeStick,fMaxSpeed,fUseLeftStick,fInverted,fEnabled,fMovingCompatibility stubs
setScaling(),setThrottleAccelerationScale(),setThrottleDecelerationScale()kept as no-ops — they were already having no effect (setScaling(false)was being called at init).config.cppChanged
DomeDrive* domeDrivetoauto* domeDriveso each build deduces its own concrete drive type without needing a common base pointer.Test plan
pio run)pio test -e native)domeflip=1config inverts direction correctly🤖 Generated with Claude Code