Package me.nabdev.oxconfig.sampleClasses
Class ConfigurableSparkClosedLoop
java.lang.Object
me.nabdev.oxconfig.sampleClasses.ConfigurableSparkClosedLoop
- All Implemented Interfaces:
ConfigurableClass
A configurable spark max PID controller.
This class is an example of how to use the ConfigurableClass interface, but
is safe for competition use.
-
Constructor Summary
ConstructorsConstructorDescriptionConfigurableSparkClosedLoop
(com.revrobotics.spark.config.SparkBaseConfig config, com.revrobotics.spark.config.SparkBaseConfigAccessor accessor, com.revrobotics.spark.SparkBase controller, String key) Sets up a spark max PID controller to be autoconfigured.ConfigurableSparkClosedLoop
(com.revrobotics.spark.config.SparkBaseConfig config, com.revrobotics.spark.config.SparkBaseConfigAccessor accessor, com.revrobotics.spark.SparkBase controller, String key, String prettyName) Sets up a spark max PID controller to be autoconfigured. -
Method Summary
Modifier and TypeMethodDescriptiongetKey()
Gets the key of the configurable class (e.g.Gets the parameters of the configurable classGets the pretty name of the configurable class (e.g.
-
Constructor Details
-
ConfigurableSparkClosedLoop
public ConfigurableSparkClosedLoop(com.revrobotics.spark.config.SparkBaseConfig config, com.revrobotics.spark.config.SparkBaseConfigAccessor accessor, com.revrobotics.spark.SparkBase controller, String key) Sets up a spark max PID controller to be autoconfigured. If you would like to use default values, set them before creating this- Parameters:
config
- The config object for the controlleraccessor
- The accessor for the config objectcontroller
- The controller to be configuredkey
- The json key for the controller to be stored in
-
ConfigurableSparkClosedLoop
public ConfigurableSparkClosedLoop(com.revrobotics.spark.config.SparkBaseConfig config, com.revrobotics.spark.config.SparkBaseConfigAccessor accessor, com.revrobotics.spark.SparkBase controller, String key, String prettyName) Sets up a spark max PID controller to be autoconfigured. If you would like to use default values, set them before creating this- Parameters:
config
- The config object for the controlleraccessor
- The accessor for the config objectcontroller
- The controller to be configuredkey
- The json key for the controller to be stored inprettyName
- The display name of this controller
-
-
Method Details
-
getParameters
Description copied from interface:ConfigurableClass
Gets the parameters of the configurable class- Specified by:
getParameters
in interfaceConfigurableClass
- Returns:
- The parameters of the configurable class
-
getKey
Description copied from interface:ConfigurableClass
Gets the key of the configurable class (e.g. "Arm"), must not include commas- Specified by:
getKey
in interfaceConfigurableClass
- Returns:
- The key of the configurable class
-
getPrettyName
Description copied from interface:ConfigurableClass
Gets the pretty name of the configurable class (e.g. "Arm")- Specified by:
getPrettyName
in interfaceConfigurableClass
- Returns:
- The pretty name of the configurable class
-