Package frclib.motor
Class FrcServoActuator.Params
java.lang.Object
frclib.motor.FrcServoActuator.Params
- Enclosing class:
- FrcServoActuator
This class contains all the parameters for creating the servo.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionsetFollowerServo
(String name, int channel, boolean inverted) This methods sets the parameter of the follower servo.setLogicalPosRange
(double minPos, double maxPos) This method sets the logical position range of the servo in the range of 0.0 to 1.0.setMaxStepRate
(double maxStepRate) This method sets the maximum stepping rate of the servo.setPhysicalPosRange
(double minPos, double maxPos) This method sets the physical position range of the servo in real world physical unit.setPositionPresets
(double tolerance, double... posPresets) This method sets an array of preset positions for the servo actuator.setPrimaryServo
(String name, int channel, boolean inverted) This methods sets the parameters of the primary servo.toString()
This method returns the string format of the servoParams info.
-
Constructor Details
-
Params
public Params()
-
-
Method Details
-
toString
This method returns the string format of the servoParams info. -
setPrimaryServo
This methods sets the parameters of the primary servo.- Parameters:
name
- specifies the name of the servo.channel
- specifies the PWM channel for the servo.inverted
- specifies true if the servo is inverted, false otherwise.- Returns:
- this object for chaining.
-
setFollowerServo
This methods sets the parameter of the follower servo.- Parameters:
name
- specifies the name of the servo.channel
- specifies the PWM channel for the servo.inverted
- specifies true if the servo is inverted, false otherwise.- Returns:
- this object for chaining.
-
setPhysicalPosRange
This method sets the physical position range of the servo in real world physical unit.- Parameters:
minPos
- specifies the min physical position.maxPos
- specifies the max physical position.- Returns:
- this object for chaining.
-
setLogicalPosRange
This method sets the logical position range of the servo in the range of 0.0 to 1.0.- Parameters:
minPos
- specifies the min logical position.maxPos
- specifies the max logical position.- Returns:
- this object for chaining.
-
setMaxStepRate
This method sets the maximum stepping rate of the servo. This enables setPower to speed control the servo.- Parameters:
maxStepRate
- specifies the maximum stepping rate (physicalPos/sec).- Returns:
- this parameter object.
-
setPositionPresets
This method sets an array of preset positions for the servo actuator.- Parameters:
tolerance
- specifies the preset tolerance.posPresets
- specifies an array of preset positions in scaled unit.- Returns:
- this object for chaining.
-