Package edu.wpi.first.wpilibj
Class SpeedControllerGroup
- java.lang.Object
-
- edu.wpi.first.wpilibj.SpeedControllerGroup
-
- All Implemented Interfaces:
PIDOutput,Sendable,SpeedController,AutoCloseable
public class SpeedControllerGroup extends Object implements SpeedController, Sendable, AutoCloseable
Allows multipleSpeedControllerobjects to be linked together.
-
-
Constructor Summary
Constructors Constructor Description SpeedControllerGroup(SpeedController speedController, SpeedController... speedControllers)Create a new SpeedControllerGroup with the provided SpeedControllers.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voiddisable()Disable the speed controller.doubleget()Common interface for getting the current set speed of a speed controller.booleangetInverted()Common interface for returning if a speed controller is in the inverted state or not.voidinitSendable(SendableBuilder builder)Initializes thisSendableobject.voidpidWrite(double output)Set the output to the value calculated by PIDController.voidset(double speed)Common interface for setting the speed of a speed controller.voidsetInverted(boolean isInverted)Common interface for inverting direction of a speed controller.voidstopMotor()Stops motor movement.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface edu.wpi.first.wpilibj.Sendable
addChild, getName, getSubsystem, setName, setName, setName, setName, setSubsystem
-
Methods inherited from interface edu.wpi.first.wpilibj.SpeedController
setVoltage
-
-
-
-
Constructor Detail
-
SpeedControllerGroup
public SpeedControllerGroup(SpeedController speedController, SpeedController... speedControllers)
Create a new SpeedControllerGroup with the provided SpeedControllers.- Parameters:
speedControllers- The SpeedControllers to add
-
-
Method Detail
-
close
public void close()
- Specified by:
closein interfaceAutoCloseable
-
set
public void set(double speed)
Description copied from interface:SpeedControllerCommon interface for setting the speed of a speed controller.- Specified by:
setin interfaceSpeedController- Parameters:
speed- The speed to set. Value should be between -1.0 and 1.0.
-
get
public double get()
Description copied from interface:SpeedControllerCommon interface for getting the current set speed of a speed controller.- Specified by:
getin interfaceSpeedController- Returns:
- The current set speed. Value is between -1.0 and 1.0.
-
setInverted
public void setInverted(boolean isInverted)
Description copied from interface:SpeedControllerCommon interface for inverting direction of a speed controller.- Specified by:
setInvertedin interfaceSpeedController- Parameters:
isInverted- The state of inversion true is inverted.
-
getInverted
public boolean getInverted()
Description copied from interface:SpeedControllerCommon interface for returning if a speed controller is in the inverted state or not.- Specified by:
getInvertedin interfaceSpeedController- Returns:
- isInverted The state of the inversion true is inverted.
-
disable
public void disable()
Description copied from interface:SpeedControllerDisable the speed controller.- Specified by:
disablein interfaceSpeedController
-
stopMotor
public void stopMotor()
Description copied from interface:SpeedControllerStops motor movement. Motor can be moved again by calling set without having to re-enable the motor.- Specified by:
stopMotorin interfaceSpeedController
-
pidWrite
public void pidWrite(double output)
Description copied from interface:PIDOutputSet the output to the value calculated by PIDController.
-
initSendable
public void initSendable(SendableBuilder builder)
Description copied from interface:SendableInitializes thisSendableobject.- Specified by:
initSendablein interfaceSendable- Parameters:
builder- sendable builder
-
-