Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
digital division committed Dec 21, 2024
1 parent b69bc18 commit 034a087
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,13 @@ public class ArmSubsystem {
public static final String ARM_MOTOR = "arm_motor";

public static final double ARM_TICKS_PER_DEGREE = 5;
public static final double Arm_High_Bucket = 45* ARM_TICKS_PER_DEGREE;
public static final double Arm_Start_Position = -25
* ARM_TICKS_PER_DEGREE;
public static final double Arm_Collect_Position = 5 * ARM_TICKS_PER_DEGREE;
public static final double Arm_High_Bucket = 65 * ARM_TICKS_PER_DEGREE;
public static final double Arm_Start_Position = 5 * ARM_TICKS_PER_DEGREE;
public static final double Arm_Collect_Position = -25 * ARM_TICKS_PER_DEGREE;
public static final double ARM_SCORE_SPECIMEN = 90 * ARM_TICKS_PER_DEGREE;
public static final double Arm_Low_Bucket = 25 * ARM_TICKS_PER_DEGREE;
public static final double Arm_Low_Bucket = 45 * ARM_TICKS_PER_DEGREE;
public static final double Arm_Clear_Barrier = 12.5 * ARM_TICKS_PER_DEGREE;
public static final double Arm_Low_Bar = 35 * ARM_TICKS_PER_DEGREE;
public static final double Arm_Low_Bar = 10 * ARM_TICKS_PER_DEGREE;
public static final double ARM_WINCH_ROBOT = 10 * ARM_TICKS_PER_DEGREE;
static double FUDGE_FACTOR_DEGREES = 15;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public void runOpMode() throws InterruptedException {
double rx = gamepad1.right_stick_x; // Turning


double turningSpeed = 0.3;
double turningSpeed = 0.6;
if (Math.abs(rx) > 0.1) {
rx = turningSpeed * Math.signum(rx);
} else {
Expand All @@ -65,34 +65,34 @@ public void runOpMode() throws InterruptedException {
slideSubsystem.setPower(0);
}

if (gamepad1.dpad_left) {
if (gamepad2.dpad_left) {
claw.open();
} else if (gamepad1.dpad_right) {
} else if (gamepad2.dpad_right) {
claw.close();
}


if (gamepad2.a) {
if (gamepad2.x) {
arm.setArmPosition(ArmSubsystem.Arm_Start_Position);
} else if (gamepad2.y) {
} else if (gamepad2.a) {
arm.setArmPosition(ArmSubsystem.Arm_Collect_Position);
} else if (gamepad2.x) {
arm.setArmPosition(ArmSubsystem.Arm_Low_Bucket);
} else if (gamepad2.b) {
arm.setArmPosition(ArmSubsystem.Arm_Low_Bucket);
} else if (gamepad2.y) {
arm.setArmPosition(ArmSubsystem.Arm_High_Bucket);
} else if (gamepad2.dpad_up) {
} else if (gamepad2.left_stick_button) {
arm.setArmPosition(ArmSubsystem.Arm_Low_Bar);
} else if (gamepad2.dpad_down) {
} else if (gamepad2.right_stick_button) {
arm.setArmPosition(ArmSubsystem.Arm_Clear_Barrier);
} else if (gamepad2.start) {
arm.resetArmEncoder();
}

if (gamepad2.right_stick_button) {
if (gamepad2.dpad_up) {
wrist.moveToPosition(.75);
} else if (gamepad2.left_stick_button) {
} else if (gamepad2.dpad_down) {
wrist.moveToPosition(0);
}


double denominator = Math.max(Math.abs(y) + Math.abs(x) + Math.abs(rx), 1);
double frontRightPower = (y + x + rx) / denominator;
Expand All @@ -110,7 +110,7 @@ public void runOpMode() throws InterruptedException {
telemetry.addData("gamepad1 left stick x ", x);
telemetry.addData("motor power", frontLeftPower);
telemetry.addData("turn", rx);

}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ public class DriveSubsystem {
// Define Motor and Servo objects (Make them private so they can't be accessed externally)
private DcMotor frontLeftMotor;
private DcMotor frontRightMotor;
private DcMotor backLeftMotor; private DcMotor backRightMotor;
private DcMotor backLeftMotor;
private DcMotor backRightMotor;

private HardwareMap hardwareMap;
private Telemetry telemetry;
Expand Down

0 comments on commit 034a087

Please sign in to comment.