CommandManager

This is the central controller for running commands in NextFTC.

Properties

Link copied to clipboard

Actively running commands.

Functions

Link copied to clipboard
fun cancelAll()

Cancels every command. This function should generally only be used when an OpMode ends.

Link copied to clipboard
fun cancelCommand(command: Command)
Link copied to clipboard

Cancels every command in the commandsToCancel list.

Link copied to clipboard

Given a set of subsystems (including groups), this extracts the subsystems from within those groups and returns the set of the subsystems in the set plus the subsystems that are children of the groups (if any).

Link copied to clipboard
Link copied to clipboard

Returns whether or not there are commands running

Link copied to clipboard
Link copied to clipboard
fun run()

This function should be run repeatedly every loop. It adds commands if the corresponding Gamepad buttons are being pushed, it runs the periodic functions in Subsystems, it schedules & cancels any commands that need to be started or stopped, and it executes running commands. The reason why it uses a separate function to cancel commands instead of cancelling them itself is because removing items from a list while iterating through that list is a wacky idea.

Link copied to clipboard
fun scheduleCommand(command: Command)

Schedules a command. When multiple commands are scheduled, each of them run in parallel.

Link copied to clipboard

Initializes every command in the commandsToSchedule list.