updated claws

This commit is contained in:
66945
2022-03-16 20:16:32 -06:00
parent 970fd819b5
commit a7378ef38a
4 changed files with 25 additions and 19 deletions
+2 -2
View File
@@ -200,9 +200,9 @@ public final class Constants {
public static final int RIGHT_CLAW_ID = 45;
public static final double OPEN_POSITION = 0; // TODO: find actual position
public static final double CLOSE_POSITION = 0; // TODO: find actual position
public static final double CLOSE_POSITION = 1; // TODO: find actual position
public static final double THRESHOLD = 0; // TODO: find actual threshold
public static final double THRESHOLD = .1; // TODO: find actual threshold
public static final double CALIBRATION_SPEED = 0;
+18 -12
View File
@@ -218,21 +218,27 @@ public class RobotContainer {
/* Operator Buttons */
// run claws
new JoystickButton(getOperatorController(), XboxController.Button.kY.value)
.whileHeld(new RunCommand(() -> m_robotClaws.runClaw(ClawType.LEFT, 0.2)))
.whenReleased(new RunCommand(() -> m_robotClaws.runClaw(ClawType.LEFT, 0.0)));
// new JoystickButton(getOperatorController(), XboxController.Button.kY.value)
// .whileHeld(new RunCommand(() -> m_robotClaws.runClaw(ClawType.LEFT, 0.2)))
// .whenReleased(new RunCommand(() -> m_robotClaws.runClaw(ClawType.LEFT, 0.0)));
new JoystickButton(getOperatorController(), XboxController.Button.kX.value)
.whileHeld(new RunCommand(() -> m_robotClaws.runClaw(ClawType.LEFT, -0.2)))
.whenReleased(new RunCommand(() -> m_robotClaws.runClaw(ClawType.LEFT, 0.0)));
// new JoystickButton(getOperatorController(), XboxController.Button.kX.value)
// .whileHeld(new RunCommand(() -> m_robotClaws.runClaw(ClawType.LEFT, -0.2)))
// .whenReleased(new RunCommand(() -> m_robotClaws.runClaw(ClawType.LEFT, 0.0)));
// new JoystickButton(getOperatorController(), XboxController.Button.kB.value)
// .whileHeld(new RunCommand(() -> m_robotClaws.runClaw(ClawType.RIGHT, 0.2)))
// .whenReleased(new RunCommand(() -> m_robotClaws.runClaw(ClawType.RIGHT, 0.0)));
// new JoystickButton(getOperatorController(), XboxController.Button.kA.value)
// .whileHeld(new RunCommand(() -> m_robotClaws.runClaw(ClawType.RIGHT, -0.2)))
// .whenReleased(new RunCommand(() -> m_robotClaws.runClaw(ClawType.RIGHT, 0.0)));
new JoystickButton(getOperatorController(), XboxController.Button.kY.value)
.whenPressed(new RunCommand(() -> m_robotClaws.setOpen(true)));
new JoystickButton(getOperatorController(), XboxController.Button.kB.value)
.whileHeld(new RunCommand(() -> m_robotClaws.runClaw(ClawType.RIGHT, 0.2)))
.whenReleased(new RunCommand(() -> m_robotClaws.runClaw(ClawType.RIGHT, 0.0)));
new JoystickButton(getOperatorController(), XboxController.Button.kA.value)
.whileHeld(new RunCommand(() -> m_robotClaws.runClaw(ClawType.RIGHT, -0.2)))
.whenReleased(new RunCommand(() -> m_robotClaws.runClaw(ClawType.RIGHT, 0.0)));
.whenPressed(new RunCommand(() -> m_robotClaws.setOpen(false)));
}
/*
+1 -1
View File
@@ -175,7 +175,7 @@ public class RobotMap {
// public final CANSparkMax leftClaw = new CANSparkMax(ClawConstants.LEFT_CLAW_ID, MotorType.kBrushless);
// public final CANSparkMax rightClaw = new CANSparkMax(ClawConstants.RIGHT_CLAW_ID, MotorType.kBrushless);
public final Servo leftClaw = new Servo(1); // TODO: find actual channel
public final Servo rightClaw = new Servo(1); // TODO: find actual channel
public final Servo rightClaw = new Servo(2); // TODO: find actual channel
// Shooter Config
/* Boom Boom Subsystem */
@@ -102,13 +102,13 @@ public class Claws extends SubsystemBase {
if(open) {
// m_leftClaw.getEncoder().setPosition(ClawsConstants.OPEN_POSITION + m_leftOffset);
// m_rightClaw.getEncoder().setPosition(ClawsConstants.OPEN_POSITION + m_rightOffset);
m_leftClaw.set(0.1);
m_rightClaw.set(0.1);
m_leftClaw.set(-ClawConstants.OPEN_POSITION);
m_rightClaw.set(ClawConstants.OPEN_POSITION);
} else {
// m_leftClaw.getEncoder().setPosition(ClawsConstants.CLOSE_POSITION + m_leftOffset);
// m_rightClaw.getEncoder().setPosition(ClawsConstants.CLOSE_POSITION + m_rightOffset);
m_leftClaw.set(-0.1);
m_rightClaw.set(-0.1);
m_leftClaw.set(-ClawConstants.CLOSE_POSITION);
m_rightClaw.set(ClawConstants.CLOSE_POSITION);
}
}