From: Meryem Esa Date: Wed, 16 Mar 2016 02:58:38 +0000 (-0700) Subject: add code that puts ball onto catapult X-Git-Url: http://challenge-bot.com/repos/?p=3501%2Fstronghold-2016;a=commitdiff_plain;h=b16783398a2939b68a3ab4c01e43e400c0f29a7b add code that puts ball onto catapult --- diff --git a/src/org/usfirst/frc/team3501/robot/Constants.java b/src/org/usfirst/frc/team3501/robot/Constants.java index a6543a8f..2fcbabe5 100644 --- a/src/org/usfirst/frc/team3501/robot/Constants.java +++ b/src/org/usfirst/frc/team3501/robot/Constants.java @@ -64,7 +64,8 @@ public class Constants { public final static int ENCODER_RIGHT_A = 3; public final static int ENCODER_RIGHT_B = 4; - public static final double INCHES_PER_PULSE = ((3.66 / 5.14) * 6 * Math.PI) / 256; + public static final double INCHES_PER_PULSE = ((3.66 / 5.14) * 6 * Math.PI) + / 256; public static double kp = 0.013, ki = 0.000015, kd = -0.002; public static double encoderTolerance = 8.0; @@ -85,6 +86,10 @@ public class Constants { public static final Value SHOOT = Value.kForward; public static final Value RESET = Value.kReverse; public static final double WAIT_TIME = 2.0; // In seconds + + // TODO: test for this time + public static final double TIME_FOR_BALL_TO_CATAPULT_ROLLING = 1.0; + } public static class IntakeArm { diff --git a/src/org/usfirst/frc/team3501/robot/commands/shooter/ShootAtHighGoal.java b/src/org/usfirst/frc/team3501/robot/commands/shooter/ShootAtHighGoal.java index 7fca1ff7..1f21e2fb 100755 --- a/src/org/usfirst/frc/team3501/robot/commands/shooter/ShootAtHighGoal.java +++ b/src/org/usfirst/frc/team3501/robot/commands/shooter/ShootAtHighGoal.java @@ -1,7 +1,9 @@ package org.usfirst.frc.team3501.robot.commands.shooter; import org.usfirst.frc.team3501.robot.Constants.IntakeArm; +import org.usfirst.frc.team3501.robot.Constants.Shooter; import org.usfirst.frc.team3501.robot.commands.intakearm.MoveIntakeArm; +import org.usfirst.frc.team3501.robot.commands.intakearm.TimeRunIntake; import edu.wpi.first.wpilibj.command.CommandGroup; import edu.wpi.first.wpilibj.command.WaitCommand; @@ -14,6 +16,7 @@ import edu.wpi.first.wpilibj.command.WaitCommand; * post-conditions: catapult is retracted, intake is extended */ public class ShootAtHighGoal extends CommandGroup { + // TODO: test for this private static final double WAIT_SECONDS = 1.0; public ShootAtHighGoal() { @@ -24,6 +27,9 @@ public class ShootAtHighGoal extends CommandGroup { addSequential(new WaitCommand(WAIT_SECONDS)); // get ball onto catapult + addSequential(new TimeRunIntake(Shooter.TIME_FOR_BALL_TO_CATAPULT_ROLLING)); + + addSequential(new WaitCommand(WAIT_SECONDS)); // shoot catapult pistons addSequential(new FireCatapult()); @@ -35,9 +41,6 @@ public class ShootAtHighGoal extends CommandGroup { addSequential(new WaitCommand(WAIT_SECONDS)); - // wait a bit - addSequential(new WaitCommand(WAIT_SECONDS)); - // retract catapult pistons addSequential(new ResetCatapult());