Package com.crossbotics.ftchelper.auto
Class PathEvent
java.lang.Object
com.crossbotics.ftchelper.auto.PathEvent
Something to do once while a path or a
driveTo runs, when the robot gets to a place along
it: "spin up the launcher 12 in before the end". The robot layer's PathAt makes these for
you (PathAt.inchesLeft(12, "Spin up", robot.launcher::spinUp)); this is the plain form
that AutoRoutine.followPath(String, PathJob, double, java.util.List) checks every loop.
- Each event fires once. Every loop the routine checks the events in the order you wrote them, so two that are reached in the same loop fire in that order.
- When the path gets to its end, every event that is reached at the end fires then (a path follower may stop a little short of the end: "1 in left" still fires).
- When the path ends early (timed out, STALLED, NO_ODOMETRY, cut short), the report lists the
events that did not fire:
To the goal: STALLED, not fired: Spin up.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classWhere the robot is along the path, worked out every loop (read-only). -
Constructor Summary
ConstructorsConstructorDescriptionPathEvent(String name, Predicate<PathEvent.Progress> reached, Runnable action) -
Method Summary
-
Constructor Details
-
PathEvent
- Parameters:
name- for the report, e.g. "Spin up"reached- true once the robot is far enough along (checked every loop until it fires)action- what to do, once (it must not wait: start things, like arunstep)
-
-
Method Details
-
name
The name given, for the report.
-