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 TypeMethodDescriptionorg.wpilib.command3.MechanismMechanism the mechanism's commands should require.Motor controller driving the mechanism.default org.wpilib.command3.Commandset(double dutycycle) Set the DutyCycle of theSmartMotorController.default org.wpilib.command3.CommandSet the DutyCycle of theSmartMotorController.default org.wpilib.command3.CommandsetVoltage(Supplier<org.wpilib.units.measure.Voltage> volts) Set the voltage of theSmartMotorController.default org.wpilib.command3.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.
-
getMechanism
org.wpilib.command3.Mechanism getMechanism()Mechanism the mechanism's commands should require.- Returns:
Mechanismfor the mechanism.
-
set
default org.wpilib.command3.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.command3.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
-