PreselectBehaviour

Declares how an Autonomous OpMode's preselectTeleOp is executed.

By default, the preselectTeleOp is simply selected on the Driver Station when the Auto OpMode ends. This annotation can be attached in combination with the Autonomous annotation with preselect in order to also initialise the OpMode and optionally start it after a set delay (default to 8 seconds to match with the standard FTC Auto-TeleOp interval), completely automatically to aid the drive team.

This annotation must be attached to an OpMode annotated with Autonomous, and the preselectTeleOp string must be non-empty and valid. This annotation otherwise does nothing.

It is also important to note that using preselection behaviour will ignore DS-level changes of the "Up Next" OpMode, as it is purely client-side.

Due to this client-side limitation, preselection also has a limited ability to know whether the OpMode terminated from the STOP button or through autonomous means, meaning that all preselected OpModes will initialise regardless. The minRuntimeSec option is designed to mitigate mis-initialisation for OpModes that end prematurely.

Author

Lucas Bubner, 2025

Since

8.1.0

Types

Link copied to clipboard
enum Action
The enhanced action to take for the preselected TeleOp.

Functions

Link copied to clipboard
When a preselected TeleOp is loaded, this action will immediately occur after it is selected on the Driver Station.
Link copied to clipboard
abstract fun minRuntimeSec(): Long
Safety timeout based on the runtime of the initial Autonomous OpMode to prevent auto-initialising TeleOp on Auto OpModes that have ended prematurely.
Link copied to clipboard
abstract fun startDelaySec(): Long
When using START, a delay of this many seconds will be induced in the interval between initialising and playing the OpMode.

Inherited functions

Link copied to clipboard
abstract fun annotationType(): Class<out Annotation>
Link copied to clipboard
abstract fun equals(p: Any): Boolean
Link copied to clipboard
abstract fun hashCode(): Int
Link copied to clipboard
abstract fun toString(): String