Package edu.wpi.first.wpilibj.xrp
Class XRPMotor
java.lang.Object
edu.wpi.first.wpilibj.xrp.XRPMotor
- All Implemented Interfaces:
MotorController
XRPMotor.
A SimDevice based motor controller representing the motors on an XRP robot
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
disable()
Disable the motor controller.double
get()
Common interface for getting the current set speed of a motor controller.boolean
Common interface for returning if a motor controller is in the inverted state or not.void
set
(double speed) Common interface for setting the speed of a motor controller.void
setInverted
(boolean isInverted) Common interface for inverting direction of a motor controller.void
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.motorcontrol.MotorController
setVoltage, setVoltage
-
Constructor Details
-
XRPMotor
Constructs an XRPMotor.- Parameters:
deviceNum
- the motor channel
-
-
Method Details
-
set
Description copied from interface:MotorController
Common interface for setting the speed of a motor controller.- Specified by:
set
in interfaceMotorController
- Parameters:
speed
- The speed to set. Value should be between -1.0 and 1.0.
-
get
Description copied from interface:MotorController
Common interface for getting the current set speed of a motor controller.- Specified by:
get
in interfaceMotorController
- Returns:
- The current set speed. Value is between -1.0 and 1.0.
-
setInverted
Description copied from interface:MotorController
Common interface for inverting direction of a motor controller.- Specified by:
setInverted
in interfaceMotorController
- Parameters:
isInverted
- The state of inversion true is inverted.
-
getInverted
Description copied from interface:MotorController
Common interface for returning if a motor controller is in the inverted state or not.- Specified by:
getInverted
in interfaceMotorController
- Returns:
- isInverted The state of the inversion true is inverted.
-
disable
Description copied from interface:MotorController
Disable the motor controller.- Specified by:
disable
in interfaceMotorController
-
stopMotor
Description copied from interface:MotorController
Stops motor movement. Motor can be moved again by calling set without having to re-enable the motor.- Specified by:
stopMotor
in interfaceMotorController
-