/
Drive.java
38 lines (35 loc) · 1.05 KB
/
Drive.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.team484.frisbeebot.subsystems;
import edu.wpi.first.wpilibj.RobotDrive;
import edu.wpi.first.wpilibj.command.Subsystem;
import org.team484.frisbeebot.commands.DriveWithJoysticks;
/**
*
* @author Team484
*/
public class Drive extends Subsystem {
// Put methods for controlling this subsystem
// here. Call these from Commands.
RobotDrive robotDrive = new RobotDrive(1, 3, 2, 4);
double stick = 0;
public void initDefaultCommand() {
// Set the default command for a subsystem here.
//setDefaultCommand(new MySpecialCommand());
setDefaultCommand(new DriveWithJoysticks());
}
public void driveForward() {
robotDrive.drive(0.5, 0);
}
public void driveDoNothing() {
robotDrive.drive(0, 0);
}
public void driveWithJoysticks(double x, double y, boolean fineControl) {
if (fineControl) {
y = (y / 10);
}
robotDrive.arcadeDrive(y, x);
}
}