Skip to content

Commit

Permalink
soft limits
Browse files Browse the repository at this point in the history
  • Loading branch information
Craptop committed Nov 28, 2023
1 parent 2141657 commit bd1874b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main/java/frc/robot/subsystems/WristSubsystem.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import edu.wpi.first.wpilibj2.command.SubsystemBase;
import frc.robot.Constants;
import frc.robot.Constants.Wrist;
import edu.wpi.first.wpilibj.shuffleboard.BuiltInLayouts;

public class WristSubsystem extends SubsystemBase {
/** Creates a new WristSubsystem. */
Expand All @@ -28,7 +29,10 @@ public WristSubsystem() {
this.wrist_motor = new TalonFX(Constants.Wrist.WRIST_MOTOR_DEVICE_NUMBER);
this.wrist_motor.configFactoryDefault();
this.wrist_motor.clearStickyFaults();
this.wrist_motor.configForwardSoftLimitThreshold(0);
this.wrist_motor.configReverseSoftLimitThreshold(degreesToTicks(90));
this.wrist_motor.configReverseSoftLimitEnable(true, 0);
this.wrist_motor.configForwardSoftLimitEnable(true, 0);
this.wrist_motor.setNeutralMode(NeutralMode.Coast);
this.wrist_motor.setSelectedSensorPosition(0);
this.wrist_motor.configOpenloopRamp(.5); // can't go from 0 to 1 instantly
Expand Down

0 comments on commit bd1874b

Please sign in to comment.