Mechanism

interface Mechanism

Represents a subsystem or mechanism on the robot (e.g., an arm, drivetrain, or intake).

Mechanisms encapsulate the hardware interactions and provide a centralized place to manage periodic updates and default commands within the command-based architecture.

Properties

Link copied to clipboard
open val defaultCommand: Command

The default command that runs when this mechanism is not being controlled by a command.

Functions

Link copied to clipboard
open fun coroutine(body: suspend CommandScope.() -> Unit): CoroutineCommandBuilder

Creates a coroutine-based command that requires this mechanism.

Link copied to clipboard
open fun infinite(action: Runnable): CommandBuilder

Creates a command that runs indefinitely and requires this mechanism.

Link copied to clipboard
open fun instant(action: Runnable): CommandBuilder

Creates a command that runs once and requires this mechanism.

Link copied to clipboard
open fun periodic()

Called periodically during the OpMode loop. This is where you can update hardware reads, calculate state, or push telemetry.