org.usfirst.frc.team3695.robot.commands.ManualCommandDrive   A
last analyzed

Complexity

Total Complexity 8

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 32
rs 10
c 0
b 0
f 0
wmc 8

6 Methods

Rating   Name   Duplication   Size   Complexity  
A ManualCommandDrive() 0 2 1
A initialize() 0 1 1
A execute() 0 14 3
A end() 0 1 1
A interrupted() 0 1 1
A isFinished() 0 2 1
1
package org.usfirst.frc.team3695.robot.commands;
2
3
import edu.wpi.first.wpilibj.command.Command;
4
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
5
import org.usfirst.frc.team3695.robot.OI;
6
import org.usfirst.frc.team3695.robot.Robot;
7
import org.usfirst.frc.team3695.robot.util.Util;
8
9
/** manually command the robot with joysticks */
10
public class ManualCommandDrive extends Command {
11
	
12
    public ManualCommandDrive() {
13
        requires(Robot.SUB_DRIVE);
14
    }
15
16
    protected void initialize() {}
17
18
    protected void execute() {
19
        SmartDashboard.putNumber("Tilt Angle", Robot.SUB_DRIVE.getYAngle());
20
        SmartDashboard.putBoolean("Docked", Robot.SUB_DRIVE.docking);
21
        SmartDashboard.putBoolean("Reversed", Robot.SUB_DRIVE.reversing);
22
        SmartDashboard.putNumber("Right Encoder Inches", Robot.SUB_DRIVE.pid.getRightInches());
23
        SmartDashboard.putNumber("Left Encoder Inches", Robot.SUB_DRIVE.pid.getLeftInches());
24
25
    	switch (Robot.SUB_DRIVE.drivetrain) {
26
    		case ROCKET_LEAGUE:
27
    			Robot.SUB_DRIVE.driveRLTank(OI.DRIVER, Util.getAndSetDouble("Rocket Ramp", .75), Util.getAndSetDouble("Drive Inhibitor", 1));
0 ignored issues
show
Comprehensibility introduced by
Consider assigning this magic number .75 to a constant.

Using constants for hard-coded numbers is a best practice. A constant’s name can explain the rationale behind this magic number. It is also easier to find if you ever need to change it.

Loading history...
28
    			break;
29
    		case FORZA: 
30
    			Robot.SUB_DRIVE.driveForza(OI.DRIVER, Util.getAndSetDouble("Forza Ramp", .75), Util.getAndSetDouble("Radius", 1), Util.getAndSetDouble("Drive Inhibitor", 1));
0 ignored issues
show
Comprehensibility introduced by
Consider assigning this magic number .75 to a constant.

Using constants for hard-coded numbers is a best practice. A constant’s name can explain the rationale behind this magic number. It is also easier to find if you ever need to change it.

Loading history...
31
    			break;
32
    	}
33
    }
34
35
    protected boolean isFinished() {
36
        return false;
37
    }
38
39
    protected void end() {}
40
41
    protected void interrupted() {}
42
}
43