Package trclib.motor
Class TrcServo.Params
java.lang.Object
trclib.motor.TrcServo.Params
- Enclosing class:
- TrcServo
-
Field Summary
FieldsModifier and TypeFieldDescriptiondouble
double
double
double
double[]
double
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionsetLogicalPosRange
(double logicalMin, double logicalMax) This method sets the logical range of the servo motor.setMaxStepRate
(double maxStepRate) This method sets the maximum stepping rate of the servo.setPhysicalPosRange
(double physicalMin, double physicalMax) This method sets the physical range of the servo motor.setPosPresets
(double tolerance, double... posPresets) This method sets an array of preset positions for the servo.toString()
This method returns the string format of the servoParams info.
-
Field Details
-
logicalMin
public double logicalMin -
logicalMax
public double logicalMax -
physicalMin
public double physicalMin -
physicalMax
public double physicalMax -
maxStepRate
-
presetTolerance
public double presetTolerance -
posPresets
public double[] posPresets
-
-
Constructor Details
-
Params
public Params()
-
-
Method Details
-
toString
This method returns the string format of the servoParams info. -
setLogicalPosRange
This method sets the logical range of the servo motor. This is typically used to limit the logical range of the servo to less than the 0.0 to 1.0 range. For example, one may limit the logical range to 0.2 to 0.8.- Parameters:
logicalMin
- specifies the minimum value of the logical range.logicalMax
- specifies the maximum value of the logical range.- Returns:
- this object for chaining.
-
setPhysicalPosRange
This method sets the physical range of the servo motor. This is typically used to set a 180-degree servo to have a range of 0.0 to 180.0 instead of the logical range of 0.0 to 1.0. By default physical range is set to the range of 0.0 to 1.0, same as logical range. The physical range is used for map physical position units to logical position unit between 0.0 to 1.0.- Parameters:
physicalMin
- specifies the minimum value of the physical range.physicalMax
- specifies the maximum value of the physical range.- 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 object for chaining.
-
setPosPresets
This method sets an array of preset positions for the servo.- Parameters:
tolerance
- specifies the preset tolerance.posPresets
- specifies an array of preset positions in scaled unit.- Returns:
- this object for chaining.
-