Skip to content

Commit

Permalink
intake testing 10:23
Browse files Browse the repository at this point in the history
  • Loading branch information
KPatel008 committed Feb 3, 2024
1 parent fe3c01f commit c8eb9d2
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 23 deletions.
31 changes: 15 additions & 16 deletions src/main/java/frc/robot/Robot.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import edu.wpi.first.wpilibj2.command.CommandScheduler;
import edu.wpi.first.wpilibj2.command.ParallelRaceGroup;
import edu.wpi.first.wpilibj2.command.RepeatCommand;
import edu.wpi.first.wpilibj2.command.SequentialCommandGroup;
import edu.wpi.first.wpilibj2.command.button.CommandXboxController;
import edu.wpi.first.wpilibj2.command.sysid.SysIdRoutine;
import frc.robot.drivetrain.Drivetrain;
Expand Down Expand Up @@ -108,7 +107,7 @@ public Robot() {
m_driverController.rightTrigger().whileTrue(m_shooter.ShooterDelay());

// m_driverController.leftTrigger().whileTrue(new RepeatCommand(m_shooter.Intake()));
m_driverController.leftTrigger().whileTrue(m_intake.intake());
// m_driverController.leftTrigger().whileTrue(m_intake.intake());
// m_driverController.y().whileTrue(m_intake.Spit());
m_driverController.b().whileTrue(m_intake.Stop());
final double defaultStopDistance = 16;
Expand All @@ -117,27 +116,27 @@ public Robot() {
m_driverController.b().onTrue(m_shooter.Stop());
SmartDashboard.putNumber("StopDistance", defaultStopDistance);

m_driverController
.povUp()
.onTrue(
new SequentialCommandGroup(m_intake.intake(), m_shooter.Intake())
.until(
() -> {
return mytimeofflight.getRange()
<= SmartDashboard.getNumber("StopDistance", defaultStopDistance);
}));

// m_driverController
// .leftTrigger()
// .whileTrue(new SequentialCommandGroup(m_intake.intake(), m_shooter.Intake()).repeatedly());
// .povUp()
// .onTrue(
// new SequentialCommandGroup(m_intake.intake(), m_shooter.Intake())
// .until(
// () -> {
// return mytimeofflight.getRange()
// <= SmartDashboard.getNumber("StopDistance", defaultStopDistance);
// }));

m_driverController
.leftTrigger()
.whileTrue(new ParallelRaceGroup(m_intake.intake(), m_shooter.Intake()).repeatedly());

// m_driverController
// .leftTrigger()
// .whileTrue(new SequentialCommandGroup(
// m_intake.intake(),
// m_intake.intake(),
// m_shooter.Intake()).repeatedly()
// .until(

// ));

}
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/frc/robot/intake/Intake.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
public class Intake extends SubsystemBase {
// private final double Speed = 1;
private final double StopSpeed = 0;
private double defaultFrontRollerSpeed = -.75;
private double defaultBackRollerSpeed = -.75;
private double defaultFrontRollerSpeedSpit = .65;
private double defaultBackRollerSpeedSpit = .65;
private double defaultFrontRollerSpeed = -.4;
private double defaultBackRollerSpeed = -.4;
private double defaultFrontRollerSpeedSpit = .5;
private double defaultBackRollerSpeedSpit = .5;

private CANSparkMax topRoller = new CANSparkMax(5, CANSparkMax.MotorType.kBrushless);
private CANSparkMax bottomRoller = new CANSparkMax(6, CANSparkMax.MotorType.kBrushless);
Expand Down
5 changes: 2 additions & 3 deletions src/main/java/frc/robot/shooter/Shooter.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

public class Shooter extends SubsystemBase {

private final double InSpeed = -.25;
private final double InSpeed = -.4;
private final double OutSpeed = .25;
private final double StopSpeed = 0;
private double defaultDelay = .3;
Expand Down Expand Up @@ -67,7 +67,7 @@ public Command Intake() {
System.out.println("InSpeed");
SmartDashboard.putNumber("ShooterSpeed", InSpeed);

feeder.set(OutSpeed);
feeder.set(InSpeed);
},
this);
}
Expand Down Expand Up @@ -95,7 +95,6 @@ public Command Feeder() {
},
this)
.repeatedly();

}

// public Command getCurrent(){
Expand Down

0 comments on commit c8eb9d2

Please sign in to comment.