setInitTask

Set a task that will run as an init-task. This will run after your onInit has completed, allowing you to initialise hardware first. This is an optional method, and runs alongside onInitLoop.

You should store any running variables inside the task itself, and keep the instance of the task defined as a field in your OpMode. You can then use this value in your onInitDone to do what you need to after the init-task has finished. This method should be paired with onInitDone to do anything after the initTask has finished.

If you do not define an initTask, then running it during the dynamic_init phase will be skipped. Note that there can only be one init-task set. Consider a task group for multiple operations.

See also