Skip to content

Commit

Permalink
stuff that works
Browse files Browse the repository at this point in the history
  • Loading branch information
ProgrammingSR committed Mar 8, 2024
1 parent a6d9471 commit b7f43f8
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 11 deletions.
10 changes: 10 additions & 0 deletions simgui.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,16 @@
}
}
},
"NetworkTables": {
"retained": {
"SmartDashboard": {
"Auto Chooser": {
"open": true
},
"open": true
}
}
},
"NetworkTables Info": {
"visible": true
}
Expand Down
6 changes: 6 additions & 0 deletions src/main/deploy/pathplanner/autos/2-Center-Stays.auto
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@
]
}
},
{
"type": "named",
"data": {
"name": "Intake in"
}
},
{
"type": "named",
"data": {
Expand Down
4 changes: 2 additions & 2 deletions src/main/deploy/pathplanner/paths/CenterNote-Center.path
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
"y": 5.5216374597852385
},
"prevControl": {
"x": 2.3470318873095533,
"y": 5.5216374597852385
"x": 3.1247868210022136,
"y": 5.541275082550166
},
"nextControl": null,
"isLocked": false,
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/frc/robot/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public static final class IntakeConstants {
public static final class ShooterConstants {
public static final int kTopShooterMotorPort = 20;
public static final int kBottomShooterMotorPort = 35;
public static final double kShooterSpeedTop = 0.75;
public static final double kShooterSpeedTop = 0.8;
public static final double kShooterSpeedBottom = 0.9;
public static final double kShooterOff = 0;
}
Expand Down
5 changes: 4 additions & 1 deletion src/main/java/frc/robot/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ public RobotContainer() {
new NoteIntakeCommand(m_intakeSubsystem),
new IntakeArmPositionCommand(m_intakeSubsystem, ArmPosition.Retracted)));

NamedCommands.registerCommand("Intake in",
new IntakeArmPositionCommand(m_intakeSubsystem, ArmPosition.Retracted));

AutoBuilder.configureHolonomic(m_robotDrive::getPose, m_robotDrive::resetOdometry,
m_robotDrive::getChassisSpeeds,
m_robotDrive::autonDrive,
Expand All @@ -86,7 +89,7 @@ public RobotContainer() {
// meters. Distance
// from robot center to
// furthest module.
new ReplanningConfig(true, true)),
new ReplanningConfig(false, false)),
() -> false, m_robotDrive);

// new SequentialCommandGroup(new ShooterSetSpeedCommand(m_shooterSubsystem,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@ public void end(boolean interrupted) {
// Returns true when the command should end.
@Override
public boolean isFinished() {
return m_ShooterSubsystem.returnCurrentSpeed() > 0.8;
return m_timer.get() > 1.5;
}
}
9 changes: 4 additions & 5 deletions src/main/java/frc/robot/subsystems/ShooterSubsystem.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ public class ShooterSubsystem extends SubsystemBase {
private double m_topSpeed = 0;
private double m_bottomSpeed = 0;

SlewRateLimiter m_topLimiter = new SlewRateLimiter(0.2);
SlewRateLimiter m_bottomLimiter = new SlewRateLimiter(0.2);
// SlewRateLimiter m_topLimiter = new SlewRateLimiter(0.4);
// SlewRateLimiter m_bottomLimiter = new SlewRateLimiter(0.4);

public ShooterSubsystem() {
m_bottom.setIdleMode(IdleMode.kCoast);
Expand All @@ -46,9 +46,9 @@ public void setShootingSpeed(ShootSpeed speed) {
switch (speed) {
case Shooting:
m_topSpeed = ShooterConstants.kShooterSpeedTop;
m_topSpeed = m_topLimiter.calculate(m_topSpeed);
// m_topSpeed = m_topLimiter.calculate(m_topSpeed);
m_bottomSpeed = ShooterConstants.kShooterSpeedBottom;
m_bottomSpeed = m_bottomLimiter.calculate(m_topSpeed);
// m_bottomSpeed = m_bottomLimiter.calculate(m_topSpeed);
// System.out.println("shoot speed: " + ShooterConstants.kShooterSpeed);
break;
case Off:
Expand All @@ -71,7 +71,6 @@ public void periodic() {

m_bottom.set(m_bottomSpeed);
m_top.set(m_topSpeed);

}

public static enum ShootSpeed {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/frc/robot/subsystems/VisionSubsystem.java
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public void periodic() {

if (latestMeasurement != null) {
for (Consumer<Measurement> consumer : m_consumerList) {
consumer.accept(latestMeasurement);
// consumer.accept(latestMeasurement);
}
}

Expand Down

0 comments on commit b7f43f8

Please sign in to comment.