Class SoftwareLimitSwitchConfigs

java.lang.Object
com.ctre.phoenix6.configs.SoftwareLimitSwitchConfigs
All Implemented Interfaces:
ParentConfiguration, Cloneable

public class SoftwareLimitSwitchConfigs extends Object implements ParentConfiguration, Cloneable
Configs that affect how software-limit switches behave.

Includes enabling software-limit switches and the threshold at which they are tripped.

  • Field Details

    • ForwardSoftLimitEnable

      public boolean ForwardSoftLimitEnable
      If enabled, the motor output is set to neutral if position exceeds ForwardSoftLimitThreshold and forward output is requested.
      • Default Value: False
    • ReverseSoftLimitEnable

      public boolean ReverseSoftLimitEnable
      If enabled, the motor output is set to neutral if position exceeds ReverseSoftLimitThreshold and reverse output is requested.
      • Default Value: False
    • ForwardSoftLimitThreshold

      public double ForwardSoftLimitThreshold
      Position threshold for forward soft limit features. ForwardSoftLimitEnable must be enabled for this to take effect.
      • Minimum Value: -3.4e+38
      • Maximum Value: 3.4e+38
      • Default Value: 0
      • Units: rotations
    • ReverseSoftLimitThreshold

      public double ReverseSoftLimitThreshold
      Position threshold for reverse soft limit features. ReverseSoftLimitEnable must be enabled for this to take effect.
      • Minimum Value: -3.4e+38
      • Maximum Value: 3.4e+38
      • Default Value: 0
      • Units: rotations
  • Constructor Details

    • SoftwareLimitSwitchConfigs

      public SoftwareLimitSwitchConfigs()
  • Method Details

    • withForwardSoftLimitEnable

      public final SoftwareLimitSwitchConfigs withForwardSoftLimitEnable(boolean newForwardSoftLimitEnable)
      Modifies this configuration's ForwardSoftLimitEnable parameter and returns itself for method-chaining and easier to use config API.

      If enabled, the motor output is set to neutral if position exceeds ForwardSoftLimitThreshold and forward output is requested.

      • Default Value: False
      Parameters:
      newForwardSoftLimitEnable - Parameter to modify
      Returns:
      Itself
    • withReverseSoftLimitEnable

      public final SoftwareLimitSwitchConfigs withReverseSoftLimitEnable(boolean newReverseSoftLimitEnable)
      Modifies this configuration's ReverseSoftLimitEnable parameter and returns itself for method-chaining and easier to use config API.

      If enabled, the motor output is set to neutral if position exceeds ReverseSoftLimitThreshold and reverse output is requested.

      • Default Value: False
      Parameters:
      newReverseSoftLimitEnable - Parameter to modify
      Returns:
      Itself
    • withForwardSoftLimitThreshold

      public final SoftwareLimitSwitchConfigs withForwardSoftLimitThreshold(double newForwardSoftLimitThreshold)
      Modifies this configuration's ForwardSoftLimitThreshold parameter and returns itself for method-chaining and easier to use config API.

      Position threshold for forward soft limit features. ForwardSoftLimitEnable must be enabled for this to take effect.

      • Minimum Value: -3.4e+38
      • Maximum Value: 3.4e+38
      • Default Value: 0
      • Units: rotations
      Parameters:
      newForwardSoftLimitThreshold - Parameter to modify
      Returns:
      Itself
    • withForwardSoftLimitThreshold

      public final SoftwareLimitSwitchConfigs withForwardSoftLimitThreshold(Angle newForwardSoftLimitThreshold)
      Modifies this configuration's ForwardSoftLimitThreshold parameter and returns itself for method-chaining and easier to use config API.

      Position threshold for forward soft limit features. ForwardSoftLimitEnable must be enabled for this to take effect.

      • Minimum Value: -3.4e+38
      • Maximum Value: 3.4e+38
      • Default Value: 0
      • Units: rotations
      Parameters:
      newForwardSoftLimitThreshold - Parameter to modify
      Returns:
      Itself
    • getForwardSoftLimitThresholdMeasure

      public final Angle getForwardSoftLimitThresholdMeasure()
      Helper method to get this configuration's ForwardSoftLimitThreshold parameter converted to a unit type. If not using the Java units library, ForwardSoftLimitThreshold can be accessed directly instead.

      Position threshold for forward soft limit features. ForwardSoftLimitEnable must be enabled for this to take effect.

      • Minimum Value: -3.4e+38
      • Maximum Value: 3.4e+38
      • Default Value: 0
      • Units: rotations
      Returns:
      ForwardSoftLimitThreshold
    • withReverseSoftLimitThreshold

      public final SoftwareLimitSwitchConfigs withReverseSoftLimitThreshold(double newReverseSoftLimitThreshold)
      Modifies this configuration's ReverseSoftLimitThreshold parameter and returns itself for method-chaining and easier to use config API.

      Position threshold for reverse soft limit features. ReverseSoftLimitEnable must be enabled for this to take effect.

      • Minimum Value: -3.4e+38
      • Maximum Value: 3.4e+38
      • Default Value: 0
      • Units: rotations
      Parameters:
      newReverseSoftLimitThreshold - Parameter to modify
      Returns:
      Itself
    • withReverseSoftLimitThreshold

      public final SoftwareLimitSwitchConfigs withReverseSoftLimitThreshold(Angle newReverseSoftLimitThreshold)
      Modifies this configuration's ReverseSoftLimitThreshold parameter and returns itself for method-chaining and easier to use config API.

      Position threshold for reverse soft limit features. ReverseSoftLimitEnable must be enabled for this to take effect.

      • Minimum Value: -3.4e+38
      • Maximum Value: 3.4e+38
      • Default Value: 0
      • Units: rotations
      Parameters:
      newReverseSoftLimitThreshold - Parameter to modify
      Returns:
      Itself
    • getReverseSoftLimitThresholdMeasure

      public final Angle getReverseSoftLimitThresholdMeasure()
      Helper method to get this configuration's ReverseSoftLimitThreshold parameter converted to a unit type. If not using the Java units library, ReverseSoftLimitThreshold can be accessed directly instead.

      Position threshold for reverse soft limit features. ReverseSoftLimitEnable must be enabled for this to take effect.

      • Minimum Value: -3.4e+38
      • Maximum Value: 3.4e+38
      • Default Value: 0
      • Units: rotations
      Returns:
      ReverseSoftLimitThreshold
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • serialize

      public final String serialize()
      Get the serialized form of this configuration group.
      Specified by:
      serialize in interface ParentConfiguration
      Returns:
      Serialized form of this config group
    • deserialize

      public final StatusCode deserialize(String to_deserialize)
      Take a string and deserialize it to this configuration group.
      Specified by:
      deserialize in interface ParentConfiguration
      Parameters:
      to_deserialize - The serialized configuration
      Returns:
      Return code of the deserialize method
    • clone

      Overrides:
      clone in class Object