Package trclib.subsystem
Class TrcDifferentialServoWrist.Params
java.lang.Object
trclib.subsystem.TrcDifferentialServoWrist.Params
- Enclosing class:
- TrcDifferentialServoWrist
This class contains all the parameters of the Differential Servo Wrist.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionsetMaxStepRate
(double maxStepRate) This method sets the maximum speed of the servo.setPositionLimits
(double tiltPosLowLimit, double tiltPosHighLimit, double rotatePosLowLimit, double rotatePosHighLimit) This method sets the tilt and rotate position limits.setPosPresets
(double presetTolerance, double[] tiltPosPresets, double[] rotatePosPresets) This method sets the position preset parameters for both tilt and rotate.setPosRange
(double logicalMin, double logicalMax, double physicalRange, double tiltOffset, double rotateOffset) This method sets the physical tilt and rotate position range of the wrist.This methods sets the parameters of servo 1.toString()
This method returns the string format of the Params info.
-
Field Details
-
servo1
-
servo2
-
logicalMin
private double logicalMin -
logicalMax
private double logicalMax -
physicalPosRange
private double physicalPosRange -
tiltPosOffset
private double tiltPosOffset -
rotatePosOffset
private double rotatePosOffset -
maxStepRate
private double maxStepRate -
tiltPosLowLimit
private double tiltPosLowLimit -
tiltPosHighLimit
private double tiltPosHighLimit -
rotatePosLowLimit
private double rotatePosLowLimit -
rotatePosHighLimit
private double rotatePosHighLimit -
presetTolerance
private double presetTolerance -
tiltPosPresets
private double[] tiltPosPresets -
rotatePosPresets
private double[] rotatePosPresets
-
-
Constructor Details
-
Params
public Params()
-
-
Method Details
-
toString
This method returns the string format of the Params info. -
setServos
This methods sets the parameters of servo 1.- Parameters:
servo1
- specifies the servo1 object.servo2
- specifies the servo2 object.- Returns:
- this object for chaining.
-
setPosRange
public TrcDifferentialServoWrist.Params setPosRange(double logicalMin, double logicalMax, double physicalRange, double tiltOffset, double rotateOffset) This method sets the physical tilt and rotate position range of the wrist. Because of the nature of differential wrist, tilt position range must be the same as rotate range.- Parameters:
logicalMin
- specifies the logical minimum value of the servos. Typically 0.0.logicalMax
- specifies the logical maximum value of the servos. Typically 1.0.physicalRange
- specifies the physical position range, typically the servo movement range in degrees. For example, for 180-degree servo, physicalPosRange will be 180.0.tiltOffset
- specifies the tilt position offset. This is the offset from physical zero position to the tilt range center position. For example, if the tilt range center is 45 degrees below physical zero position, tiltPosOffset will be -45.0.rotateOffset
- specifies the rotate position offset. This is the offset from physical zero position to the rotate range center position. For example, if the rotate range center is exactly physical zero position, rotatePosOffset will be 0.0.- Returns:
- this object for chaining.
-
setMaxStepRate
This method sets the maximum speed of the servo.- Parameters:
maxStepRate
- specifies the maximum speed of the servo in degrees per second.- Returns:
- this object for chaining.
-
setPositionLimits
public TrcDifferentialServoWrist.Params setPositionLimits(double tiltPosLowLimit, double tiltPosHighLimit, double rotatePosLowLimit, double rotatePosHighLimit) This method sets the tilt and rotate position limits.- Parameters:
tiltPosLowLimit
- specifies the tilt position low limit in physical unit.tiltPosHighLimit
- specifies the tilt position high limit in physical unit.rotatePosLowLimit
- specifies the rotate position low limit in physical unit.rotatePosHighLimit
- specifies the rotate position high limit in physical unit.- Returns:
- this object for chaining.
-
setPosPresets
public TrcDifferentialServoWrist.Params setPosPresets(double presetTolerance, double[] tiltPosPresets, double[] rotatePosPresets) This method sets the position preset parameters for both tilt and rotate.- Parameters:
presetTolerance
- specifies the preset tolerance.tiltPosPresets
- specifies the tilt position preset array.rotatePosPresets
- specifies the rotate position preset array.- Returns:
- this object for chaining.
-