Class XRPMotor

java.lang.Object
edu.wpi.first.wpilibj.xrp.XRPMotor
All Implemented Interfaces:
MotorController

public class XRPMotor extends Object implements MotorController
XRPMotor.

A SimDevice based motor controller representing the motors on an XRP robot

  • Constructor Summary

    Constructors
    Constructor
    Description
    XRPMotor(int deviceNum)
    Constructs an XRPMotor.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    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

      public XRPMotor(int deviceNum)
      Constructs an XRPMotor.
      Parameters:
      deviceNum - the motor channel
  • Method Details

    • set

      public void set(double speed)
      Description copied from interface: MotorController
      Common interface for setting the speed of a motor controller.
      Specified by:
      set in interface MotorController
      Parameters:
      speed - The speed to set. Value should be between -1.0 and 1.0.
    • get

      public double get()
      Description copied from interface: MotorController
      Common interface for getting the current set speed of a motor controller.
      Specified by:
      get in interface MotorController
      Returns:
      The current set speed. Value is between -1.0 and 1.0.
    • setInverted

      public void setInverted(boolean isInverted)
      Description copied from interface: MotorController
      Common interface for inverting direction of a motor controller.
      Specified by:
      setInverted in interface MotorController
      Parameters:
      isInverted - The state of inversion true is inverted.
    • getInverted

      public boolean 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 interface MotorController
      Returns:
      isInverted The state of the inversion true is inverted.
    • disable

      public void disable()
      Description copied from interface: MotorController
      Disable the motor controller.
      Specified by:
      disable in interface MotorController
    • stopMotor

      public void 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 interface MotorController