package org.usfirst.frc.team3501.robot.subsystems;
import org.usfirst.frc.team3501.robot.RobotMap;
+import org.usfirst.frc.team3501.robot.commands.DriveWithJoysticks;
import edu.wpi.first.wpilibj.CANJaguar;
import edu.wpi.first.wpilibj.RobotDrive;
public class Drivetrain extends Subsystem {
- RobotDrive robotDrive;
+ private RobotDrive robotDrive;
public Drivetrain() {
CANJaguar frontLeft = new CANJaguar(RobotMap.FRONT_LEFT_ADDRESS);
public void drive(double forward, double twist) {
if (Math.abs(forward) < RobotMap.MIN_DRIVE_JOYSTICK_INPUT)
forward = 0;
- if (Math.abs(twist) < RobotMap.MIN_DRIVE_JOYSTICK_INPUT)
+ if (Math.abs(twist) < RobotMap.MIN_DRIVE_JOYSTICK_INPUT)
twist = 0;
robotDrive.arcadeDrive(
false);
}
+ public void driveRaw(double forward, double twist) {
+ robotDrive.arcadeDrive(forward, twist, false);
+ }
+
public void goForward(double speed) {
robotDrive.arcadeDrive(speed, 0);
}
return (x + Math.signum(x) * Math.sqrt(Math.abs(x))) / 2;
}
- public void initDefaultCommand() {}
+ public void initDefaultCommand() {
+ setDefaultCommand(new DriveWithJoysticks());
+ }
}
-