#include <AbsoluteEncoder.h>
Inherits rev::MotorFeedbackSensor.
Inherited by rev::SparkMaxAbsoluteEncoder.
◆ ~AbsoluteEncoder()
virtual rev::AbsoluteEncoder::~AbsoluteEncoder |
( |
| ) |
|
|
inlinevirtual |
◆ GetPosition()
virtual double rev::AbsoluteEncoder::GetPosition |
( |
| ) |
const |
|
pure virtual |
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().
- Returns
- Number of rotations of the motor
Implemented in rev::SparkMaxAbsoluteEncoder.
◆ GetVelocity()
virtual double rev::AbsoluteEncoder::GetVelocity |
( |
| ) |
const |
|
pure virtual |
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().
- Returns
- Number of rotations per second of the motor
Implemented in rev::SparkMaxAbsoluteEncoder.
◆ SetPositionConversionFactor()
virtual REVLibError rev::AbsoluteEncoder::SetPositionConversionFactor |
( |
double |
factor | ) |
|
|
pure virtual |
Set the conversion factor for position of the encoder. Multiplied by the native output units to give you position
- Parameters
-
factor | The conversion factor to multiply the native units by |
- Returns
- REVLibError::kOk if successful
Implemented in rev::SparkMaxAbsoluteEncoder.
◆ GetPositionConversionFactor()
virtual double rev::AbsoluteEncoder::GetPositionConversionFactor |
( |
| ) |
const |
|
pure virtual |
Get the conversion factor for position of the encoder. Multiplied by the native output units to give you position
- Returns
- The conversion factor for position
Implemented in rev::SparkMaxAbsoluteEncoder.
◆ SetVelocityConversionFactor()
virtual REVLibError rev::AbsoluteEncoder::SetVelocityConversionFactor |
( |
double |
factor | ) |
|
|
pure virtual |
Set the conversion factor for velocity of the encoder. Multiplied by the native output units to give you velocity
- Parameters
-
factor | The conversion factor to multiply the native units by |
- Returns
- REVLibError::kOk if successful
Implemented in rev::SparkMaxAbsoluteEncoder.
◆ GetVelocityConversionFactor()
virtual double rev::AbsoluteEncoder::GetVelocityConversionFactor |
( |
| ) |
const |
|
pure virtual |
Get the conversion factor for velocity of the encoder. Multiplied by the native output units to give you velocity
- Returns
- The conversion factor for velocity
Implemented in rev::SparkMaxAbsoluteEncoder.
◆ SetInverted()
virtual REVLibError rev::AbsoluteEncoder::SetInverted |
( |
bool |
inverted | ) |
|
|
pure virtual |
◆ GetInverted()
virtual bool rev::AbsoluteEncoder::GetInverted |
( |
| ) |
const |
|
pure virtual |
◆ SetAverageDepth()
virtual REVLibError rev::AbsoluteEncoder::SetAverageDepth |
( |
uint32_t |
depth | ) |
|
|
pure virtual |
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
- Parameters
-
depth | The average sampling depth of 1, 2, 4, 8, 16, 32, 64, or 128 |
- Returns
- REVLibError::kOk if successful
Implemented in rev::SparkMaxAbsoluteEncoder.
◆ GetAverageDepth()
virtual uint32_t rev::AbsoluteEncoder::GetAverageDepth |
( |
| ) |
const |
|
pure virtual |
◆ SetZeroOffset()
virtual REVLibError rev::AbsoluteEncoder::SetZeroOffset |
( |
double |
offset | ) |
|
|
pure virtual |
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.
- Parameters
-
offset | The zero offset with the position conversion factor applied |
- Returns
- REVLibError::kOk if successful
Implemented in rev::SparkMaxAbsoluteEncoder.
◆ GetZeroOffset()
virtual double rev::AbsoluteEncoder::GetZeroOffset |
( |
| ) |
const |
|
pure virtual |
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.
- Returns
- The zero offset of the absolute encoder with the position conversion factor applied
Implemented in rev::SparkMaxAbsoluteEncoder.
◆ SparkMaxAbsoluteEncoder
The documentation for this class was generated from the following file: