From e8ba8ba135e667235cccd988602ca1c907f38a2a Mon Sep 17 00:00:00 2001 From: Saanvi Korem Date: Wed, 23 Oct 2024 22:03:06 -0400 Subject: [PATCH] Task 2 Completion --- .../frc/robot/subsystems/XRPDrivetrain.java | 23 ++----------------- 1 file changed, 2 insertions(+), 21 deletions(-) diff --git a/src/main/java/frc/robot/subsystems/XRPDrivetrain.java b/src/main/java/frc/robot/subsystems/XRPDrivetrain.java index 0bda8d9..98e9594 100644 --- a/src/main/java/frc/robot/subsystems/XRPDrivetrain.java +++ b/src/main/java/frc/robot/subsystems/XRPDrivetrain.java @@ -46,27 +46,8 @@ public void arcadeDrive(double xaxisSpeed, double zaxisRotate) { } //TODO:Task 2-Write a function that makes the robot take in a left wheel speed and a right wheel speed, and move at those speeds. - public static Command tankDriveCom(double leftSpeed, double rightSpeed){ - return new FunctionalCommand( - () -> { - //start - RobotContainer.m_xrpDrivetrain.tankDrive(0,0); - RobotContainer.m_xrpDrivetrain.resetEncoders(); - }, - //action - () -> { - RobotContainer.m_xrpDrivetrain.tankDrive(leftSpeed, rightSpeed); - }, - //stop - interrupted -> - RobotContainer.m_xrpDrivetrain.tankDrive(0, 0); - - //boolean - () -> { - return false; - } - RobotContainer.m_xrpDrivetrain - ); + public static Command SpeedCommand(double leftSpeed, double rightSpeed){ + m_diffDrive.tankDrive(leftSpeed, rightSpeed); } //HINT:This is called a tank drive, maybe there is a function that can easily allow for it? //HINT:To see all the functions that the drivetrain has, type "m_diffDrive." without the quotes and look at the options generated by auto complete.