From e8dc1f31bbc19ca5c5322708a4c242dd20d34082 Mon Sep 17 00:00:00 2001 From: Meryem Esa Date: Wed, 17 Feb 2016 16:43:17 -0800 Subject: [PATCH] add a min speed for the arm in move arm to angle command --- .../robot/commands/intakearm/MoveIntakeArmToAngle.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 -- 2.30.2