Class SoftwareLimitSwitchConfigs

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

public class SoftwareLimitSwitchConfigs extends Object implements ParentConfiguration
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

      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

      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

  • Method Details

    • withForwardSoftLimitEnable

      public 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 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 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 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

      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 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 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

      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
    • deserialize

      public StatusCode deserialize(String to_deserialize)
      Specified by:
      deserialize in interface ParentConfiguration
    • serialize

      public String serialize()
      Specified by:
      serialize in interface ISerializable