-
Notifications
You must be signed in to change notification settings - Fork 0
/
AutoDrive.java
46 lines (38 loc) · 865 Bytes
/
AutoDrive.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
39
40
41
42
43
44
45
46
//autonomous drive class
import org.usfirst.frc.team4541.driveSystems.MecanumDrive;
public class AutoDrive {
MecanumDrive drive;
public AutoDrive(MecanumDrive drive) {
this.drive = drive;
}
//drives forward at quarter speed
public void forwardDrive() {
drive.setSpeed(0);
drive.drive(0, -1, 0);
}
//drives backward at quarter speed
public void backwardDrive() {
drive.setSpeed(0);
drive.drive(0, 1, 0);
}
//drives left at quarter speed
public void leftDrive() {
drive.setSpeed(0);
drive.drive(-1, 0, 0);
}
//drives right at quarter speed
public void rightDrive() {
drive.setSpeed(0);
drive.drive(1, 0, 0);
}
//turns left at quarter speed
public void leftTurn(){
drive.setSpeed(0);
drive.drive(0,0,-1);
}
//turns right at quarter speed
public void rightTurn(){
drive.setSpeed(0);
drive.drive(0,0,1);
}
}