new InstantCommand(() -> climb.goUp()),
new DriveToPose(drive, () -> FieldConstants.getClimbLocation())
),
- new InstantCommand(() -> controller.setRumble(GenericHID.RumbleType.kBothRumble, 1.0))
+ // TODO: Make it stop rumbling after like a second
+ new InstantCommand(() -> controller.setRumble(GenericHID.RumbleType.kBothRumble, 1.0))
);
}
/** max extension in inches */
- public static final double MAX_EXTENSION = 10.0; // inches
+ public static final double MAX_EXTENSION = 10.0 - 2.0; // inches
- public static final double INTERMEDIATE_EXTENSION = 5.0; //inches
+ public static final double INTERMEDIATE_EXTENSION = 5.0 - 2.0; //inches
public static final double STOW_EXTENSION = 0.2; // inches
// add some test commands.
SmartDashboard.putData("Extension Mechanism", mechanism);
- SmartDashboard.putData("START INTAKE COMMAND", new InstantCommand(()->{
- extend();
- spinStart();
- }));
- SmartDashboard.putData("END INTAKE COMMAND", new InstantCommand(()->{
- intermediateExtend();
- spinStop();
- }));
if (RobotBase.isSimulation()) {
// Extender simulation
*/
public void stopCalibrating(){
zeroMotors();
+ leftMotor.set(0);
+ rightMotor.set(0);
setCurrentLimits(IntakeConstants.EXTENDER_CURRENT_LIMITS);
calibrating = false;
retract();
* @param limit the current limit for stator and supply current
*/
public void setCurrentLimits(double limit) {
- TalonFXConfiguration config = new TalonFXConfiguration();
-
- config.CurrentLimits = new CurrentLimitsConfigs();
-
- config.CurrentLimits.StatorCurrentLimitEnable = true;
- config.CurrentLimits.StatorCurrentLimit = limit;
- config.CurrentLimits.SupplyCurrentLimitEnable = true;
- config.CurrentLimits.SupplyCurrentLimit = limit;
+ CurrentLimitsConfigs limits = new CurrentLimitsConfigs()
+ .withStatorCurrentLimitEnable(true)
+ .withStatorCurrentLimit(limit)
+ .withSupplyCurrentLimitEnable(true)
+ .withSupplyCurrentLimit(limit);
- leftMotor.getConfigurator().apply(config);
- rightMotor.getConfigurator().apply(config);
+ leftMotor.getConfigurator().apply(limits);
+ rightMotor.getConfigurator().apply(limits);
}
@Override
motor.setNeutralMode(NeutralModeValue.Brake);
TalonFXConfiguration config = new TalonFXConfiguration();
- config.MotorOutput.Inverted = InvertedValue.Clockwise_Positive;
+ config.MotorOutput.Inverted = InvertedValue.CounterClockwise_Positive;
config.Slot0.kP = 2.0;
config.Slot0.kS = 0.1; // Static friction compensation