SmartDashboard.putNumber("Climb PID_Setpoint_Rotations", pid.getSetpoint());
SmartDashboard.putNumber("Climb Motor_Actual_Rotations", motor.getPosition().getValueAsDouble());
SmartDashboard.putNumber("Climb Motor_Actual_Meters", inputs.positionMeters);
+ SmartDashboard.putBoolean("Climb Calibrated", !calibrating);
+ SmartDashboard.putBoolean("Climb At Setpoint", atSetPoint());
Logger.recordOutput("LinearClimb setpointMeters", Units.rotationsToRadians(pid.getSetpoint())
* ClimbConstants.WHEEL_RADIUS / ClimbConstants.CLIMB_GEAR_RATIO);
import edu.wpi.first.wpilibj.smartdashboard.MechanismRoot2d;
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
import edu.wpi.first.wpilibj.util.Color8Bit;
+import edu.wpi.first.wpilibj2.command.InstantCommand;
import edu.wpi.first.wpilibj2.command.SubsystemBase;
import frc.robot.constants.Constants;
import frc.robot.constants.IdConstants;
// add some test commands.
SmartDashboard.putData("Extension Mechanism", mechanism);
+ SmartDashboard.putData("Intake Calibrate", new InstantCommand(() -> calibrate()));
+ SmartDashboard.putData("Intake Stop Calibrating", new InstantCommand(() -> stopCalibrating()));
if (RobotBase.isSimulation()) {
// Extender simulation
updateInputs();
Logger.processInputs("Intake", inputs);
+
+ SmartDashboard.putBoolean("Intake Calibrated", !calibrating);
+ SmartDashboard.putBoolean("Intake At Setpoint", Math.abs(inchExtension - setpointInches) < 0.5);
}
public void simulationPeriodic(){
SmartDashboard.putData("max", new InstantCommand(() -> setFieldRelativeTarget(new Rotation2d(Units.degreesToRadians(HoodConstants.MAX_ANGLE)), 0)));
SmartDashboard.putData("medium", new InstantCommand(() -> setFieldRelativeTarget(new Rotation2d(Units.degreesToRadians((HoodConstants.MAX_ANGLE + HoodConstants.MIN_ANGLE) / 2)), 0)));
SmartDashboard.putData("min", new InstantCommand(() -> setFieldRelativeTarget(new Rotation2d(Units.degreesToRadians(HoodConstants.MIN_ANGLE)), 0)));
+
+ SmartDashboard.putData("Hood Calibrate", new InstantCommand(() -> calibrate()));
+ SmartDashboard.putData("Hood Stop Calibrating", new InstantCommand(() -> stopCalibrating()));
}
/**
Logger.recordOutput("Hood/velocitySetpoint", goalVelocityRadPerSec / HoodConstants.HOOD_GEAR_RATIO);
Logger.recordOutput("Hood/SetpointDeg", Units.radiansToDegrees(goalAngle.getRadians()));
+ SmartDashboard.putBoolean("Hood Calibrated", !calibrating);
+ SmartDashboard.putBoolean("Hood At Setpoint", Math.abs(getPositionDeg() - goalAngle.getDegrees()) < 2.0);
+
}
public void calibrate(){
Logger.recordOutput("Shooter/realVelocity", shooterMotorLeft.getVelocity().getValueAsDouble() * ShooterConstants.SHOOTER_LAUNCH_DIAMETER);
Logger.recordOutput("Shooter/targetVelocity", shooterTargetSpeed);
- SmartDashboard.putString("WON AUTO?", (HubActive.wonAuto()) ? "WOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOON" : "lost");
+ SmartDashboard.putBoolean("Shooter At Speed", atTargetSpeed());
+ SmartDashboard.putBoolean("Shooter Running", shooterTargetSpeed > 0);
+
+ SmartDashboard.putString("WON AUTO?", (HubActive.wonAuto()) ? "WOOOOOOON" : "lost");
}
/**
import org.littletonrobotics.junction.Logger;
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
+import edu.wpi.first.wpilibj2.command.InstantCommand;
import edu.wpi.first.wpilibj2.command.SubsystemBase;
import frc.robot.constants.Constants;
import frc.robot.constants.IdConstants;
limitConfig.SupplyCurrentLowerLimit = SpindexerConstants.currentLimit;
limitConfig.SupplyCurrentLowerTime = 1.5;
motor.getConfigurator().apply(limitConfig);
+
+ SmartDashboard.putData("Spindexer Run Forward", new InstantCommand(() -> maxSpindexer()));
+ SmartDashboard.putData("Spindexer Run Reverse", new InstantCommand(() -> reverseSpindexer()));
+ SmartDashboard.putData("Spindexer Stop", new InstantCommand(() -> stopSpindexer()));
}
public enum SpindexerState {
double velocityThreshold = SpindexerConstants.spindexerVelocityWithBall * power;
SmartDashboard.putNumber("Spindexer Ball Count", ballCount);
+ SmartDashboard.putBoolean("Spindexer Running", state == SpindexerState.MAX || state == SpindexerState.CUSTOM);
+ SmartDashboard.putBoolean("Spindexer Has Ball", ballCount > 0);
+
boolean isSpindexerSlow = inputs.spindexerVelocity < velocityThreshold;
if (wasSpindexerSlow && !isSpindexerSlow && power > 0.1) {
ballCount++;
double turretRot = crt.solve(leftAbs, rightAbs);
SmartDashboard.putNumber("CRT Position", Units.rotationsToDegrees(turretRot));
+
+ SmartDashboard.putBoolean("Turret Calibrated", !calibrating);
+ SmartDashboard.putBoolean("Turret At Setpoint", atSetpoint());
}
/* ---------------- Simulation ---------------- */