Skip to content

Commit

Permalink
fix claw test
Browse files Browse the repository at this point in the history
  • Loading branch information
Bi1ku committed Dec 22, 2024
1 parent 260553c commit 5ae25a9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ public void configureCommands() {
new ClawReady(this.telemetry, this.claw)
);

this.intakeAccept = new GamepadTrigger(GamepadKeys.Trigger.RIGHT_TRIGGER, d -> this.claw.setClawPower(-d), this.gamepad2);
this.intakeReject = new GamepadTrigger(GamepadKeys.Trigger.LEFT_TRIGGER, this.claw::setClawPower, this.gamepad2);
this.intakeAccept = new GamepadTrigger(GamepadKeys.Trigger.RIGHT_TRIGGER, d -> this.claw.setPower(-d), this.gamepad2);
this.intakeReject = new GamepadTrigger(GamepadKeys.Trigger.LEFT_TRIGGER, this.claw::setPower, this.gamepad2);

this.liftIncrement = new LiftIncrement(this.telemetry, this.lift);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,26 @@
import org.firstinspires.ftc.teamcode.commands.claw.ClawDown;
import org.firstinspires.ftc.teamcode.commands.claw.ClawUp;
import org.firstinspires.ftc.teamcode.subsystems.Claw;
import org.firstinspires.ftc.teamcode.subsystems.Extendo;
import org.firstinspires.ftc.teamcode.utils.commands.GamepadTrigger;
import org.firstinspires.ftc.teamcode.utils.commands.OpModeCore;

@TeleOp(name = "Claw Test")
public class ClawTest extends OpModeCore {
private Claw claw;
private Extendo extendo;
private GamepadEx gamepad;
private GamepadTrigger intakeAccept, intakeReject;

@Override
public void initialize() {
this.gamepad = new GamepadEx(super.gamepad1);
this.claw = new Claw(super.hardwareMap, super.multipleTelemetry);
this.extendo = new Extendo(super.hardwareMap, super.multipleTelemetry);

this.gamepad.getGamepadButton(GamepadKeys.Button.A).whenPressed(new ClawDown(super.multipleTelemetry, this.claw));
this.gamepad.getGamepadButton(GamepadKeys.Button.Y).whenPressed(new ClawDown(super.multipleTelemetry, this.claw));
this.gamepad.getGamepadButton(GamepadKeys.Button.DPAD_LEFT).whenPressed(new ClawUp(super.multipleTelemetry, this.claw));

this.intakeAccept = new GamepadTrigger(GamepadKeys.Trigger.RIGHT_TRIGGER, d -> this.claw.setClawPower(-d), this.gamepad);
this.intakeReject = new GamepadTrigger(GamepadKeys.Trigger.LEFT_TRIGGER, this.claw::setClawPower, this.gamepad);
this.intakeAccept = new GamepadTrigger(GamepadKeys.Trigger.LEFT_TRIGGER, d -> this.claw.setPower(-d), this.gamepad);
this.intakeReject = new GamepadTrigger(GamepadKeys.Trigger.RIGHT_TRIGGER, this.claw::setPower, this.gamepad);
}

@Override
Expand All @@ -40,6 +37,8 @@ public void runOpMode() throws InterruptedException {

super.waitForStart();

this.intakeAccept.startThread(this);
this.intakeReject.startThread(this);
while (opModeIsActive()) {
super.resetCycle();
CommandScheduler.getInstance().run();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public void setPosition(double position) {
this.clawRotate.setPosition(position);
}

public void setClawPower(double power) {
public void setPower(double power) {
this.leftClaw.setPower(power);
this.rightClaw.setPower(-power);
}
Expand Down

0 comments on commit 5ae25a9

Please sign in to comment.