Skip to content
This repository has been archived by the owner on Aug 31, 2024. It is now read-only.

Minor Change - Makes Claws Open Automatically #111

Merged
merged 3 commits into from
Mar 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public void init_loop() {

// Drive to Left Line
toDepositLeft = robot.drive.trajectoryBuilder(START_POSE_RED)
.lineToLinearHeading(new Pose2d(9, -40, Math.toRadians(135)))
.splineToLinearHeading(new Pose2d(8, -39, Math.toRadians(135)), Math.toRadians(135))
.build();

// Drive to Backboard from Center
Expand All @@ -123,7 +123,7 @@ public void init_loop() {

// Drive to Backboard from Left
toBackboardFromLeft = robot.drive.trajectoryBuilder(toDepositLeft.end())
.lineToLinearHeading(new Pose2d(49, -30, Math.toRadians(180)))
.lineToLinearHeading(new Pose2d(49, -28, Math.toRadians(180)))
.build();

// Park from Backboard Center
Expand Down Expand Up @@ -159,7 +159,7 @@ public void init_loop() {

// Drive to Left Line
toDepositRight = robot.drive.trajectoryBuilder(START_POSE_BLUE)
.splineToLinearHeading(new Pose2d(7, 39, Math.toRadians(225)), Math.toRadians(225))
.splineToLinearHeading(new Pose2d(8, 39, Math.toRadians(225)), Math.toRadians(225))
.build();

// Drive to Backboard from Center
Expand All @@ -169,7 +169,7 @@ public void init_loop() {

// Drive to Backboard from Right
toBackboardFromLeft = robot.drive.trajectoryBuilder(toDepositLeft.end())
.lineToLinearHeading(new Pose2d(49, 41, Math.toRadians(180)))
.lineToLinearHeading(new Pose2d(49, 42, Math.toRadians(180)))
.build();

// Drive to Backboard from Left
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public enum Location {
}

// ------ Declare Slide Positions ------ //
public static int[] slidePositions = { 0, -964, -2110, -3460};
public static int[] slidePositions = { 0, -482, -2110, -3460};

// ------ Declare Servo Positions ------ //
public static double passoverDeliveryPos = 0.2;
Expand Down Expand Up @@ -186,12 +186,7 @@ public void elapsedTimeSleep(int milliseconds) {
while (sleepTime.milliseconds() < milliseconds) {
pulleyLComponent.moveUsingPID();
pulleyRComponent.moveUsingPID();

telemetry.addData("sleeping", "true");
telemetry.update();
}
telemetry.addData("sleeping", "slept");
telemetry.update();
}

// ------ Function to Initialize TensorFlow Object Detection ------ //
Expand Down Expand Up @@ -223,10 +218,7 @@ public Location detectElement(AllianceColor allianceColor) {
x = (recognition.getLeft() + recognition.getRight()) / 2;
y = (recognition.getTop() + recognition.getBottom()) / 2;

telemetry.addData("", " ");
telemetry.addData("Image", "%s (%.0f %% Conf.)", recognition.getLabel(), recognition.getConfidence() * 100);
telemetry.addData("- Position", "%.0f / %.0f", x, y);
telemetry.addData("- Size", "%.0f x %.0f", recognition.getWidth(), recognition.getHeight());
}

switch (allianceColor) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ public void loop() {
double frontRightPower;
double backLeftPower;
double backRightPower;
double drive = -gamepad1.left_stick_y;
double strafe = gamepad1.left_stick_x;
double drive = -robot.currentGamepad1.left_stick_y;
double strafe = robot.currentGamepad1.left_stick_x;
double turn = (robot.currentGamepad1.left_trigger - robot.currentGamepad1.right_trigger) * turnSpeed;
passoverPosition = robot.passoverArmLeft.getPosition();
wristPosition = robot.wrist.getPosition();
Expand Down Expand Up @@ -381,6 +381,10 @@ private void deliveryPosition() {
private void intakePosition() {
wristPosition = HWC.wristIntakePos;
passoverPosition = HWC.passoverIntakePos;

robot.toggleClaw('L');
robot.toggleClaw('R');

slideHeight = 0;
}
}
Loading