Package com.crossbotics.ftchelper.core
Class InitStop
java.lang.Object
com.crossbotics.ftchelper.core.InitStop
A mistake found at INIT, shown as plain lines on the Driver Station. Without this, the FTC app shows
one red line that starts with Java words ("User code threw an uncaught exception: IllegalStateException
- ..."), and the real message is easy to miss. With it, the Driver Station shows:
INIT STOPPED: the robot did not start. Tunables.Lift has no max: write max (...) Fix it, then press INIT again. Press STOP now.and the OpMode waits (nothing moves) until STOP. A mistake after START is not caught: the FTC app shows it as before, after the OpMode has stopped every part. The robot log keeps the full error. Docs: docs/troubleshooting.md, "Driver Station errors"
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceThe OpMode's body, which may stop with an error. -
Method Summary
Modifier and TypeMethodDescriptionstatic voidrun(com.qualcomm.robotcore.eventloop.opmode.LinearOpMode op, InitStop.Body body) Runsbody.static booleanshowAndWait(com.qualcomm.robotcore.eventloop.opmode.LinearOpMode op, RuntimeException e) Showseas plain lines and waits until STOP (BLOCKS: on purpose, nothing else runs).static voidthrowInsteadOfShowing(boolean on) The simulator only: INIT errors stop the OpMode with the error, as before (its own panel shows it).static StringThe plain words for an error: the library's own messages as they are; anything else (a mistake in your own code) with its kind and where it happened, e.g.
-
Method Details
-
run
Runsbody. An error before START is shown as plain lines, and this waits for STOP. Any other error goes on as before. -
showAndWait
public static boolean showAndWait(com.qualcomm.robotcore.eventloop.opmode.LinearOpMode op, RuntimeException e) Showseas plain lines and waits until STOP (BLOCKS: on purpose, nothing else runs). Returns false (shows nothing) in the simulator, where the caller then throws it as before. -
words
The plain words for an error: the library's own messages as they are; anything else (a mistake in your own code) with its kind and where it happened, e.g. "NullPointerException in Robot.java line 42". -
throwInsteadOfShowing
public static void throwInsteadOfShowing(boolean on) The simulator only: INIT errors stop the OpMode with the error, as before (its own panel shows it).
-