LaunchCommand

class LaunchCommand(speed: DoubleSupplier, launch: BooleanSupplier, pivotAngle: DoubleSupplier, override: BooleanSupplier) : Command

Command to launch the note

Parameters

speed

a supplier that returns the desired speed of the flywheels

launch

a supplier that returns whether the note should be launched

pivotAngle

a supplier that returns the angle of the pivot

override

a supplier that returns whether the launch should be overridden

Constructors

Link copied to clipboard
constructor(speed: DoubleSupplier, launch: BooleanSupplier, pivotAngle: DoubleSupplier, override: BooleanSupplier)

Functions

Link copied to clipboard
open override fun end(interrupted: Boolean)

Stop the flywheels and the roller motor when the command is interrupted or canceled

Link copied to clipboard
open override fun execute()

Set the flywheels to the desired speed and the roller motor to push the note through the launcher. If the note trigger is pressed and the flywheels are at the desired speed, launch the note. Runs every 20ms

Link copied to clipboard
open override fun initialize()

Set the flywheels to coast mode so they have less resistance on the note. Reset the timer so it starts counting from 0 when the command is initialized.

Link copied to clipboard
open override fun isFinished(): Boolean

The command is finished when the note has been launched for 0.5 seconds