From: Meryem Esa Date: Thu, 18 Feb 2016 00:43:17 +0000 (-0800) Subject: add a min speed for the arm in move arm to angle command X-Git-Url: http://challenge-bot.com/repos/?p=3501%2Fstronghold-2016;a=commitdiff_plain;h=e8dc1f31bbc19ca5c5322708a4c242dd20d34082 add a min speed for the arm in move arm to angle command --- diff --git a/src/org/usfirst/frc/team3501/robot/commands/intakearm/MoveIntakeArmToAngle.java b/src/org/usfirst/frc/team3501/robot/commands/intakearm/MoveIntakeArmToAngle.java index f00e62e1..510146cc 100644 --- a/src/org/usfirst/frc/team3501/robot/commands/intakearm/MoveIntakeArmToAngle.java +++ b/src/org/usfirst/frc/team3501/robot/commands/intakearm/MoveIntakeArmToAngle.java @@ -10,6 +10,7 @@ public class MoveIntakeArmToAngle extends Command { private double targetSpeed; private double calculatedSpeed; private double SENSITIVITY_THRESHOLD = 0.1; + private double MIN_SPEED = .3; public MoveIntakeArmToAngle(double angle, double speed) { requires(Robot.intakeArm); @@ -22,8 +23,11 @@ public class MoveIntakeArmToAngle extends Command { protected void initialize() { // set the arm speed to the calculated angle - Robot.intakeArm.setArmSpeed(getCalculatedSpeed()); + double speed = getCalculatedSpeed(); + if (speed < MIN_SPEED && speed > 0) + speed = Math.signum(getCalculatedSpeed()) * MIN_SPEED; + Robot.intakeArm.setArmSpeed(speed); } @Override