Skip to content
Draft
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
4 changes: 2 additions & 2 deletions src/main/java/frc/robot/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ public final class Constants {
public static final double INDEXER_LOADING_WAIT = 0.5;
public static final double INDEXER_HUMAN_LOADING_WAIT = 1;

public static final double INDEXER_SHOOTER_REJECTION_TIME = 0.5;
public static final double INDEXER_SHOOTER_REJECTION_TIME = 2; // put back to .5 when using full battery
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this a thing?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because the battery was not full
"don't commit temporary changes" blah blah blah i don't care

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The battery voltage will vary in a match, maybe some sort of system to calculate based on voltage of battery? Another probably better method would be to analyze current of shooter to determine when there is a ball there, as there will an increased amount of current when there is a ball touching it.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh that's helpful information, I wasn't aware of that
I'll work on that next time we meet

public static final double INDEXER_INTAKE_REJECTION_TIME = 1;

public static final I2C.Port INDEXER_COLOR = I2C.Port.kMXP;
Expand All @@ -171,7 +171,7 @@ public final class Constants {
public static final double SHOOTER_P = 0.0002;
public static final double SHOOTER_FEEDFORWARD = 0.00218;

public static final double SHOOTER_TOLERANCE = 100;
public static final double SHOOTER_TOLERANCE = 0.20;

public static final InterpolatingTreeMap SHOOTER_SPEED_MAP = new InterpolatingTreeMap();
static {
Expand Down
6 changes: 4 additions & 2 deletions src/main/java/frc/robot/subsystems/indexer/Indexer.java
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ public void periodic() {
Logger.getInstance().recordOutput("Indexer/InstantShooterBall", ballCurrentlyAtShooter);
getAllianceColorFMS();
Logger.getInstance().recordOutput("Indexer/AllianceColor", allianceColor.toString());
Logger.getInstance().recordOutput("Indexer/RejectiomTimerState", rejectionTimerStarted);
switch (state) {
case FIELD2:
stomachMotorOff();
Expand Down Expand Up @@ -336,12 +337,13 @@ else if (rejectionTimerStarted && rejectionTimer.hasElapsed(Constants.INDEXER_SH
shootBall();
intakeBall();
rejectionTimerStarted = false;
state = State.INTAKE1;
state = State.FIELD2;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this, a ball can be intaked while a ball is rejected.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point doing some testing now
I figured this wasn't necessary since it would be put to intake1 either way, but this change definitely does break things

}
/* This shouldn't happen, it would be at a state with 2 balls not 1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can happen, 1 ball tower, 1 ball intake

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True

else if (ballCurrentlyAtIntake) {
intakeBall();
state = State.REJECT1INTAKE1;
}
} */
else if (rejectionTimerStarted && rejectionTimer.hasElapsed(Constants.INDEXER_SHOOTER_REJECTION_TIME)) {
shootBall();
rejectionTimerStarted = false;
Expand Down
5 changes: 3 additions & 2 deletions src/main/java/frc/robot/subsystems/shooter/Shooter.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ public void setSetpoint(double setpoint, boolean forced) {
this.setpoint = setpoint;
}
else {
forcedSetpoint = setpoint;
this.setpoint = setpoint;
// forcedSetpoint = setpoint;
}
}

Expand All @@ -76,7 +77,7 @@ public double getVelocity() {
}

public boolean isAtSetpoint() {
return BetterMath.epsilonEquals(inputs.velocityRotPerMin, Constants.SHOOTER_TOLERANCE) || (Constants.ROBOT_DEMO_MODE && RobotBase.isSimulation());
return BetterMath.epsilonEquals(inputs.velocityRotPerMin, this.setpoint, Constants.SHOOTER_TOLERANCE*this.setpoint) || (Constants.ROBOT_DEMO_MODE && RobotBase.isSimulation());
}

}