Interface CommandMechanism

All Known Implementing Classes:
Arm, DifferentialMechanism, DoubleJointedArm, Elevator, FlyWheel, Pivot

public interface CommandMechanism
Shared duty-cycle/voltage Command factories for command-layer mechanisms.
  • Method Details

    • getMotorController

      SmartMotorController getMotorController()
      Motor controller driving the mechanism.
      Returns:
      SmartMotorController for the mechanism.
    • getSubsystem

      org.wpilib.command2.Subsystem getSubsystem()
      Subsystem the mechanism's commands should require.
      Returns:
      Subsystem for the mechanism.
    • set

      default org.wpilib.command2.Command set(double dutycycle)
      Set the DutyCycle of the SmartMotorController.
      Parameters:
      dutycycle - [-1,1] to set.
      Returns:
      Command
    • set

      default org.wpilib.command2.Command set(Supplier<Double> dutycycle)
      Set the DutyCycle of the SmartMotorController.
      Parameters:
      dutycycle - [-1,1] to set via a Supplier.
      Returns:
      Command
    • setVoltage

      default org.wpilib.command2.Command setVoltage(org.wpilib.units.measure.Voltage volts)
      Set the voltage of the SmartMotorController.
      Parameters:
      volts - Voltage of the SmartMotorController to set.
      Returns:
      Command
    • setVoltage

      default org.wpilib.command2.Command setVoltage(Supplier<org.wpilib.units.measure.Voltage> volts)
      Set the voltage of the SmartMotorController.
      Parameters:
      volts - Voltage of the SmartMotorController to set, via a Supplier.
      Returns:
      Command