Skip to content
Open
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
5 changes: 2 additions & 3 deletions src/main/java/frc/robot/Robot.java
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public void robotPeriodic() {
}

Logger.recordOutput("shootingState", robotContainer.getShootingState().getShootState().toString());

SmartDashboard.putString("DeploymentState", robotContainer.getDeployer().getDeploymentState().toString());
if (Constants.currentMode.equals(Constants.Mode.SIM)) {
robotContainer.getRobotVisualizer().logMechanism();
}
Expand All @@ -132,8 +132,7 @@ public void robotPeriodic() {
if (Constants.DEBUG) {
SmartDashboard.putNumber("driverXbox.getLeftY()", driverXbox.getLeftY());
SmartDashboard.putNumber("driverXbox::getRightX", driverXbox.getRightX());
SmartDashboard.putString("DeploymentState", robotContainer.getDeployer().getDeploymentState().toString());
if (!Constants.TESTBED) {
if (!Constants.TESTBED) {
Logger.recordOutput("MyPose", robotContainer.getDriveBase().getPose());
// Puts data on the elastic dashboard
SmartDashboard.putString("Alliance Color", Robot.allianceColorString());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import edu.wpi.first.wpilibj.Timer;
import frc.robot.constants.Constants;
import frc.robot.constants.enums.DeploymentState;
import frc.robot.subsystems.IntakeDeployerSubsystem;
import frc.robot.utils.logging.commands.LoggableCommand;

Expand All @@ -27,6 +28,7 @@ public void initialize() {

@Override
public void execute() {
System.out.println("INTAKE DEPLOYING IN "+subsystem.getDeploymentState().toString());
switch (subsystem.getDeploymentState()) {
case UP -> subsystem.setSpeed(Constants.INITIAL_INTAKE_RETRACTION_SPEED);
case DOWN -> subsystem.setSpeed(Constants.INITIAL_INTAKE_DEPLOYMENT_SPEED);
Expand All @@ -41,6 +43,7 @@ public void end(boolean interrupted) {

@Override
public boolean isFinished() {
return timer.hasElapsed(Constants.INTAKE_DEPLOYER_BURNOUT_TIMER);
boolean limitSwitch = subsystem.getDeploymentState() == DeploymentState.UP ? subsystem.getFwrLimitSwitchState() : subsystem.getRevLimitSwitchState();
return timer.hasElapsed(Constants.INTAKE_DEPLOYER_BURNOUT_TIMER) || limitSwitch || subsystem.getDeploymentState() == DeploymentState.STOPPED;
}
}
6 changes: 3 additions & 3 deletions src/main/java/frc/robot/constants/GameConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ public enum Mode {
public static final double SHOOTER_SPEED = 1500;
public static final double INTAKE_DEPLOYER_SPEED = -0.075;
public static final double INTAKE_RETRACTION_SPEED = 0.1;
public static final double INITIAL_INTAKE_DEPLOYMENT_SPEED = -0.15;
public static final double INITIAL_INTAKE_RETRACTION_SPEED = 0.3;
public static final double INITIAL_INTAKE_DEPLOYMENT_SPEED = -0.1;
public static final double INITIAL_INTAKE_RETRACTION_SPEED = 0.5;


//Diags
Expand All @@ -80,7 +80,7 @@ public enum Mode {
public static final double ANGLER_TIMEOUT = 60;
public static final int SERVER_SOCKET_CONNECTION_TIMEOUT = 2000;
public static final double SHOOTER_TIMEOUT = 5;
public static final double INTAKE_DEPLOYER_BURNOUT_TIMER = 2;
public static final double INTAKE_DEPLOYER_BURNOUT_TIMER = 5;
public static final double TURRET_TIMEOUT = 5;

//Angles
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,4 +110,10 @@ public void toggleState() {
deploymentState = DeploymentState.UP;
}
}
public boolean getFwrLimitSwitchState(){
return io.isFwdSwitchPressed();
}
public boolean getRevLimitSwitchState(){
return io.isRevSwitchPressed();
}
}