instance

The instance of the current BunyipsOpMode. This is set automatically by the BunyipsOpMode lifecycle. This can be used instead of dependency injection to access the current OpMode, as it is a singleton.

BunyipsComponent (and derivatives Task, BunyipsSubsystem, etc) internally use this to grant access to the current BunyipsOpMode through the opMode property.

If you choose to access the current OpMode through this property, you must ensure that the OpMode is actively running, otherwise this property will be null and you will raise a full-crashing exception.

Return

The instance of the current BunyipsOpMode.

Throws

If a BunyipsOpMode is not running, this exception will be raised.