Class HardwareLimitSwitchConfigs
- All Implemented Interfaces:
ParentConfiguration
,ISerializable
public class HardwareLimitSwitchConfigs extends Object implements ParentConfiguration
Includes configs such as enabling limit switches, configuring the remote sensor ID, the source, and the position to set on limit.
-
Field Summary
Fields Modifier and Type Field Description boolean
ForwardLimitAutosetPositionEnable
If enabled, the position is automatically set to a specific value, specified by ForwardLimitAutosetPositionValue, when the forward limit switch is asserted.double
ForwardLimitAutosetPositionValue
The value to automatically set the position to when the forward limit switch is asserted.boolean
ForwardLimitEnable
If enabled, motor output is set to neutral when the forward limit switch is asserted and positive output is requested.int
ForwardLimitRemoteSensorID
Device ID of the remote device if using remote limit switch features for the forward limit switch.ForwardLimitSourceValue
ForwardLimitSource
Determines where to poll the forward limit switch.ForwardLimitTypeValue
ForwardLimitType
Determines if the forward limit switch is normally-open (default) or normally-closed.boolean
ReverseLimitAutosetPositionEnable
If enabled, the position is automatically set to a specific value, specified by ReverseLimitAutosetPositionValue, when the reverse limit switch is asserted.double
ReverseLimitAutosetPositionValue
The value to automatically set the position to when the reverse limit switch is asserted.boolean
ReverseLimitEnable
If enabled, motor output is set to neutral when reverse limit switch is asseted and negative output is requested.int
ReverseLimitRemoteSensorID
Device ID of the remote device if using remote limit switch features for the reverse limit switch.ReverseLimitSourceValue
ReverseLimitSource
Determines where to poll the reverse limit switch.ReverseLimitTypeValue
ReverseLimitType
Determines if the reverse limit switch is normally-open (default) or normally-closed. -
Constructor Summary
Constructors Constructor Description HardwareLimitSwitchConfigs()
-
Method Summary
Modifier and Type Method Description StatusCode
deserialize(String to_deserialize)
String
serialize()
String
toString()
HardwareLimitSwitchConfigs
withForwardLimitAutosetPositionEnable(boolean newForwardLimitAutosetPositionEnable)
Modifies this configuration's ForwardLimitAutosetPositionEnable parameter and returns itself for method-chaining and easier to use config API.HardwareLimitSwitchConfigs
withForwardLimitAutosetPositionValue(double newForwardLimitAutosetPositionValue)
Modifies this configuration's ForwardLimitAutosetPositionValue parameter and returns itself for method-chaining and easier to use config API.HardwareLimitSwitchConfigs
withForwardLimitEnable(boolean newForwardLimitEnable)
Modifies this configuration's ForwardLimitEnable parameter and returns itself for method-chaining and easier to use config API.HardwareLimitSwitchConfigs
withForwardLimitRemoteCANcoder(CoreCANcoder device)
Helper method to configure this feedback group to use RemoteCANcoder forward limit switch by passing in the CANcoder object.HardwareLimitSwitchConfigs
withForwardLimitRemoteSensorID(int newForwardLimitRemoteSensorID)
Modifies this configuration's ForwardLimitRemoteSensorID parameter and returns itself for method-chaining and easier to use config API.HardwareLimitSwitchConfigs
withForwardLimitRemoteTalonFX(CoreTalonFX device)
Helper method to configure this feedback group to use RemoteTalonFX forward limit switch by passing in the TalonFX object.HardwareLimitSwitchConfigs
withForwardLimitSource(ForwardLimitSourceValue newForwardLimitSource)
Modifies this configuration's ForwardLimitSource parameter and returns itself for method-chaining and easier to use config API.HardwareLimitSwitchConfigs
withForwardLimitType(ForwardLimitTypeValue newForwardLimitType)
Modifies this configuration's ForwardLimitType parameter and returns itself for method-chaining and easier to use config API.HardwareLimitSwitchConfigs
withReverseLimitAutosetPositionEnable(boolean newReverseLimitAutosetPositionEnable)
Modifies this configuration's ReverseLimitAutosetPositionEnable parameter and returns itself for method-chaining and easier to use config API.HardwareLimitSwitchConfigs
withReverseLimitAutosetPositionValue(double newReverseLimitAutosetPositionValue)
Modifies this configuration's ReverseLimitAutosetPositionValue parameter and returns itself for method-chaining and easier to use config API.HardwareLimitSwitchConfigs
withReverseLimitEnable(boolean newReverseLimitEnable)
Modifies this configuration's ReverseLimitEnable parameter and returns itself for method-chaining and easier to use config API.HardwareLimitSwitchConfigs
withReverseLimitRemoteCANcoder(CoreCANcoder device)
Helper method to configure this feedback group to use RemoteCANcoder reverse limit switch by passing in the CANcoder object.HardwareLimitSwitchConfigs
withReverseLimitRemoteSensorID(int newReverseLimitRemoteSensorID)
Modifies this configuration's ReverseLimitRemoteSensorID parameter and returns itself for method-chaining and easier to use config API.HardwareLimitSwitchConfigs
withReverseLimitRemoteTalonFX(CoreTalonFX device)
Helper method to configure this feedback group to use RemoteTalonFX reverse limit switch by passing in the TalonFX object.HardwareLimitSwitchConfigs
withReverseLimitSource(ReverseLimitSourceValue newReverseLimitSource)
Modifies this configuration's ReverseLimitSource parameter and returns itself for method-chaining and easier to use config API.HardwareLimitSwitchConfigs
withReverseLimitType(ReverseLimitTypeValue newReverseLimitType)
Modifies this configuration's ReverseLimitType parameter and returns itself for method-chaining and easier to use config API.
-
Field Details
-
ForwardLimitType
Determines if the forward limit switch is normally-open (default) or normally-closed. -
ForwardLimitAutosetPositionEnable
If enabled, the position is automatically set to a specific value, specified by ForwardLimitAutosetPositionValue, when the forward limit switch is asserted.- Default Value: False
-
ForwardLimitAutosetPositionValue
The value to automatically set the position to when the forward limit switch is asserted. This has no effect if ForwardLimitAutosetPositionEnable is false.- Minimum Value: -3.4e+38
- Maximum Value: 3.4e+38
- Default Value: 0
- Units: rotations
-
ForwardLimitEnable
If enabled, motor output is set to neutral when the forward limit switch is asserted and positive output is requested.- Default Value: True
-
ForwardLimitSource
Determines where to poll the forward limit switch. This defaults to the forward limit switch pin on the limit switch connector.Choose RemoteTalonFX to use the forward limit switch attached to another Talon FX on the same CAN bus (this also requires setting ForwardLimitRemoteSensorID).
Choose RemoteCANifier to use the forward limit switch attached to another CANifier on the same CAN bus (this also requires setting ForwardLimitRemoteSensorID).
Choose RemoteCANcoder to use another CANcoder on the same CAN bus (this also requires setting ForwardLimitRemoteSensorID). The forward limit will assert when the CANcoder magnet strength changes from BAD (red) to ADEQUATE (orange) or GOOD (green).
-
ForwardLimitRemoteSensorID
Device ID of the remote device if using remote limit switch features for the forward limit switch.- Minimum Value: 0
- Maximum Value: 62
- Default Value: 0
- Units:
-
ReverseLimitType
Determines if the reverse limit switch is normally-open (default) or normally-closed. -
ReverseLimitAutosetPositionEnable
If enabled, the position is automatically set to a specific value, specified by ReverseLimitAutosetPositionValue, when the reverse limit switch is asserted.- Default Value: False
-
ReverseLimitAutosetPositionValue
The value to automatically set the position to when the reverse limit switch is asserted. This has no effect if ReverseLimitAutosetPositionEnable is false.- Minimum Value: -3.4e+38
- Maximum Value: 3.4e+38
- Default Value: 0
- Units: rotations
-
ReverseLimitEnable
If enabled, motor output is set to neutral when reverse limit switch is asseted and negative output is requested.- Default Value: True
-
ReverseLimitSource
Determines where to poll the reverse limit switch. This defaults to the reverse limit switch pin on the limit switch connector.Choose RemoteTalonFX to use the reverse limit switch attached to another Talon FX on the same CAN bus (this also requires setting ReverseLimitRemoteSensorID).
Choose RemoteCANifier to use the reverse limit switch attached to another CANifier on the same CAN bus (this also requires setting ReverseLimitRemoteSensorID).
Choose RemoteCANcoder to use another CANcoder on the same CAN bus (this also requires setting ReverseLimitRemoteSensorID). The reverse limit will assert when the CANcoder magnet strength changes from BAD (red) to ADEQUATE (orange) or GOOD (green).
-
ReverseLimitRemoteSensorID
Device ID of the remote device if using remote limit switch features for the reverse limit switch.- Minimum Value: 0
- Maximum Value: 62
- Default Value: 0
- Units:
-
-
Constructor Details
-
Method Details
-
withForwardLimitType
Modifies this configuration's ForwardLimitType parameter and returns itself for method-chaining and easier to use config API.Determines if the forward limit switch is normally-open (default) or normally-closed.
- Parameters:
newForwardLimitType
- Parameter to modify- Returns:
- Itself
-
withForwardLimitAutosetPositionEnable
public HardwareLimitSwitchConfigs withForwardLimitAutosetPositionEnable(boolean newForwardLimitAutosetPositionEnable)Modifies this configuration's ForwardLimitAutosetPositionEnable parameter and returns itself for method-chaining and easier to use config API.If enabled, the position is automatically set to a specific value, specified by ForwardLimitAutosetPositionValue, when the forward limit switch is asserted.
- Default Value: False
- Parameters:
newForwardLimitAutosetPositionEnable
- Parameter to modify- Returns:
- Itself
-
withForwardLimitAutosetPositionValue
public HardwareLimitSwitchConfigs withForwardLimitAutosetPositionValue(double newForwardLimitAutosetPositionValue)Modifies this configuration's ForwardLimitAutosetPositionValue parameter and returns itself for method-chaining and easier to use config API.The value to automatically set the position to when the forward limit switch is asserted. This has no effect if ForwardLimitAutosetPositionEnable is false.
- Minimum Value: -3.4e+38
- Maximum Value: 3.4e+38
- Default Value: 0
- Units: rotations
- Parameters:
newForwardLimitAutosetPositionValue
- Parameter to modify- Returns:
- Itself
-
withForwardLimitEnable
Modifies this configuration's ForwardLimitEnable parameter and returns itself for method-chaining and easier to use config API.If enabled, motor output is set to neutral when the forward limit switch is asserted and positive output is requested.
- Default Value: True
- Parameters:
newForwardLimitEnable
- Parameter to modify- Returns:
- Itself
-
withForwardLimitSource
public HardwareLimitSwitchConfigs withForwardLimitSource(ForwardLimitSourceValue newForwardLimitSource)Modifies this configuration's ForwardLimitSource parameter and returns itself for method-chaining and easier to use config API.Determines where to poll the forward limit switch. This defaults to the forward limit switch pin on the limit switch connector.
Choose RemoteTalonFX to use the forward limit switch attached to another Talon FX on the same CAN bus (this also requires setting ForwardLimitRemoteSensorID).
Choose RemoteCANifier to use the forward limit switch attached to another CANifier on the same CAN bus (this also requires setting ForwardLimitRemoteSensorID).
Choose RemoteCANcoder to use another CANcoder on the same CAN bus (this also requires setting ForwardLimitRemoteSensorID). The forward limit will assert when the CANcoder magnet strength changes from BAD (red) to ADEQUATE (orange) or GOOD (green).
- Parameters:
newForwardLimitSource
- Parameter to modify- Returns:
- Itself
-
withForwardLimitRemoteSensorID
public HardwareLimitSwitchConfigs withForwardLimitRemoteSensorID(int newForwardLimitRemoteSensorID)Modifies this configuration's ForwardLimitRemoteSensorID parameter and returns itself for method-chaining and easier to use config API.Device ID of the remote device if using remote limit switch features for the forward limit switch.
- Minimum Value: 0
- Maximum Value: 62
- Default Value: 0
- Units:
- Parameters:
newForwardLimitRemoteSensorID
- Parameter to modify- Returns:
- Itself
-
withReverseLimitType
Modifies this configuration's ReverseLimitType parameter and returns itself for method-chaining and easier to use config API.Determines if the reverse limit switch is normally-open (default) or normally-closed.
- Parameters:
newReverseLimitType
- Parameter to modify- Returns:
- Itself
-
withReverseLimitAutosetPositionEnable
public HardwareLimitSwitchConfigs withReverseLimitAutosetPositionEnable(boolean newReverseLimitAutosetPositionEnable)Modifies this configuration's ReverseLimitAutosetPositionEnable parameter and returns itself for method-chaining and easier to use config API.If enabled, the position is automatically set to a specific value, specified by ReverseLimitAutosetPositionValue, when the reverse limit switch is asserted.
- Default Value: False
- Parameters:
newReverseLimitAutosetPositionEnable
- Parameter to modify- Returns:
- Itself
-
withReverseLimitAutosetPositionValue
public HardwareLimitSwitchConfigs withReverseLimitAutosetPositionValue(double newReverseLimitAutosetPositionValue)Modifies this configuration's ReverseLimitAutosetPositionValue parameter and returns itself for method-chaining and easier to use config API.The value to automatically set the position to when the reverse limit switch is asserted. This has no effect if ReverseLimitAutosetPositionEnable is false.
- Minimum Value: -3.4e+38
- Maximum Value: 3.4e+38
- Default Value: 0
- Units: rotations
- Parameters:
newReverseLimitAutosetPositionValue
- Parameter to modify- Returns:
- Itself
-
withReverseLimitEnable
Modifies this configuration's ReverseLimitEnable parameter and returns itself for method-chaining and easier to use config API.If enabled, motor output is set to neutral when reverse limit switch is asseted and negative output is requested.
- Default Value: True
- Parameters:
newReverseLimitEnable
- Parameter to modify- Returns:
- Itself
-
withReverseLimitSource
public HardwareLimitSwitchConfigs withReverseLimitSource(ReverseLimitSourceValue newReverseLimitSource)Modifies this configuration's ReverseLimitSource parameter and returns itself for method-chaining and easier to use config API.Determines where to poll the reverse limit switch. This defaults to the reverse limit switch pin on the limit switch connector.
Choose RemoteTalonFX to use the reverse limit switch attached to another Talon FX on the same CAN bus (this also requires setting ReverseLimitRemoteSensorID).
Choose RemoteCANifier to use the reverse limit switch attached to another CANifier on the same CAN bus (this also requires setting ReverseLimitRemoteSensorID).
Choose RemoteCANcoder to use another CANcoder on the same CAN bus (this also requires setting ReverseLimitRemoteSensorID). The reverse limit will assert when the CANcoder magnet strength changes from BAD (red) to ADEQUATE (orange) or GOOD (green).
- Parameters:
newReverseLimitSource
- Parameter to modify- Returns:
- Itself
-
withReverseLimitRemoteSensorID
public HardwareLimitSwitchConfigs withReverseLimitRemoteSensorID(int newReverseLimitRemoteSensorID)Modifies this configuration's ReverseLimitRemoteSensorID parameter and returns itself for method-chaining and easier to use config API.Device ID of the remote device if using remote limit switch features for the reverse limit switch.
- Minimum Value: 0
- Maximum Value: 62
- Default Value: 0
- Units:
- Parameters:
newReverseLimitRemoteSensorID
- Parameter to modify- Returns:
- Itself
-
withForwardLimitRemoteTalonFX
Helper method to configure this feedback group to use RemoteTalonFX forward limit switch by passing in the TalonFX object. When using RemoteTalonFX, the Talon FX will use the forward limit switch attached to another Talon FX on the same CAN bus.- Parameters:
device
- TalonFX reference to use for RemoteTalonFX forward limit switch- Returns:
- Itself
-
withForwardLimitRemoteCANcoder
Helper method to configure this feedback group to use RemoteCANcoder forward limit switch by passing in the CANcoder object. When using RemoteCANcoder, the Talon FX will use another CANcoder on the same CAN bus. The forward limit will assert when the CANcoder magnet strength changes from BAD (red) to ADEQUATE (orange) or GOOD (green).- Parameters:
device
- CANcoder reference to use for RemoteCANcoder forward limit switch- Returns:
- Itself
-
withReverseLimitRemoteTalonFX
Helper method to configure this feedback group to use RemoteTalonFX reverse limit switch by passing in the TalonFX object. When using RemoteTalonFX, the Talon FX will use the reverse limit switch attached to another Talon FX on the same CAN bus.- Parameters:
device
- TalonFX reference to use for RemoteTalonFX reverse limit switch- Returns:
- Itself
-
withReverseLimitRemoteCANcoder
Helper method to configure this feedback group to use RemoteCANcoder reverse limit switch by passing in the CANcoder object. When using RemoteCANcoder, the Talon FX will use another CANcoder on the same CAN bus. The reverse limit will assert when the CANcoder magnet strength changes from BAD (red) to ADEQUATE (orange) or GOOD (green).- Parameters:
device
- CANcoder reference to use for RemoteCANcoder reverse limit switch- Returns:
- Itself
-
toString
-
deserialize
- Specified by:
deserialize
in interfaceParentConfiguration
-
serialize
- Specified by:
serialize
in interfaceISerializable
-