forked from teja-yaramada/GomiRomi
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathArcadeDrive2.java
More file actions
43 lines (33 loc) · 1.06 KB
/
Copy pathArcadeDrive2.java
File metadata and controls
43 lines (33 loc) · 1.06 KB
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
package frc.robot.commands;
import java.util.function.Supplier;
import edu.wpi.first.wpilibj2.command.CommandBase;
import frc.robot.subsystems.Drivetrain2;
public class ArcadeDrive2 extends CommandBase{
private final Drivetrain2 m_drivetrain;
private final Supplier <Double> m_xaxisSpeedSupplier;
private final Supplier <Double> m_zaxisRotationSupplier;
public ArcadeDrive2
(
Drivetrain2 m_drivetrain,
Supplier<Double> m_xaxisSpeedSupplier,
Supplier<Double> m_zaxisRotationSupplier
){
this.m_drivetrain = m_drivetrain;
this.m_xaxisSpeedSupplier = m_xaxisSpeedSupplier;
this.m_zaxisRotationSupplier = m_zaxisRotationSupplier;
addRequirements(m_drivetrain);
}
@Override
public void initialize() {}
@Override
public void execute(){
m_drivetrain.arcadeDrive(m_xaxisSpeedSupplier.get(), m_zaxisRotationSupplier.get());
}
@Override
public void end(boolean interrupted) {
}
@Override
public boolean isFinished() {
return false;
}
}