Skip to content

Commit

Permalink
Clean up code
Browse files Browse the repository at this point in the history
  • Loading branch information
Noah Gleason committed Nov 5, 2017
1 parent e60b328 commit 5b7cc8b
Show file tree
Hide file tree
Showing 350 changed files with 827 additions and 834 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ public class RobotMap2017 {
* @param logger The logger for recording events and telemetry data.
* @param drive The drive.
* @param defaultDriveCommand The command for the drive to run during the teleoperated period.
* @param updater A runnable that updates cached variables.
* @param updater A runnable that updates cached variables.
* @param climber The climber for boarding the airship. Can be null.
* @param shooter The multiSubsystem for shooting fuel. Can be null.
* @param camera The cameras on this robot. Can be null.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* Run a BinaryMotor while a condition is true.
*/
@JsonIdentityInfo(generator = ObjectIdGenerators.StringIdGenerator.class)
public class RunMotorWhileConditonMet <T extends YamlSubsystem & SubsystemBinaryMotor & SubsystemConditional> extends YamlCommandWrapper {
public class RunMotorWhileConditonMet<T extends YamlSubsystem & SubsystemBinaryMotor & SubsystemConditional> extends YamlCommandWrapper {

/**
* The subsystem to execute this command on
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
*/
@JsonTypeInfo(use = JsonTypeInfo.Id.CLASS, include = JsonTypeInfo.As.WRAPPER_OBJECT, property = "@class")
@JsonIdentityInfo(generator = ObjectIdGenerators.StringIdGenerator.class)
public class FieldOrientedUnidirectionalDriveCommand <T extends YamlSubsystem & DriveUnidirectional & SubsystemAHRS> extends PIDAngleCommand {
public class FieldOrientedUnidirectionalDriveCommand<T extends YamlSubsystem & DriveUnidirectional & SubsystemAHRS> extends PIDAngleCommand {

/**
* The drive this command is controlling.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* Rotates the robot back and forth in order to dislodge any stuck balls.
*/
@JsonIdentityInfo(generator = ObjectIdGenerators.StringIdGenerator.class)
public class JiggleRobot <T extends YamlSubsystem & DriveUnidirectional & SubsystemAHRS> extends YamlCommandGroupWrapper {
public class JiggleRobot<T extends YamlSubsystem & DriveUnidirectional & SubsystemAHRS> extends YamlCommandGroupWrapper {

/**
* Instantiate the CommandGroup
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* Drives straight using the NavX gyro to keep a constant alignment.
*/
@JsonIdentityInfo(generator = ObjectIdGenerators.StringIdGenerator.class)
public class NavXDriveStraight <T extends YamlSubsystem & DriveUnidirectional & SubsystemAHRS> extends PIDAngleCommand {
public class NavXDriveStraight<T extends YamlSubsystem & DriveUnidirectional & SubsystemAHRS> extends PIDAngleCommand {

/**
* The drive subsystem to give output to.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* Turns to a specified angle, relative to the angle the AHRS was at when the robot was turned on.
*/
@JsonIdentityInfo(generator = ObjectIdGenerators.StringIdGenerator.class)
public class NavXTurnToAngle <T extends YamlSubsystem & DriveUnidirectional & SubsystemAHRS> extends PIDAngleCommand {
public class NavXTurnToAngle<T extends YamlSubsystem & DriveUnidirectional & SubsystemAHRS> extends PIDAngleCommand {

/**
* The drive subsystem to execute this command on and to get the gyro reading from.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* Turn a certain number of degrees from the current heading.
*/
@JsonIdentityInfo(generator = ObjectIdGenerators.StringIdGenerator.class)
public class NavXTurnToAngleRelative <T extends YamlSubsystem & DriveUnidirectional & SubsystemAHRS> extends NavXTurnToAngle {
public class NavXTurnToAngleRelative<T extends YamlSubsystem & DriveUnidirectional & SubsystemAHRS> extends NavXTurnToAngle {

/**
* Default constructor.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*/
@JsonTypeInfo(use = JsonTypeInfo.Id.CLASS, include = JsonTypeInfo.As.WRAPPER_OBJECT, property = "@class")
@JsonIdentityInfo(generator = ObjectIdGenerators.StringIdGenerator.class)
public class UnidirectionalNavXDefaultDrive <T extends YamlSubsystem & DriveUnidirectional & SubsystemAHRS> extends PIDAngleCommand {
public class UnidirectionalNavXDefaultDrive<T extends YamlSubsystem & DriveUnidirectional & SubsystemAHRS> extends PIDAngleCommand {

/**
* The drive this command is controlling.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
*/
@JsonTypeInfo(use = JsonTypeInfo.Id.CLASS, include = JsonTypeInfo.As.WRAPPER_OBJECT, property = "@class")
@JsonIdentityInfo(generator = ObjectIdGenerators.StringIdGenerator.class)
public class UnidirectionalNavXShiftingDefaultDrive <T extends YamlSubsystem & DriveUnidirectional & SubsystemAHRS & DriveShiftable> extends UnidirectionalNavXDefaultDrive {
public class UnidirectionalNavXShiftingDefaultDrive<T extends YamlSubsystem & DriveUnidirectional & SubsystemAHRS & DriveShiftable> extends UnidirectionalNavXDefaultDrive {

/**
* The drive to execute this command on.
Expand Down Expand Up @@ -92,7 +92,7 @@ public UnidirectionalNavXShiftingDefaultDrive(@JsonProperty(required = true) dou
public void execute() {
//Auto-shifting
if (!subsystem.getOverrideAutoshift()) {
autoshiftComponent.autoshift((oi.getLeftOutputCached() + oi.getRightOutputCached())/2., subsystem.getLeftVelCached(),
autoshiftComponent.autoshift((oi.getLeftOutputCached() + oi.getRightOutputCached()) / 2., subsystem.getLeftVelCached(),
subsystem.getRightVelCached(), gear -> subsystem.setGear(gear));
}
super.execute();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
import com.fasterxml.jackson.annotation.ObjectIdGenerators;
import org.jetbrains.annotations.Nullable;
import org.usfirst.frc.team449.robot.jacksonWrappers.YamlCommandGroupWrapper;
import org.usfirst.frc.team449.robot.subsystem.interfaces.intake.SubsystemIntake;
import org.usfirst.frc.team449.robot.subsystem.interfaces.intake.commands.SetIntakeMode;
import org.usfirst.frc.team449.robot.subsystem.interfaces.flywheel.SubsystemFlywheel;
import org.usfirst.frc.team449.robot.subsystem.interfaces.flywheel.commands.TurnAllOn;
import org.usfirst.frc.team449.robot.subsystem.interfaces.intake.SubsystemIntake;
import org.usfirst.frc.team449.robot.subsystem.interfaces.intake.commands.SetIntakeMode;

/**
* Command group for firing the flywheel. Runs flywheel, runs static intake, stops dynamic intake, raises intake, and
Expand All @@ -21,7 +21,7 @@ public class FireShooter extends YamlCommandGroupWrapper {
* Constructs a FireShooter command group
*
* @param subsystemFlywheel flywheel subsystem. Can be null.
* @param subsystemIntake intake subsystem. Can be null.
* @param subsystemIntake intake subsystem. Can be null.
*/
@JsonCreator
public FireShooter(@Nullable SubsystemFlywheel subsystemFlywheel,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
import org.jetbrains.annotations.Nullable;
import org.usfirst.frc.team449.robot.jacksonWrappers.YamlCommandGroupWrapper;
import org.usfirst.frc.team449.robot.subsystem.interfaces.flywheel.SubsystemFlywheel;
import org.usfirst.frc.team449.robot.subsystem.interfaces.flywheel.commands.TurnAllOff;
import org.usfirst.frc.team449.robot.subsystem.interfaces.intake.SubsystemIntake;
import org.usfirst.frc.team449.robot.subsystem.interfaces.intake.commands.SetIntakeMode;
import org.usfirst.frc.team449.robot.subsystem.interfaces.flywheel.commands.TurnAllOff;
import org.usfirst.frc.team449.robot.subsystem.interfaces.solenoid.SubsystemSolenoid;
import org.usfirst.frc.team449.robot.subsystem.interfaces.solenoid.commands.SolenoidReverse;

Expand All @@ -17,13 +17,13 @@
* intake, and stops feeder.
*/
@JsonIdentityInfo(generator = ObjectIdGenerators.StringIdGenerator.class)
public class LoadShooter <T extends SubsystemIntake & SubsystemSolenoid> extends YamlCommandGroupWrapper {
public class LoadShooter<T extends SubsystemIntake & SubsystemSolenoid> extends YamlCommandGroupWrapper {

/**
* Constructs a LoadShooter command group
*
* @param subsystemFlywheel flywheel subsystem. Can be null.
* @param subsystemIntake intake subsystem. Can be null.
* @param subsystemIntake intake subsystem. Can be null.
*/
@JsonCreator
public LoadShooter(@Nullable SubsystemFlywheel subsystemFlywheel,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
import org.jetbrains.annotations.Nullable;
import org.usfirst.frc.team449.robot.jacksonWrappers.YamlCommandGroupWrapper;
import org.usfirst.frc.team449.robot.subsystem.interfaces.flywheel.SubsystemFlywheel;
import org.usfirst.frc.team449.robot.subsystem.interfaces.flywheel.commands.SpinUpFlywheel;
import org.usfirst.frc.team449.robot.subsystem.interfaces.intake.SubsystemIntake;
import org.usfirst.frc.team449.robot.subsystem.interfaces.intake.commands.SetIntakeMode;
import org.usfirst.frc.team449.robot.subsystem.interfaces.flywheel.commands.SpinUpFlywheel;
import org.usfirst.frc.team449.robot.subsystem.interfaces.solenoid.SubsystemSolenoid;
import org.usfirst.frc.team449.robot.subsystem.interfaces.solenoid.commands.SolenoidReverse;

Expand All @@ -17,13 +17,13 @@
* intake, and stops feeder.
*/
@JsonIdentityInfo(generator = ObjectIdGenerators.StringIdGenerator.class)
public class RackShooter <T extends SubsystemIntake & SubsystemSolenoid> extends YamlCommandGroupWrapper {
public class RackShooter<T extends SubsystemIntake & SubsystemSolenoid> extends YamlCommandGroupWrapper {

/**
* Constructs a RackShooter command group
*
* @param subsystemFlywheel flywheel subsystem. Can be null.
* @param subsystemIntake intake subsystem. Can be null.
* @param subsystemIntake intake subsystem. Can be null.
*/
@JsonCreator
public RackShooter(@Nullable SubsystemFlywheel subsystemFlywheel,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,24 @@
import com.fasterxml.jackson.annotation.ObjectIdGenerators;
import org.jetbrains.annotations.Nullable;
import org.usfirst.frc.team449.robot.jacksonWrappers.YamlCommandGroupWrapper;
import org.usfirst.frc.team449.robot.subsystem.interfaces.intake.SubsystemIntake;
import org.usfirst.frc.team449.robot.subsystem.interfaces.intake.commands.SetIntakeMode;
import org.usfirst.frc.team449.robot.subsystem.interfaces.flywheel.SubsystemFlywheel;
import org.usfirst.frc.team449.robot.subsystem.interfaces.flywheel.commands.TurnAllOff;
import org.usfirst.frc.team449.robot.subsystem.interfaces.intake.SubsystemIntake;
import org.usfirst.frc.team449.robot.subsystem.interfaces.intake.commands.SetIntakeMode;
import org.usfirst.frc.team449.robot.subsystem.interfaces.solenoid.SubsystemSolenoid;
import org.usfirst.frc.team449.robot.subsystem.interfaces.solenoid.commands.SolenoidReverse;

/**
* Command group to reset everything. Turns everything off, raises intake
*/
@JsonIdentityInfo(generator = ObjectIdGenerators.StringIdGenerator.class)
public class ResetShooter <T extends SubsystemIntake & SubsystemSolenoid> extends YamlCommandGroupWrapper {
public class ResetShooter<T extends SubsystemIntake & SubsystemSolenoid> extends YamlCommandGroupWrapper {

/**
* Constructs a ResetShooter command group
*
* @param subsystemFlywheel flywheel subsystem. Can be null.
* @param subsystemIntake intake subsystem. Can be null.
* @param subsystemIntake intake subsystem. Can be null.
*/
@JsonCreator
public ResetShooter(@Nullable SubsystemFlywheel subsystemFlywheel,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
import org.usfirst.frc.team449.robot.jacksonWrappers.YamlSubsystem;
import org.usfirst.frc.team449.robot.other.Logger;
import org.usfirst.frc.team449.robot.other.MotionProfileData;
import org.usfirst.frc.team449.robot.subsystem.interfaces.motionProfile.TwoSideMPSubsystem.SubsystemMPTwoSides;
import org.usfirst.frc.team449.robot.subsystem.interfaces.AHRS.SubsystemAHRS;
import org.usfirst.frc.team449.robot.subsystem.interfaces.motionProfile.TwoSideMPSubsystem.SubsystemMPTwoSides;


/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* Run the motors until they move, slowly increasing the voltage up from 0.
*/
@JsonIdentityInfo(generator = ObjectIdGenerators.StringIdGenerator.class)
public class DetermineNominalVoltage <T extends YamlSubsystem & DriveUnidirectional> extends YamlCommandWrapper {
public class DetermineNominalVoltage<T extends YamlSubsystem & DriveUnidirectional> extends YamlCommandWrapper {

/**
* The drive subsystem to execute this command on.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* A command to run the robot at a range of voltages and record the velocity.
*/
@JsonIdentityInfo(generator = ObjectIdGenerators.StringIdGenerator.class)
public class DetermineVelVsVoltage <T extends YamlSubsystem & DriveUnidirectional> extends YamlCommandWrapper {
public class DetermineVelVsVoltage<T extends YamlSubsystem & DriveUnidirectional> extends YamlCommandWrapper {

/**
* The subsystem to execute this command on.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* Go at a certain velocity for a set number of seconds
*/
@JsonIdentityInfo(generator = ObjectIdGenerators.StringIdGenerator.class)
public class DriveAtSpeed <T extends YamlSubsystem & DriveUnidirectional> extends YamlCommandWrapper {
public class DriveAtSpeed<T extends YamlSubsystem & DriveUnidirectional> extends YamlCommandWrapper {

/**
* Speed to go at
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* Drives straight when using a tank drive.
*/
@JsonIdentityInfo(generator = ObjectIdGenerators.StringIdGenerator.class)
public class DriveStraight <T extends YamlSubsystem & DriveUnidirectional> extends YamlCommandWrapper {
public class DriveStraight<T extends YamlSubsystem & DriveUnidirectional> extends YamlCommandWrapper {

/**
* The oi that this command gets input from.
Expand Down Expand Up @@ -68,7 +68,8 @@ protected void execute() {
if (useLeft) {
subsystem.setOutput(oi.getLeftOutputCached(), oi.getLeftOutputCached());
} else {
subsystem.setOutput(oi.getRightOutputCached(), oi.getRightOutputCached());;
subsystem.setOutput(oi.getRightOutputCached(), oi.getRightOutputCached());
;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* Drive back and forth to tune PID.
*/
@JsonIdentityInfo(generator = ObjectIdGenerators.StringIdGenerator.class)
public class PIDBackAndForth <T extends YamlSubsystem & DriveUnidirectional> extends YamlCommandGroupWrapper {
public class PIDBackAndForth<T extends YamlSubsystem & DriveUnidirectional> extends YamlCommandGroupWrapper {

/**
* Instantiate the CommandGroup
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* Drive forward at constant speed then stop to tune PID.
*/
@JsonIdentityInfo(generator = ObjectIdGenerators.StringIdGenerator.class)
public class PIDTest <T extends YamlSubsystem & DriveUnidirectional> extends YamlCommandGroupWrapper {
public class PIDTest<T extends YamlSubsystem & DriveUnidirectional> extends YamlCommandGroupWrapper {

/**
* Default constructor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* Very simple unidirectional drive control.
*/
@JsonIdentityInfo(generator = ObjectIdGenerators.StringIdGenerator.class)
public class SimpleUnidirectionalDrive <T extends YamlSubsystem & DriveUnidirectional> extends YamlCommandWrapper {
public class SimpleUnidirectionalDrive<T extends YamlSubsystem & DriveUnidirectional> extends YamlCommandWrapper {

/**
* The OI used for input.
Expand Down
Loading

0 comments on commit 5b7cc8b

Please sign in to comment.