Package ftclib.motor

Class FtcMotorActuator.Params

java.lang.Object
ftclib.motor.FtcMotorActuator.Params
Enclosing class:
FtcMotorActuator

public static class FtcMotorActuator.Params extends Object
This class contains all the parameters for creating the motor.
  • Field Details

    • primaryMotorName

      public String primaryMotorName
    • primaryMotorType

      public FtcMotorActuator.MotorType primaryMotorType
    • primaryMotorInverted

      public boolean primaryMotorInverted
    • followerMotorName

      public String followerMotorName
    • followerMotorType

      public FtcMotorActuator.MotorType followerMotorType
    • followerMotorInverted

      public boolean followerMotorInverted
    • lowerLimitSwitchName

      public String lowerLimitSwitchName
    • lowerLimitSwitchInverted

      public boolean lowerLimitSwitchInverted
    • upperLimitSwitchName

      public String upperLimitSwitchName
    • upperLimitSwitchInverted

      public boolean upperLimitSwitchInverted
    • externalEncoder

      public TrcEncoder externalEncoder
    • externalEncoderName

      public String externalEncoderName
    • externalEncoderInverted

      public boolean externalEncoderInverted
    • positionScale

      public double positionScale
    • positionOffset

      public double positionOffset
    • positionZeroOffset

      public double positionZeroOffset
    • positionPresets

      public double[] positionPresets
    • positionPresetTolerance

      public double positionPresetTolerance
  • Constructor Details

    • Params

      public Params()
  • Method Details

    • toString

      @NonNull public String toString()
      This method returns the string format of the Params info.
      Overrides:
      toString in class Object
      Returns:
      string format of the params info.
    • setPrimaryMotor

      public FtcMotorActuator.Params setPrimaryMotor(String name, FtcMotorActuator.MotorType motorType, boolean inverted)
      This method sets the parameters of the primary motor.
      Parameters:
      name - specifies the name of the motor.
      motorType - specifies the motor type.
      inverted - specifies true to invert the motor direction, false otherwise.
      Returns:
      this object for chaining.
    • setFollowerMotor

      public FtcMotorActuator.Params setFollowerMotor(String name, FtcMotorActuator.MotorType motorType, boolean inverted)
      This method sets the parameters of the follower motor.
      Parameters:
      name - specifies the name of the motor.
      motorType - specifies the motor type.
      inverted - specifies true to invert the motor direction, false otherwise.
      Returns:
      this object for chaining.
    • setLowerLimitSwitch

      public FtcMotorActuator.Params setLowerLimitSwitch(String name, boolean inverted)
      This method sets the lower limit switch parameters.
      Parameters:
      name - specifies the name of the limit switch.
      inverted - specifies true if the limit switch is normally open, false if normally close.
      Returns:
      this object for chaining.
    • setUpperLimitSwitch

      public FtcMotorActuator.Params setUpperLimitSwitch(String name, boolean inverted)
      This method sets the upper limit switch parameters.
      Parameters:
      name - specifies the name of the limit switch.
      inverted - specifies true if the limit switch is normally open, false if normally close.
      Returns:
      this object for chaining.
    • setExternalEncoder

      public FtcMotorActuator.Params setExternalEncoder(TrcEncoder encoder)
      This method sets the external encoder parameters.
      Parameters:
      encoder - specifies the external analog encoder.
      Returns:
      this object for chaining.
    • setExternalEncoder

      public FtcMotorActuator.Params setExternalEncoder(String name, boolean inverted)
      This method sets the external encoder parameters.
      Parameters:
      name - specifies the name of the analog encoder.
      inverted - specifies true if the encoder is inverted, false otherwise.
      Returns:
      this object for chaining.
    • setPositionScaleAndOffset

      public FtcMotorActuator.Params setPositionScaleAndOffset(double scale, double offset, double zeroOffset)
      This method sets the position sensor scale factor and offset.
      Parameters:
      scale - specifies scale factor to multiply the position sensor reading.
      offset - specifies offset added to the scaled sensor reading.
      zeroOffset - specifies the zero offset for absolute encoder.
      Returns:
      this object for chaining.
    • setPositionScaleAndOffset

      public FtcMotorActuator.Params setPositionScaleAndOffset(double scale, double offset)
      This method sets the position sensor scale factor and offset.
      Parameters:
      scale - specifies scale factor to multiply the position sensor reading.
      offset - specifies offset added to the scaled sensor reading.
      Returns:
      this object for chaining.
    • setPositionPresets

      public FtcMotorActuator.Params setPositionPresets(double tolerance, double... posPresets)
      This method sets an array of preset positions.
      Parameters:
      tolerance - specifies the preset tolerance.
      posPresets - specifies an array of preset positions in scaled unit.
      Returns:
      this object for chaining.