mirror of
https://github.com/Team4388/2022NoWayHome.git
synced 2026-06-09 08:48:07 -06:00
updated claws
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
@@ -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)));
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user