Skip to content

Commit ea157ca

Browse files
committed
fixed seconds/milliseconds bug
1 parent dbefe9c commit ea157ca

2 files changed

Lines changed: 4 additions & 8 deletions

File tree

TeamCode/src/main/java/org/firstinspires/ftc/teamcode/hardware/Indexer.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@ public enum BallColor {
4040

4141
private Position currentPosition = Position.RESET;
4242
/** How long it takes to move between positions in milliseconds */
43-
private final double MOVE_TIME = 1.25;
43+
private final int MOVE_TIME = 1250;
4444
/** How long it takes to move between positions and get the ball into the intake in milliseconds */
45-
private final double MOVE_DROP_TIME = MOVE_TIME + 1.75;
46-
private final double MOVE_DROP_SHOOT_TIME = MOVE_DROP_TIME + 2.5;
45+
private final int MOVE_DROP_TIME = MOVE_TIME + 1750;
46+
private final int MOVE_DROP_SHOOT_TIME = MOVE_DROP_TIME + 2500;
4747
ElapsedTime positionTimer = new ElapsedTime();
4848

4949
/**

TeamCode/src/main/java/org/firstinspires/ftc/teamcode/programs/autonomous/ShootFromBack.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,8 @@ public void init_loop() {
9292
@Override
9393
public void start() {
9494
timer.reset();
95-
shootTimer.reset();
9695
}
9796

98-
private ElapsedTime shootTimer = new ElapsedTime();
9997
/*
10098
* Code to run REPEATEDLY after the driver hits PLAY but before they hit STOP
10199
*/
@@ -163,14 +161,12 @@ public void loop() {
163161
robot.shooter.setRPM(shooterRpm);
164162
boolean xReady = Math.abs(tagX) <= xTolerance;
165163
if (robot.shooter.atSpeedRPM(shooterRpm) && xReady && patternIndex < obeliskMotif.getPattern().length) {
166-
if (!robot.indexer.isShooting()) {
164+
if (!robot.indexer.isShooting() || patternIndex == 0) {
167165
robot.indexer.setPosition(obeliskMotif.getPattern()[patternIndex], true);
168166
patternIndex++;
169-
shootTimer.reset();
170167
}
171168
} else if (patternIndex >= obeliskMotif.getPattern().length) {
172169
// All done shooting
173-
robot.shooter.setRPM(0);
174170
robot.indexer.setPosition(Indexer.Position.RESET);
175171
}
176172
}

0 commit comments

Comments
 (0)