From e506f0659835e59b25404ee4d4b2456df9d61e48 Mon Sep 17 00:00:00 2001 From: Ronan061 Date: Tue, 4 Jun 2024 19:55:17 -0400 Subject: [PATCH] Handler clean up --- commands/drivetrain_handler.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/commands/drivetrain_handler.py b/commands/drivetrain_handler.py index 8aa81a2..7b64dbd 100644 --- a/commands/drivetrain_handler.py +++ b/commands/drivetrain_handler.py @@ -2,14 +2,17 @@ from commands2 import Command from subsystems.drivetrain import Drivetrain from commands.haltdrive import HaltDrive +from controllers.commander import CommanderController +from wpilib import Joystick class DrivetrainPriority(Command): - def __init__(self): + def __init__(self, controller: CommanderController): super().__init__("Drivetrain Priority") - self.addRequirements(Drivetrain) + self.addRequirements(Drivetrain) + self.controller = controller def execute(self): - if driver_controller.getBumper(wpilib.GenericHID.Hand.kLeft): + if self.controller.getRawButton(4): rotational_speed = note_lockon.get_rotational_speed() # Replace with your actual code to get rotational speed from note_lockon file Drivetrain.drive(0, 0, rotational_speed) else: