Class MotorControllerGroup
java.lang.Object
edu.wpi.first.wpilibj.motorcontrol.MotorControllerGroup
- All Implemented Interfaces:
Sendable,MotorController,SpeedController,AutoCloseable
public class MotorControllerGroup extends Object implements MotorController, Sendable, AutoCloseable
Allows multiple
MotorController objects to be linked together.-
Constructor Summary
Constructors Constructor Description MotorControllerGroup(MotorController[] motorControllers)MotorControllerGroup(MotorController motorController, MotorController... motorControllers)Create a new MotorControllerGroup with the provided MotorControllers. -
Method Summary
Modifier and Type Method Description voidclose()voiddisable()Disable the motor controller.doubleget()Common interface for getting the current set speed of a motor controller.booleangetInverted()Common interface for returning if a motor controller is in the inverted state or not.voidinitSendable(SendableBuilder builder)Initializes thisSendableobject.voidset(double speed)Common interface for setting the speed of a motor controller.voidsetInverted(boolean isInverted)Common interface for inverting direction of a motor controller.voidstopMotor()Stops motor movement.
-
Constructor Details
-
MotorControllerGroup
Create a new MotorControllerGroup with the provided MotorControllers.- Parameters:
motorController- The first MotorController to addmotorControllers- The MotorControllers to add
-
MotorControllerGroup
-
-
Method Details
-
close
- Specified by:
closein interfaceAutoCloseable
-
set
Description copied from interface:MotorControllerCommon interface for setting the speed of a motor controller.- Specified by:
setin interfaceMotorController- Specified by:
setin interfaceSpeedController- Parameters:
speed- The speed to set. Value should be between -1.0 and 1.0.
-
get
Description copied from interface:MotorControllerCommon interface for getting the current set speed of a motor controller.- Specified by:
getin interfaceMotorController- Specified by:
getin interfaceSpeedController- Returns:
- The current set speed. Value is between -1.0 and 1.0.
-
setInverted
Description copied from interface:MotorControllerCommon interface for inverting direction of a motor controller.- Specified by:
setInvertedin interfaceMotorController- Specified by:
setInvertedin interfaceSpeedController- Parameters:
isInverted- The state of inversion true is inverted.
-
getInverted
Description copied from interface:MotorControllerCommon interface for returning if a motor controller is in the inverted state or not.- Specified by:
getInvertedin interfaceMotorController- Specified by:
getInvertedin interfaceSpeedController- Returns:
- isInverted The state of the inversion true is inverted.
-
disable
Description copied from interface:MotorControllerDisable the motor controller.- Specified by:
disablein interfaceMotorController- Specified by:
disablein interfaceSpeedController
-
stopMotor
Description copied from interface:MotorControllerStops motor movement. Motor can be moved again by calling set without having to re-enable the motor.- Specified by:
stopMotorin interfaceMotorController- Specified by:
stopMotorin interfaceSpeedController
-
initSendable
Description copied from interface:SendableInitializes thisSendableobject.- Specified by:
initSendablein interfaceSendable- Parameters:
builder- sendable builder
-