Add commands for Climber and Climber subsystem
authorShivani Ghanta <shivani.oghanta@gmail.com>
Sat, 14 Jan 2017 22:06:46 +0000 (14:06 -0800)
committerShivani Ghanta <shivani.oghanta@gmail.com>
Sat, 14 Jan 2017 22:12:50 +0000 (14:12 -0800)
src/org/usfirst/frc/team3501/robot/commands/climber/RunWinch.java [new file with mode: 0644]
src/org/usfirst/frc/team3501/robot/commands/climber/RunWinchContinuous.java [new file with mode: 0644]
src/org/usfirst/frc/team3501/robot/commands/climber/StopWinch.java [new file with mode: 0644]
src/org/usfirst/frc/team3501/robot/subsystems/Climber.java [new file with mode: 0644]

diff --git a/src/org/usfirst/frc/team3501/robot/commands/climber/RunWinch.java b/src/org/usfirst/frc/team3501/robot/commands/climber/RunWinch.java
new file mode 100644 (file)
index 0000000..0586c36
--- /dev/null
@@ -0,0 +1,42 @@
+package org.usfirst.frc.team3501.robot.commands.climber;
+
+import edu.wpi.first.wpilibj.command.Command;
+
+/**
+ * Runs the winch at a given time and motor value
+ *
+ * @author shivanighanta
+ *
+ */
+public class RunWinch extends Command {
+  private double time;
+  private double motorVal;
+
+  public RunWinch(double time, double motorVal) {
+    this.time = time;
+    this.motorVal = motorVal;
+  }
+
+  @Override
+  protected void initialize() {
+  }
+
+  @Override
+  protected void execute() {
+
+  }
+
+  @Override
+  protected boolean isFinished() {
+    return false;
+  }
+
+  @Override
+  protected void end() {
+
+  }
+
+  @Override
+  protected void interrupted() {
+  }
+}
diff --git a/src/org/usfirst/frc/team3501/robot/commands/climber/RunWinchContinuous.java b/src/org/usfirst/frc/team3501/robot/commands/climber/RunWinchContinuous.java
new file mode 100644 (file)
index 0000000..ee075f2
--- /dev/null
@@ -0,0 +1,40 @@
+package org.usfirst.frc.team3501.robot.commands.climber;
+
+import edu.wpi.first.wpilibj.command.Command;
+
+/**
+ * Runs the winch continuously at a given motor value
+ *
+ * @author shivanighanta
+ *
+ */
+public class RunWinchContinuous extends Command {
+  private double motorVal;
+
+  public RunWinchContinuous(double motorVal) {
+    this.motorVal = motorVal;
+  }
+
+  @Override
+  protected void initialize() {
+  }
+
+  @Override
+  protected void execute() {
+
+  }
+
+  @Override
+  protected boolean isFinished() {
+    return false;
+  }
+
+  @Override
+  protected void end() {
+
+  }
+
+  @Override
+  protected void interrupted() {
+  }
+}
diff --git a/src/org/usfirst/frc/team3501/robot/commands/climber/StopWinch.java b/src/org/usfirst/frc/team3501/robot/commands/climber/StopWinch.java
new file mode 100644 (file)
index 0000000..f024569
--- /dev/null
@@ -0,0 +1,38 @@
+package org.usfirst.frc.team3501.robot.commands.climber;
+
+import edu.wpi.first.wpilibj.command.Command;
+
+/**
+ * Stops the winch
+ *
+ * @author shivanighanta
+ *
+ */
+public class StopWinch extends Command {
+
+  public StopWinch() {
+  }
+
+  @Override
+  protected void initialize() {
+  }
+
+  @Override
+  protected void execute() {
+
+  }
+
+  @Override
+  protected boolean isFinished() {
+    return false;
+  }
+
+  @Override
+  protected void end() {
+
+  }
+
+  @Override
+  protected void interrupted() {
+  }
+}
diff --git a/src/org/usfirst/frc/team3501/robot/subsystems/Climber.java b/src/org/usfirst/frc/team3501/robot/subsystems/Climber.java
new file mode 100644 (file)
index 0000000..f68c679
--- /dev/null
@@ -0,0 +1,16 @@
+package org.usfirst.frc.team3501.robot.subsystems;
+
+public class Climber {
+  private static Climber climber;
+
+  private Climber() {
+
+  }
+
+  public static Climber getClimber() {
+    if (climber == null) {
+      climber = climber();
+    }
+    return climber;
+  }
+}