Skip to content

Commit

Permalink
Handler clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
Ronan061 committed Jun 4, 2024
1 parent 4a47fbf commit e506f06
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions commands/drivetrain_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit e506f06

Please sign in to comment.