mirror of
https://github.com/System-End/TumblerEvent.git
synced 2026-04-19 16:28:19 +00:00
k
This commit is contained in:
parent
33fca7107a
commit
d28bf00c57
2 changed files with 9 additions and 3 deletions
|
|
@ -15,5 +15,8 @@ package frc.robot;
|
||||||
public final class Constants {
|
public final class Constants {
|
||||||
public static class OperatorConstants {
|
public static class OperatorConstants {
|
||||||
public static final int kDriverControllerPort = 0;
|
public static final int kDriverControllerPort = 0;
|
||||||
|
public static final double kCompetitionSpeed = 1;
|
||||||
|
public static final double kShowDriveSpeed = 0.65;
|
||||||
|
public static final double kShowTurnSpeed = 0.7;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,13 +7,16 @@ package frc.robot.subsystems;
|
||||||
import edu.wpi.first.wpilibj.XboxController;
|
import edu.wpi.first.wpilibj.XboxController;
|
||||||
import edu.wpi.first.wpilibj.drive.DifferentialDrive;
|
import edu.wpi.first.wpilibj.drive.DifferentialDrive;
|
||||||
import edu.wpi.first.wpilibj2.command.SubsystemBase;
|
import edu.wpi.first.wpilibj2.command.SubsystemBase;
|
||||||
|
import frc.robot.RobotContainer;
|
||||||
|
import frc.robot.Constants.OperatorConstants;
|
||||||
|
|
||||||
import com.ctre.phoenix.motorcontrol.can.WPI_TalonSRX;
|
import com.ctre.phoenix.motorcontrol.can.WPI_TalonSRX;
|
||||||
public class Drivetrain extends SubsystemBase {
|
public class Drivetrain extends SubsystemBase {
|
||||||
/** Creates a new Drivetrain. */
|
/** Creates a new Drivetrain. */
|
||||||
|
|
||||||
WPI_TalonSRX frontLeft = new WPI_TalonSRX(2);
|
WPI_TalonSRX frontLeft = new WPI_TalonSRX(0);
|
||||||
WPI_TalonSRX frontRight = new WPI_TalonSRX(1);
|
WPI_TalonSRX frontRight = new WPI_TalonSRX(1);
|
||||||
WPI_TalonSRX backLeft = new WPI_TalonSRX(1);
|
WPI_TalonSRX backLeft = new WPI_TalonSRX(2);
|
||||||
WPI_TalonSRX backRight = new WPI_TalonSRX(3);
|
WPI_TalonSRX backRight = new WPI_TalonSRX(3);
|
||||||
|
|
||||||
XboxController controller = new XboxController(0);
|
XboxController controller = new XboxController(0);
|
||||||
|
|
@ -27,7 +30,7 @@ public class Drivetrain extends SubsystemBase {
|
||||||
@Override
|
@Override
|
||||||
public void periodic() {
|
public void periodic() {
|
||||||
// This method will be called once per scheduler run
|
// This method will be called once per scheduler run
|
||||||
drive.arcadeDrive(controller.getLeftY(), controller.getRightX());
|
drive.arcadeDrive(controller.getLeftY() * OperatorConstants.kShowDriveSpeed * (1 + controller.getRightTriggerAxis()), -controller.getRightX() * OperatorConstants.kShowTurnSpeed * (1 + controller.getRightTriggerAxis()));
|
||||||
backLeft.follow(frontLeft);
|
backLeft.follow(frontLeft);
|
||||||
backRight.follow(frontRight);
|
backRight.follow(frontRight);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue