Package com.crossbotics.ftchelper.robot
Class Parts.ServoPart
java.lang.Object
com.crossbotics.ftchelper.robot.Parts.ServoPart
- Enclosing class:
Parts
One servo: how far it turns and over which pulse. The FTC SDK sends 600 to 2400 microseconds for
positions 0 to 1 unless the code asks for its full range (
.fullRange()), so a servo that
turns 300 degrees over 500-2500 us turns 270 over 0 to 1 on a normal hub (sdkRangeDeg()).-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal booleanTrue for a servo described in Robot.java (Parts.customServo(java.lang.String, double, double)), not from the catalog.final StringThe parts catalog id, e.g.final doubleThe seller's pulse range, microseconds; NaN = not given (then 500 to 2500 is assumed).final doubleThe seller's pulse range, microseconds; NaN = not given (then 500 to 2500 is assumed).final doubleThe seller's full turn, degrees, overpulseMinUstopulseMaxUs; NaN = not given.final doubleSeconds to turn 60 degrees with no load at about the hub's servo voltage (a REV hub gives its servos 5 V): the seller's 4.8 V number, or its 6 V one when it gives no 4.8 V number (then the real servo is a little slower). -
Method Summary
Modifier and TypeMethodDescriptiondoubledegreesOver(double lowUs, double highUs) How far positions 0 to 1 turn it with this pulse range.doubleDegrees per microsecond of pulse (goBILDA 2000: 0.15); NaN when the range is not given.doubleThe pulse for position 1 with full range: the seller's, or 2500 us when it gives none.doubleThe pulse for position 0 with full range: the seller's, or 500 us when it gives none.doublefullMoveSec(boolean fullRange) About how long a move from position 0 to 1 takes on a hub, from the seller's speed: a starting value for a part'stravelSec(goBILDA 2000 torque on the normal range: 270 degrees at 0.25 s per 60 = 1.13 s).doubleDegrees over 0 to 1 with the SDK's normal 600-2400 us (goBILDA 2000: 270).simWords(double lowUs, double highUs) The words for the simulator's robot file:part=IDfor a catalog servo; for a custom one its turn over the file's pulse range and its speed (rangeDeg=270, secPer60=0.2), "" when those are not known.
-
Field Details
-
id
The parts catalog id, e.g. "gobilda-2000-speed". -
rangeDeg
public final double rangeDegThe seller's full turn, degrees, overpulseMinUstopulseMaxUs; NaN = not given. -
pulseMinUs
public final double pulseMinUsThe seller's pulse range, microseconds; NaN = not given (then 500 to 2500 is assumed). -
pulseMaxUs
public final double pulseMaxUsThe seller's pulse range, microseconds; NaN = not given (then 500 to 2500 is assumed). -
secPer60Deg
public final double secPer60DegSeconds to turn 60 degrees with no load at about the hub's servo voltage (a REV hub gives its servos 5 V): the seller's 4.8 V number, or its 6 V one when it gives no 4.8 V number (then the real servo is a little slower). -
custom
public final boolean customTrue for a servo described in Robot.java (Parts.customServo(java.lang.String, double, double)), not from the catalog.
-
-
Method Details
-
fullMoveSec
public double fullMoveSec(boolean fullRange) About how long a move from position 0 to 1 takes on a hub, from the seller's speed: a starting value for a part'stravelSec(goBILDA 2000 torque on the normal range: 270 degrees at 0.25 s per 60 = 1.13 s).- Parameters:
fullRange- true with.fullRange()(0 to 1 is the servo's whole turn)- Returns:
- seconds, or NaN when the catalog lacks the servo's turn or speed
-
simWords
The words for the simulator's robot file:part=IDfor a catalog servo; for a custom one its turn over the file's pulse range and its speed (rangeDeg=270, secPer60=0.2), "" when those are not known.- Parameters:
lowUs- the pulse at position 0 in the robot file (600 normally, 500 with full range)highUs- the pulse at position 1
-
fullLowUs
public double fullLowUs()The pulse for position 0 with full range: the seller's, or 500 us when it gives none. -
fullHighUs
public double fullHighUs()The pulse for position 1 with full range: the seller's, or 2500 us when it gives none. -
degreesPerMicrosecond
public double degreesPerMicrosecond()Degrees per microsecond of pulse (goBILDA 2000: 0.15); NaN when the range is not given. -
degreesOver
public double degreesOver(double lowUs, double highUs) How far positions 0 to 1 turn it with this pulse range.- Parameters:
lowUs- microseconds at position 0highUs- microseconds at position 1- Returns:
- degrees (NaN when the range is not given)
-
sdkRangeDeg
public double sdkRangeDeg()Degrees over 0 to 1 with the SDK's normal 600-2400 us (goBILDA 2000: 270).
-