Class EncoderMotor

java.lang.Object
com.crossbotics.ftchelper.robot.EncoderMotor

public final class EncoderMotor extends Object
One motor of your robot as the Encoder Check sees it: its name, the direction Robot.java gives it, which way to push it, the motors that always get the same power (a lift's second motor), and whether the library reads its encoder. RobotDefinition.encoderMotors() makes the list; you do not make these yourself.

Why the direction: the check pushes each motor set up as Robot.java sets it up, toward the side where the part has room (pushSign(): a lift up from its bottom stop), and its count must move that way too. Docs: docs/reference/robot-java.md. Guide: docs/tuning/02-wiring-checks.md, "Encoder Check"

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final boolean
    True if the library reads this encoder (a lift, an arm, a flywheel, a motor turret or hood, a drive without odometry).
    final String
    The motor's configuration name, e.g.
    final String
    The part it belongs to, e.g.
    final boolean
    True if Robot.java turns it the other way (reversed).
  • Method Summary

    Modifier and Type
    Method
    Description
    The motors that get the same power at the same moment (pushed together with it), maybe none.
    boolean
    alsoReversed(int i)
    True if that motor (one of alsoMotors()) turns the other way in Robot.java.
    boolean
    True if its part is optional() in Robot.java (not in the configuration = fine).
    int
    Which way the check pushes it: +1 = positive power (a lift up from its bottom stop), -1 = negative power (a part whose whole range is below where it starts, e.g.
    Why the check skips this motor ("" = it is checked), e.g.
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • name

      public final String name
      The motor's configuration name, e.g. "lift_left". Its encoder cable must be in this motor's port.
    • reversed

      public final boolean reversed
      True if Robot.java turns it the other way (reversed).
    • part

      public final String part
      The part it belongs to, e.g. "Lift" or "drive" (for the screen).
    • encoderRead

      public final boolean encoderRead
      True if the library reads this encoder (a lift, an arm, a flywheel, a motor turret or hood, a drive without odometry). False: nothing needs it (an intake roller), so "no counts" is fine there.
  • Method Details

    • pushSign

      public int pushSign()
      Which way the check pushes it: +1 = positive power (a lift up from its bottom stop), -1 = negative power (a part whose whole range is below where it starts, e.g. a hood whose other stop is at negative ticks).
    • skip

      public String skip()
      Why the check skips this motor ("" = it is checked), e.g. its port reads an odometry pod.
    • isOptional

      public boolean isOptional()
      True if its part is optional() in Robot.java (not in the configuration = fine).
    • alsoMotors

      public List<String> alsoMotors()
      The motors that get the same power at the same moment (pushed together with it), maybe none.
    • alsoReversed

      public boolean alsoReversed(int i)
      True if that motor (one of alsoMotors()) turns the other way in Robot.java.
      Parameters:
      i - its place in alsoMotors(), from 0
      Returns:
      true if it is reversed
    • toString

      public String toString()
      Overrides:
      toString in class Object