Package com.crossbotics.ftchelper.robot
Class EncoderMotor
java.lang.Object
com.crossbotics.ftchelper.robot.EncoderMotor
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
FieldsModifier and TypeFieldDescriptionfinal booleanTrue if the library reads this encoder (a lift, an arm, a flywheel, a motor turret or hood, a drive without odometry).final StringThe motor's configuration name, e.g.final StringThe part it belongs to, e.g.final booleanTrue if Robot.java turns it the other way (reversed). -
Method Summary
Modifier and TypeMethodDescriptionThe motors that get the same power at the same moment (pushed together with it), maybe none.booleanalsoReversed(int i) True if that motor (one ofalsoMotors()) turns the other way in Robot.java.booleanTrue if its part isoptional()in Robot.java (not in the configuration = fine).intpushSign()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.skip()Why the check skips this motor ("" = it is checked), e.g.toString()
-
Field Details
-
name
The motor's configuration name, e.g. "lift_left". Its encoder cable must be in this motor's port. -
reversed
public final boolean reversedTrue if Robot.java turns it the other way (reversed). -
part
The part it belongs to, e.g. "Lift" or "drive" (for the screen). -
encoderRead
public final boolean encoderReadTrue 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
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 isoptional()in Robot.java (not in the configuration = fine). -
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 ofalsoMotors()) turns the other way in Robot.java.- Parameters:
i- its place inalsoMotors(), from 0- Returns:
- true if it is reversed
-
toString
-