TalonFXConfiguration rollerConfig = new TalonFXConfiguration();
// config the current limits (low value for testing)
+ // add constant for currentLimits
rollerConfig.CurrentLimits
- .withStatorCurrentLimit(3.0)
+ .withStatorCurrentLimit(40.0)
.withStatorCurrentLimitEnable(true)
- .withSupplyCurrentLimit(3.0)
+ .withSupplyCurrentLimit(40.0)
.withSupplyCurrentLimitEnable(true);
// config Slot 0 PID params
// config the current limits (low value for testing)
config.CurrentLimits
- .withStatorCurrentLimit(3.0)
+ .withStatorCurrentLimit(10.0)
.withStatorCurrentLimitEnable(true)
- .withSupplyCurrentLimit(3.0)
+ .withSupplyCurrentLimit(10.0)
.withSupplyCurrentLimitEnable(true);
// config Slot 0 PID params
SmartDashboard.putData("Retract Intake", new InstantCommand(this::retract));
SmartDashboard.putData("Intake On", new InstantCommand(this::spinStart));
SmartDashboard.putData("Intake Off", new InstantCommand(this::spinStop));
+ SmartDashboard.putData("Roller Spin Forward", new InstantCommand(() -> this.spin(0.5), this));
+ SmartDashboard.putData("Roller Spin Reverse", new InstantCommand(() -> this.spin(-0.5), this));
+ SmartDashboard.putData("Roller Stop", new InstantCommand(() -> this.spin(0.0), this));
+ SmartDashboard.putData("Zero Motors", new InstantCommand(this::zeroMotors));
+
if (RobotBase.isSimulation()) {
// build the simulation resources
// this returns rotations per second.
double velocity = rollerMotor.getVelocity().getValueAsDouble();
SmartDashboard.putNumber("Roller Velocity", velocity);
+
}
public void simulationPeriodic(){
*/
public void spin(double speed) {
rollerMotor.set(speed);
+ System.out.println(speed);
}
/**
/** Retract the intake to its starting position. */
public void retract(){
setPosition(IntakeConstants.startingPoint);
+
+ }
+
+ public void zeroMotors() {
+ rightMotor.setPosition(0.0);
+ leftMotor.setPosition(0.0);
}
/**