Class SoftwareLimitSwitchConfigs
- All Implemented Interfaces:
ParentConfiguration, Cloneable
Includes enabling software-limit switches and the threshold at which they are tripped.
-
Field Summary
FieldsModifier and TypeFieldDescriptionbooleanIf enabled, the motor output is set to neutral if position exceeds ForwardSoftLimitThreshold and forward output is requested.doublePosition threshold for forward soft limit features.booleanIf enabled, the motor output is set to neutral if position exceeds ReverseSoftLimitThreshold and reverse output is requested.doublePosition threshold for reverse soft limit features. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()final StatusCodedeserialize(String to_deserialize) Take a string and deserialize it to this configuration group.final AngleHelper method to get this configuration's ForwardSoftLimitThreshold parameter converted to a unit type.final AngleHelper method to get this configuration's ReverseSoftLimitThreshold parameter converted to a unit type.final StringGet the serialized form of this configuration group.toString()withForwardSoftLimitEnable(boolean newForwardSoftLimitEnable) Modifies this configuration's ForwardSoftLimitEnable parameter and returns itself for method-chaining and easier to use config API.withForwardSoftLimitThreshold(double newForwardSoftLimitThreshold) Modifies this configuration's ForwardSoftLimitThreshold parameter and returns itself for method-chaining and easier to use config API.withForwardSoftLimitThreshold(Angle newForwardSoftLimitThreshold) Modifies this configuration's ForwardSoftLimitThreshold parameter and returns itself for method-chaining and easier to use config API.withReverseSoftLimitEnable(boolean newReverseSoftLimitEnable) Modifies this configuration's ReverseSoftLimitEnable parameter and returns itself for method-chaining and easier to use config API.withReverseSoftLimitThreshold(double newReverseSoftLimitThreshold) Modifies this configuration's ReverseSoftLimitThreshold parameter and returns itself for method-chaining and easier to use config API.withReverseSoftLimitThreshold(Angle newReverseSoftLimitThreshold) Modifies this configuration's ReverseSoftLimitThreshold parameter and returns itself for method-chaining and easier to use config API.
-
Field Details
-
ForwardSoftLimitEnable
public boolean ForwardSoftLimitEnableIf enabled, the motor output is set to neutral if position exceeds ForwardSoftLimitThreshold and forward output is requested.- Default Value: False
-
ReverseSoftLimitEnable
public boolean ReverseSoftLimitEnableIf enabled, the motor output is set to neutral if position exceeds ReverseSoftLimitThreshold and reverse output is requested.- Default Value: False
-
ForwardSoftLimitThreshold
public double ForwardSoftLimitThresholdPosition 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 ReverseSoftLimitThresholdPosition 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
Helper method to get this configuration's ForwardSoftLimitThreshold parameter converted to a unit type. If not using the Java units library,ForwardSoftLimitThresholdcan 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
Helper method to get this configuration's ReverseSoftLimitThreshold parameter converted to a unit type. If not using the Java units library,ReverseSoftLimitThresholdcan 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
-
serialize
Get the serialized form of this configuration group.- Specified by:
serializein interfaceParentConfiguration- Returns:
- Serialized form of this config group
-
deserialize
Take a string and deserialize it to this configuration group.- Specified by:
deserializein interfaceParentConfiguration- Parameters:
to_deserialize- The serialized configuration- Returns:
- Return code of the deserialize method
-
clone
-