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 Summary
Modifier and TypeMethodDescriptionMotor controller driving the mechanism.org.wpilib.command2.SubsystemSubsystem the mechanism's commands should require.default org.wpilib.command2.Commandset(double dutycycle) Set the DutyCycle of theSmartMotorController.default org.wpilib.command2.CommandSet the DutyCycle of theSmartMotorController.default org.wpilib.command2.CommandsetVoltage(Supplier<org.wpilib.units.measure.Voltage> volts) Set the voltage of theSmartMotorController.default org.wpilib.command2.CommandsetVoltage(org.wpilib.units.measure.Voltage volts) Set the voltage of theSmartMotorController.
-
Method Details
-
getMotorController
SmartMotorController getMotorController()Motor controller driving the mechanism.- Returns:
SmartMotorControllerfor the mechanism.
-
getSubsystem
org.wpilib.command2.Subsystem getSubsystem()Subsystem the mechanism's commands should require.- Returns:
Subsystemfor the mechanism.
-
set
default org.wpilib.command2.Command set(double dutycycle) Set the DutyCycle of theSmartMotorController.- Parameters:
dutycycle- [-1,1] to set.- Returns:
Command
-
set
Set the DutyCycle of theSmartMotorController.- Parameters:
dutycycle- [-1,1] to set via aSupplier.- Returns:
Command
-
setVoltage
default org.wpilib.command2.Command setVoltage(org.wpilib.units.measure.Voltage volts) Set the voltage of theSmartMotorController.- Parameters:
volts-Voltageof theSmartMotorControllerto set.- Returns:
Command
-
setVoltage
Set the voltage of theSmartMotorController.- Parameters:
volts-Voltageof theSmartMotorControllerto set, via aSupplier.- Returns:
Command
-