Skip to content

Volt OpModes

OpModes in Volt are built on top of the VoltOpMode base class.

There are two main types of VoltOpMode: AutonomousModes and ManualModes.

The VoltOpMode class has the following properties:

  • hardwareMap: HardwareMap: Used to get hardware instances
  • telemetry: Telemetry: Used to log information to the driver station
  • gamepad1: Gamepad: Used to read input from the first gamepad
  • gamepad2: Gamepad: Used to read input from the second gamepad
  • blackboard: MutableMap<String, Any>: Used to store and share data across multiple OpModes

The purpose of a VoltOpMode is to determine when to trigger Actions. This goal is accomplished using Events.

In both AutonomousModes and ManualModes Events are defined using the then method:

Event then { /* Build an Action */ }

The then method pairs Events with a VoltActionBuilder. In this builder, you can build simple or complex sequences of Actions from the ones defined in your Attachments and Robots.

A VoltOpMode requires the VoltOpModeMeta annotation to determine how it appears on the Driver Station app.

The VoltOpModeMeta annotation has three parameters:

  • name: String: The only required parameter. Specifies the name that will appear on the Driver Station app.
  • group: String: Specifies the group that will appear on the Driver Station app. Defaults to OpModeMeta.DefaultGroup which shows up as ”$$$$$$$”.
  • autoTransition: String: Specifies the ManualMode that an AutonomousMode will automatically transition to on completion.