Package com.revrobotics.spark.config
Class SoftLimitConfig
java.lang.Object
com.revrobotics.spark.config.BaseConfig
com.revrobotics.spark.config.SoftLimitConfig
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionapply
(SoftLimitConfig config) Applies settings from anotherSoftLimitConfig
to this one.forwardSoftLimit
(double limit) Set the forward soft limit based on the position of the selected feedback sensor.forwardSoftLimitEnabled
(boolean enabled) Set whether to enable or disable the forward soft limit.reverseSoftLimit
(double limit) Set the reverse soft limit based on the position of the selected feedback sensor.reverseSoftLimitEnabled
(boolean enabled) Set whether to enable or disable the reverse soft limit.Methods inherited from class com.revrobotics.spark.config.BaseConfig
flatten
-
Constructor Details
-
SoftLimitConfig
public SoftLimitConfig()
-
-
Method Details
-
apply
Applies settings from anotherSoftLimitConfig
to this one.Settings in the provided config will overwrite existing values in this object. Settings not specified in the provided config remain unchanged.
- Parameters:
config
- TheSoftLimitConfig
to copy settings from- Returns:
- The updated
SoftLimitConfig
for method chaining
-
forwardSoftLimit
Set the forward soft limit based on the position of the selected feedback sensor. This will disable motor actuation in the forward direction past this position. This value should have the position conversion factor applied to it.- Parameters:
limit
- The forward soft limit position with the conversion factor applied- Returns:
- The modified
SoftLimitConfig
object for method chaining
-
forwardSoftLimitEnabled
Set whether to enable or disable the forward soft limit.- Parameters:
enabled
- True to enable the forward soft limit- Returns:
- The modified
SoftLimitConfig
object for method chaining
-
reverseSoftLimit
Set the reverse soft limit based on the position of the selected feedback sensor. This will disable motor actuation in the reverse direction past this position. This value should have the position conversion factor applied to it.- Parameters:
limit
- The reverse soft limit position with the conversion factor applied- Returns:
- The modified
SoftLimitConfig
object for method chaining
-
reverseSoftLimitEnabled
Set whether to enable or disable the reverse soft limit.- Parameters:
enabled
- True to enable the reverse soft limit- Returns:
- The modified
SoftLimitConfig
object for method chaining
-