Package com.ctre.phoenix6.configs
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 Summary
Fields Modifier and Type Field Description boolean
ForwardSoftLimitEnable
If enabled, the motor output is set to neutral if position exceeds ForwardSoftLimitThreshold and forward output is requested.double
ForwardSoftLimitThreshold
Position threshold for forward soft limit features.boolean
ReverseSoftLimitEnable
If enabled, the motor output is set to neutral if position exceeds ReverseSoftLimitThreshold and reverse output is requested.double
ReverseSoftLimitThreshold
Position threshold for reverse soft limit features. -
Constructor Summary
Constructors Constructor Description SoftwareLimitSwitchConfigs()
-
Method Summary
Modifier and Type Method Description StatusCode
deserialize(String to_deserialize)
String
serialize()
String
toString()
SoftwareLimitSwitchConfigs
withForwardSoftLimitEnable(boolean newForwardSoftLimitEnable)
Modifies this configuration's ForwardSoftLimitEnable parameter and returns itself for method-chaining and easier to use config API.SoftwareLimitSwitchConfigs
withForwardSoftLimitThreshold(double newForwardSoftLimitThreshold)
Modifies this configuration's ForwardSoftLimitThreshold parameter and returns itself for method-chaining and easier to use config API.SoftwareLimitSwitchConfigs
withReverseSoftLimitEnable(boolean newReverseSoftLimitEnable)
Modifies this configuration's ReverseSoftLimitEnable parameter and returns itself for method-chaining and easier to use config API.SoftwareLimitSwitchConfigs
withReverseSoftLimitThreshold(double newReverseSoftLimitThreshold)
Modifies this configuration's ReverseSoftLimitThreshold parameter and returns itself for method-chaining and easier to use config API.
-
Field Details
-
ForwardSoftLimitEnable
If enabled, the motor output is set to neutral if position exceeds ForwardSoftLimitThreshold and forward output is requested.- Default Value: False
-
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
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
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
-
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
-
toString
-
deserialize
- Specified by:
deserialize
in interfaceParentConfiguration
-
serialize
- Specified by:
serialize
in interfaceISerializable
-