Completed
Push — master ( 0672dd...74c8db )
by John
33s
created

org.usfirst.frc.team3695.robot.commands.ButtonCommandKillPID   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 6
c 1
b 0
f 0
dl 0
loc 24
rs 10

6 Methods

Rating   Name   Duplication   Size   Complexity  
A isFinished() 0 2 1
A initialize() 0 2 1
A execute() 0 1 1
A interrupted() 0 1 1
A end() 0 5 1
A ButtonCommandKillPID() 0 2 1
1
package org.usfirst.frc.team3695.robot.commands;
2
3
import edu.wpi.first.wpilibj.command.Command;
4
import org.usfirst.frc.team3695.robot.OI;
5
import org.usfirst.frc.team3695.robot.Robot;
6
import org.usfirst.frc.team3695.robot.util.Util;
7
8
/** Toggle PID */
9
public class ButtonCommandKillPID extends Command {
10
11
    public ButtonCommandKillPID() {
12
        requires(Robot.SUB_DRIVE);
13
    }
14
15
    protected void initialize() {
16
        Robot.SUB_DRIVE.setPIDF(0,0,0,0);
17
    }
18
19
    protected void execute() { }
20
21
    protected boolean isFinished() {
22
        return false;
23
    }
24
25
    protected void end() {
26
        Robot.SUB_DRIVE.setPIDF(Util.getAndSetDouble("P", 1),
27
                Util.getAndSetDouble("I", 1),
28
                Util.getAndSetDouble("D", 1),
29
                Util.getAndSetDouble("F", 1));
30
    }
31
32
    protected void interrupted() {}
33
}
34