Interface AngleDevice
- All Superinterfaces:
Subsystem
- All Known Implementing Classes:
PositionServo
Anything that goes to an angle and can say when it is there: a servo with degrees set up
(
PositionServo), a launcher's hood on a servo or a motor with an encoder
(robot.Hood), or your own part (a CR servo with an absolute encoder). A launcher's hood is one
of these, so the launcher does not care what moves it.
public class MyHood implements AngleDevice {
public void setDegrees(double deg) { ... } // start moving there (never wait)
public double getTargetDegrees() { ... } // where it is going (NaN = never sent)
public boolean isDone() { ... } // there (by a sensor, or a time estimate)
public void update() { ... } // every loop
}
launcher.hood(new MyHood(...));
"Angle" is the device's own scale: degrees if you measured them, or plain servo positions or encoder ticks if you did not (then a shot table's hood column holds those). Docs: docs/modules/mechanism.md
-
Method Summary
Modifier and TypeMethodDescriptiondoubleThe angle it is going to (after its limits), or NaN before the first command.booleanisDone()True when it is (or, without a sensor, should be) at its target.voidsetDegrees(double degrees) Starts moving to this angle (kept inside its limits).Methods inherited from interface com.crossbotics.ftchelper.core.Subsystem
addTelemetry, name, stop, update
-
Method Details
-
setDegrees
void setDegrees(double degrees) Starts moving to this angle (kept inside its limits). Quick: never waits. -
getTargetDegrees
double getTargetDegrees()The angle it is going to (after its limits), or NaN before the first command. -
isDone
boolean isDone()True when it is (or, without a sensor, should be) at its target.
-