Class NovelMotor

java.lang.Object
com.pocolifo.robobase.motor.NovelMotor

public class NovelMotor extends Object
  • Field Details

    • motor

      public final com.qualcomm.robotcore.hardware.DcMotorEx motor
    • ticksPerRevolution

      public final double ticksPerRevolution
    • wheelDiameterInches

      public final double wheelDiameterInches
    • gearRatio

      public final int gearRatio
  • Constructor Details

    • NovelMotor

      public NovelMotor(com.qualcomm.robotcore.hardware.DcMotorEx motor, double ticksPerRevolution, double wheelDiameterInches, int gearRatio)
  • Method Details

    • encoderTicksToInches

      public double encoderTicksToInches(double ticks)
    • inchesToEncoderTicks

      public double inchesToEncoderTicks(double inches)
    • getMotorRotations

      public double getMotorRotations()
      gets the number of motor rotations
    • setTargetPositionInches

      public void setTargetPositionInches(double centimeters)
      Sets the target position in centimeters instead of motor ticks
      Parameters:
      centimeters - How far the motor should move, in centimeters. Negative values move the wheel in reverse, and positive values move the wheel forward.
    • setPower

      public void setPower(double power)
    • setZeroPowerBehavior

      public void setZeroPowerBehavior(com.qualcomm.robotcore.hardware.DcMotor.ZeroPowerBehavior behavior)
    • inchesPerSecondToEncoderTicksPerSecond

      public static double inchesPerSecondToEncoderTicksPerSecond(double diameterIn, double ticksPerRevolution, double inchesPerSecond)
    • encoderTicksPerSecondToInchesPerSecond

      public static double encoderTicksPerSecondToInchesPerSecond(double diameterIn, double ticksPerRevolution, double encoderTicksPerSecond)
    • setVelocity

      public void setVelocity(double inchesPerSecond)
    • getEncoderInches

      public double getEncoderInches()
    • getVelocity

      public double getVelocity()
      Returns:
      The linear velocity in inches/second.