Package com.revrobotics
Interface SparkMaxAbsoluteEncoder
-
- All Superinterfaces:
AbsoluteEncoder
,CANSensor
,MotorFeedbackSensor
- All Known Implementing Classes:
SparkAbsoluteEncoder
@Deprecated(forRemoval=true) public interface SparkMaxAbsoluteEncoder extends AbsoluteEncoder
Deprecated, for removal: This API element is subject to removal in a future version.UseSparkAbsoluteEncoder
instead
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
SparkMaxAbsoluteEncoder.Type
Deprecated, for removal: This API element is subject to removal in a future version.UseSparkAbsoluteEncoder.Type
instead
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description int
getAverageDepth()
Deprecated, for removal: This API element is subject to removal in a future version.Get the average sampling depth for an absolute encoderboolean
getInverted()
Deprecated, for removal: This API element is subject to removal in a future version.Get the phase of the AbsoluteEncoderdouble
getPosition()
Deprecated, for removal: This API element is subject to removal in a future version.Get the position of the motor.double
getPositionConversionFactor()
Deprecated, for removal: This API element is subject to removal in a future version.Get the conversion factor for position of the encoder.double
getVelocity()
Deprecated, for removal: This API element is subject to removal in a future version.Get the velocity of the motor.double
getVelocityConversionFactor()
Deprecated, for removal: This API element is subject to removal in a future version.Get the conversion factor for velocity of the encoder.double
getZeroOffset()
Deprecated, for removal: This API element is subject to removal in a future version.Gets the zero offset for an absolute encoder (the position that is reported as zero).REVLibError
setAverageDepth(int depth)
Deprecated, for removal: This API element is subject to removal in a future version.Set the average sampling depth for an absolute encoder.REVLibError
setInverted(boolean inverted)
Deprecated, for removal: This API element is subject to removal in a future version.Set the phase of the AbsoluteEncoder so that it is set to be in phase with the motor itselfREVLibError
setPositionConversionFactor(double factor)
Deprecated, for removal: This API element is subject to removal in a future version.Set the conversion factor for position of the encoder.REVLibError
setVelocityConversionFactor(double factor)
Deprecated, for removal: This API element is subject to removal in a future version.Set the conversion factor for velocity of the encoder.REVLibError
setZeroOffset(double offset)
Deprecated, for removal: This API element is subject to removal in a future version.Sets the zero offset of an absolute encoder (the position that is reported as zero).
-
-
-
Method Detail
-
getPosition
double getPosition()
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:AbsoluteEncoder
Get the position of the motor. This returns the native units of 'rotations' by default, and can be changed by a scale factor using setPositionConversionFactor().- Specified by:
getPosition
in interfaceAbsoluteEncoder
- Returns:
- Number of rotations of the motor
-
getVelocity
double getVelocity()
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:AbsoluteEncoder
Get the velocity of the motor. This returns the native units of 'rotations per second' by default, and can be changed by a scale factor using setVelocityConversionFactor().- Specified by:
getVelocity
in interfaceAbsoluteEncoder
- Returns:
- Number of rotations per second of the motor
-
setPositionConversionFactor
REVLibError setPositionConversionFactor(double factor)
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:AbsoluteEncoder
Set the conversion factor for position of the encoder. Multiplied by the native output units to give you position- Specified by:
setPositionConversionFactor
in interfaceAbsoluteEncoder
- Parameters:
factor
- The conversion factor to multiply the native units by- Returns:
REVLibError.kOk
if successful
-
getPositionConversionFactor
double getPositionConversionFactor()
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:AbsoluteEncoder
Get the conversion factor for position of the encoder. Multiplied by the native output units to give you position- Specified by:
getPositionConversionFactor
in interfaceAbsoluteEncoder
- Returns:
- The conversion factor for position
-
setVelocityConversionFactor
REVLibError setVelocityConversionFactor(double factor)
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:AbsoluteEncoder
Set the conversion factor for velocity of the encoder. Multiplied by the native output units to give you velocity- Specified by:
setVelocityConversionFactor
in interfaceAbsoluteEncoder
- Parameters:
factor
- The conversion factor to multiply the native units by- Returns:
REVLibError.kOk
if successful
-
getVelocityConversionFactor
double getVelocityConversionFactor()
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:AbsoluteEncoder
Get the conversion factor for velocity of the encoder. Multiplied by the native output units to give you velocity- Specified by:
getVelocityConversionFactor
in interfaceAbsoluteEncoder
- Returns:
- The conversion factor for velocity
-
setInverted
REVLibError setInverted(boolean inverted)
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:AbsoluteEncoder
Set the phase of the AbsoluteEncoder so that it is set to be in phase with the motor itself- Specified by:
setInverted
in interfaceAbsoluteEncoder
- Specified by:
setInverted
in interfaceCANSensor
- Specified by:
setInverted
in interfaceMotorFeedbackSensor
- Parameters:
inverted
- The phase of the encoder- Returns:
REVLibError.kOk
if successful
-
getInverted
boolean getInverted()
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:AbsoluteEncoder
Get the phase of the AbsoluteEncoder- Specified by:
getInverted
in interfaceAbsoluteEncoder
- Specified by:
getInverted
in interfaceCANSensor
- Specified by:
getInverted
in interfaceMotorFeedbackSensor
- Returns:
- The phase of the encoder
-
setAverageDepth
REVLibError setAverageDepth(int depth)
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:AbsoluteEncoder
Set the average sampling depth for an absolute encoder. This is a bit size and should be either 1, 2, 4, 8, 16, 32, 64, or 128- Specified by:
setAverageDepth
in interfaceAbsoluteEncoder
- Parameters:
depth
- The average sampling depth of 1, 2, 4, 8, 16, 32, 64, or 128- Returns:
REVLibError.kOk
if successful
-
getAverageDepth
int getAverageDepth()
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:AbsoluteEncoder
Get the average sampling depth for an absolute encoder- Specified by:
getAverageDepth
in interfaceAbsoluteEncoder
- Returns:
- The average sampling depth
-
setZeroOffset
REVLibError setZeroOffset(double offset)
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:AbsoluteEncoder
Sets the zero offset of an absolute encoder (the position that is reported as zero).The zero offset is specified as the reported position of the encoder in the desired zero position, if the zero offset was set to 0. It is influenced by the absolute encoder's position conversion factor, and whether it is inverted.
Always call SetPositionConversionFactor() and SetInverted() before calling this function.
- Specified by:
setZeroOffset
in interfaceAbsoluteEncoder
- Parameters:
offset
- The zero offset with the position conversion factor applied- Returns:
REVLibError.kOk
if successful
-
getZeroOffset
double getZeroOffset()
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:AbsoluteEncoder
Gets the zero offset for an absolute encoder (the position that is reported as zero).The zero offset is specified as the reported position of the encoder in the desired zero position, if the zero offset was set to 0. It is influenced by the absolute encoder's position conversion factor, and whether it is inverted.
- Specified by:
getZeroOffset
in interfaceAbsoluteEncoder
- Returns:
- The zero offset of the absolute encoder with the position conversion factor applied
-
-