This commit is contained in:
2026-01-08 20:28:55 -06:00
parent 8b07ed5579
commit 506e45ac19
2 changed files with 7 additions and 8 deletions

View File

@@ -43,14 +43,13 @@ public class Flywheel {
velo1a = 60 * ((currentPos1 - initPos1) / (stamp - stamp1));
velo1b = 60 * ((currentPos2 - initPos2) / (stamp - stamp1));
initPos1 = currentPos1;
initPos2 = currentPos2;
stamp1 = stamp;
if (Math.abs(velo1a - velo1b) > 200) {
if (velo1a < 200) {
if (velo1a < 200){
velo1 = velo1b;
} else {
} else if (velo1b < 200){
velo1 = velo1a;
}
} else {
velo1 = (velo1a + velo1b) / 2;
}

View File

@@ -35,8 +35,8 @@ public class Robot {
shooter2 = hardwareMap.get(DcMotorEx.class, "s2");
shooter1.setDirection(DcMotorSimple.Direction.REVERSE);
shooter2.setDirection(DcMotorSimple.Direction.REVERSE);
shooter1.setMode(DcMotor.RunMode.RUN_USING_ENCODER);
shooter2.setMode(DcMotor.RunMode.RUN_USING_ENCODER);
shooter1.setMode(DcMotor.RunMode.RUN_WITHOUT_ENCODER);
shooter2.setMode(DcMotor.RunMode.RUN_WITHOUT_ENCODER);
hood = hardwareMap.get(Servo.class, "hood");