Package ftclib.motor
Class FtcMotorActuator.Params
java.lang.Object
ftclib.motor.FtcMotorActuator.Params
- Enclosing class:
- FtcMotorActuator
This class contains all the parameters for creating the motor.
-
Field Summary
FieldsModifier and TypeFieldDescriptionboolean
boolean
boolean
double
double[]
double
double
double
boolean
boolean
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionsetExternalEncoder
(String name, boolean inverted) This method sets the external encoder parameters.setExternalEncoder
(TrcEncoder encoder) This method sets the external encoder parameters.setFollowerMotor
(String name, FtcMotorActuator.MotorType motorType, boolean inverted) This method sets the parameters of the follower motor.setLowerLimitSwitch
(String name, boolean inverted) This method sets the lower limit switch parameters.setPositionPresets
(double tolerance, double... posPresets) This method sets an array of preset positions.setPositionScaleAndOffset
(double scale, double offset) This method sets the position sensor scale factor and offset.setPositionScaleAndOffset
(double scale, double offset, double zeroOffset) This method sets the position sensor scale factor and offset.setPrimaryMotor
(String name, FtcMotorActuator.MotorType motorType, boolean inverted) This method sets the parameters of the primary motor.setUpperLimitSwitch
(String name, boolean inverted) This method sets the upper limit switch parameters.toString()
This method returns the string format of the Params info.
-
Field Details
-
-
primaryMotorType
-
primaryMotorInverted
public boolean primaryMotorInverted -
followerMotorName
-
followerMotorType
-
followerMotorInverted
public boolean followerMotorInverted -
lowerLimitSwitchName
-
lowerLimitSwitchInverted
public boolean lowerLimitSwitchInverted -
upperLimitSwitchName
-
upperLimitSwitchInverted
public boolean upperLimitSwitchInverted -
externalEncoder
-
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
This method returns the 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
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
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
This method sets the external encoder parameters.- Parameters:
encoder
- specifies the external analog encoder.- Returns:
- this object for chaining.
-
setExternalEncoder
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
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
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.
-