Skip to content

Commit

Permalink
remove redundant logs and do a small refactor to the noteToTrap logic…
Browse files Browse the repository at this point in the history
… by running the intake just a touch
  • Loading branch information
PatribotsProgramming committed Mar 23, 2024
1 parent bb20892 commit fe2c93a
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 6 deletions.
6 changes: 5 additions & 1 deletion src/main/java/frc/robot/commands/drive/AlignmentCmds.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,17 @@
import frc.robot.subsystems.Swerve;
import frc.robot.util.Constants.FieldConstants;
import frc.robot.util.calc.AlignmentCalc;
import monologue.Annotations.IgnoreLogged;

public class AlignmentCmds {

@IgnoreLogged
private Climb climb;
@IgnoreLogged
private Swerve swerve;
private ShooterCmds shooterCmds;

private ShooterCmds shooterCmds;
@IgnoreLogged
public AlignmentCalc alignmentCalc;

public AlignmentCmds(Swerve swerve, Climb climb, ShooterCmds shooterCmds) {
Expand Down
12 changes: 10 additions & 2 deletions src/main/java/frc/robot/commands/managers/PieceControl.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,24 @@
import frc.robot.util.Constants.ShooterConstants;
import frc.robot.util.Constants.ElevatorConstants;
import frc.robot.util.custom.ActiveConditionalCommand;
import monologue.Annotations.IgnoreLogged;
import monologue.Annotations.Log;
import monologue.Logged;

public class PieceControl implements Logged {


@IgnoreLogged
private Intake intake;
@IgnoreLogged
private Indexer indexer;


@IgnoreLogged
private Elevator elevator;
@IgnoreLogged
private Ampper ampper;
@IgnoreLogged
private ShooterCmds shooterCmds;


private ColorSensor colorSensor;

Expand Down Expand Up @@ -191,6 +198,7 @@ public Command noteToTrap() {
ampper.outtake(),
shooterCmds.stowPivot(),
indexer.toElevator(),
intake.inCommandSlow(),
Commands.waitUntil(() -> !colorSensor.hasNote()),
NT.getWaitCommand("noteToTrap1"), // 0.2
stopIntakeAndIndexer(),
Expand Down
5 changes: 4 additions & 1 deletion src/main/java/frc/robot/commands/managers/ShooterCmds.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,13 @@
import frc.robot.util.Constants.ShooterConstants;
import frc.robot.util.calc.ShooterCalc;
import frc.robot.util.custom.SpeedAngleTriplet;
import monologue.Annotations.IgnoreLogged;

public class ShooterCmds {


@IgnoreLogged
private Pivot pivot;
@IgnoreLogged
private Shooter shooter;

private SpeedAngleTriplet desiredTriplet = new SpeedAngleTriplet();
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/frc/robot/subsystems/Intake.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ public Command inCommand() {
return setPercentCommand(IntakeConstants.INTAKE_PERCENT);
}

public Command inCommandSlow() {
return setPercentCommand(IntakeConstants.INTAKE_PERCENT/3.0);
}

public Command outCommand() {
return setPercentCommand(IntakeConstants.OUTTAKE_PERCENT);
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/frc/robot/util/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -1103,7 +1103,7 @@ public static final class NTConstants {
put("noteToIndexer2", 0.07);
put("noteToIndexer3", 0.0);

put("noteToTrap1", 0.2);
put("noteToTrap1", 0.1);
put("noteToTrap2", 0.5);
put("noteToTrap3", 0.0);

Expand Down
2 changes: 2 additions & 0 deletions src/main/java/frc/robot/util/calc/AlignmentCalc.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@
import frc.robot.util.Constants.AutoConstants;
import frc.robot.util.Constants.DriveConstants;
import frc.robot.util.Constants.FieldConstants;
import monologue.Annotations.IgnoreLogged;

public class AlignmentCalc {

@IgnoreLogged
private Swerve swerve;

public AlignmentCalc(Swerve swerve) {
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/frc/robot/util/calc/ShooterCalc.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,16 @@
import frc.robot.util.Constants.ShooterConstants;
import frc.robot.util.custom.SpeedAngleTriplet;
import monologue.Logged;
import monologue.Annotations.IgnoreLogged;
import monologue.Annotations.Log;

public class ShooterCalc implements Logged {

@IgnoreLogged
private Shooter shooter;
@IgnoreLogged
private Pivot pivot;


public ShooterCalc(Shooter shooter, Pivot pivot) {
this.shooter = shooter;
this.pivot = pivot;
Expand Down

0 comments on commit fe2c93a

Please sign in to comment.