Skip to content

Commit

Permalink
Added the claw to drop two pixels in the backstage in auto
Browse files Browse the repository at this point in the history
  • Loading branch information
Nishk04 committed Nov 10, 2023
1 parent 603abad commit 75fb48f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public void runOpMode() {

while (distance < 30) {
distance = OdoToInches((driveMotors.backRight.getCurrentPosition() + driveMotors.frontLeft.getCurrentPosition())/2.0);
if (strafeDistance <= 3) {
if (strafeDistance <= 5) {
strafeDistance = OdoToInches(intake.getCurrentPosition());
driveMotors.frontLeft.setPower(0.4);
driveMotors.backLeft.setPower(-0.4);
Expand All @@ -51,11 +51,16 @@ public void runOpMode() {
driveMotors.backLeft.setPower(0.4);
driveMotors.frontRight.setPower(0.4);
driveMotors.backRight.setPower(0.4);
// Claw scoring code

telemetry.addData("Distance Driven Forward: ", distance);
telemetry.update();
}
}
// Sets all motors to have 0 power
driveMotors.setAll(0);
// Claw scoring codes
// Uses the Rotate_Hover variable to hover right above ground to drop pixels
claw.rotate.setPosition(Claw.ROTATE_HOVER);
claw.grip.setPosition(Claw.GRIP_OPEN);
claw.rotate.setPosition(Claw.ROTATE_FLIP);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,12 @@ class Claw(
) {
companion object {
// Try to avoid changing these here. Instead, change them in Variables.kt.
// Hovers just above the ground
const val ROTATE_HOVER = ClawVar.HoverRotation
const val ROTATE_CLOSING = ClawVar.ClosingRotation
// Flips all the way back
const val ROTATE_FLIP = ClawVar.FlippedRotation
// Stow is upright
const val ROTATE_STOW = ClawVar.StowedRotation
const val GRIP_OPEN = ClawVar.ClawOpened
const val GRIP_CLOSED = ClawVar.ClawClosed
Expand Down

0 comments on commit 75fb48f

Please sign in to comment.