From ec1caf593914ace76579b231f3076f940d9ef76b Mon Sep 17 00:00:00 2001 From: RyanW Date: Sat, 12 Oct 2024 14:53:23 -0400 Subject: [PATCH] some stuff with kavin --- src/main/java/frc/robot/RobotContainer.java | 7 +++++++ src/main/java/frc/robot/commands/DriveCommands.java | 10 ++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index 312310c..9fb2cf4 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -81,6 +81,7 @@ public Command getAutonomousCommand() { RobotContainer.m_xrpDrivetrain, RobotContainer.m_rangefinder ); */ + return new SequentialCommandGroup( DriveCommands.tankDriveBackwards(2), ServoCommands.servoPresetCommand(1), @@ -91,5 +92,11 @@ public Command getAutonomousCommand() { ServoCommands.servoSetAngleCommand(0) ) ); + //return DriveCommands.tankDriveDistance(5); + /*return new SequentialCommandGroup( + DriveCommands.tankDriveDistance(5), + DriveCommands.tankTurnDegrees(0.5, 50) + ); + */ } } diff --git a/src/main/java/frc/robot/commands/DriveCommands.java b/src/main/java/frc/robot/commands/DriveCommands.java index 5978b56..7c1134d 100644 --- a/src/main/java/frc/robot/commands/DriveCommands.java +++ b/src/main/java/frc/robot/commands/DriveCommands.java @@ -262,13 +262,15 @@ public static Command tankDriveCommand(Supplier left_speed, Supplier { m_drive.tankDrive(0, 0); @@ -277,11 +279,11 @@ public static Command tankTurnDegrees(double speed, double degrees){ () -> { if (m_degrees>180) { //turn right - m_drive.tankDrive(m_speed, 0); + m_drive.tankDrive(m_speed, -m_speed); } if (m_degrees<=180) { //turn left - m_drive.tankDrive(0,m_speed); + m_drive.tankDrive(-m_speed,m_speed); } }, interrupted -> m_drive.tankDrive(0, 0),