Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up LiveWindow #130

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions components/hang.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ def __init__(self) -> None:
def setup(self) -> None:
self.winch_motor.setInverted(True)

sendable_reg = wpilib.SendableRegistry.getInstance()
for dev in (self.winch_motor, self.kracken_hook_latch):
sendable_reg.setSubsystem(dev, "Hang")

def on_disable(self) -> None:
# stop motors
self.winch_motor.stopMotor()
Expand Down
9 changes: 9 additions & 0 deletions components/indexer.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,15 @@ def setup(self):
ctre.LimitSwitchNormal.NormallyOpen,
)

sendable_reg = wpilib.SendableRegistry.getInstance()
for dev in (self.intake_arm_piston, self.intake_main_motor):
sendable_reg.setSubsystem(dev, "Intake")

sendable_reg.setSubsystem(self.injector_motor, "Shooter")

for motor in self.indexer_motors:
sendable_reg.setSubsystem(motor, "Indexer")

self.intake_left_motor.setInverted(False)
self.intake_right_motor.setInverted(True)

Expand Down
5 changes: 5 additions & 0 deletions components/shooter.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,15 @@ def __init__(self):
self.disabled = False

def setup(self) -> None:
sendable_reg = wpilib.SendableRegistry.getInstance()
for dev in (self.loading_piston, self.piston_switch):
sendable_reg.setSubsystem(dev, "Shooter")

self.outer_motor.setInverted(True)
self.centre_motor.setInverted(False)

for motor in self.outer_motor, self.centre_motor:
sendable_reg.setSubsystem(dev, "Shooter")
motor.configVelocityMeasurementPeriod(ctre.VelocityMeasPeriod.Period_1Ms)
motor.configVelocityMeasurementWindow(16)
motor.setNeutralMode(ctre.NeutralMode.Coast)
Expand Down
4 changes: 4 additions & 0 deletions components/turret.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@ class Turret:
index_found = magicbot.tunable(False)

def setup(self) -> None:
sendable_reg = wpilib.SendableRegistry.getInstance()
for dev in (self.centre_index, self.right_index, self.left_index, self.motor):
sendable_reg.setSubsystem(dev, "Turret")

self._setup_motor()
self._setup_position()
self.current_state = self.SLEWING
Expand Down