REVLib - C++
rev::RelativeEncoder Class Referenceabstract

#include <RelativeEncoder.h>

Inherited by rev::spark::SparkFlexExternalEncoder, rev::spark::SparkMaxAlternateEncoder, and rev::spark::SparkRelativeEncoder.

Public Member Functions

virtual ~RelativeEncoder ()
 
virtual double GetPosition () const =0
 
virtual double GetVelocity () const =0
 
virtual REVLibError SetPosition (double position)=0
 

Friends

class spark::SparkMaxAlternateEncoder
 
class spark::SparkRelativeEncoder
 
class spark::SparkFlexExternalEncoder
 

Constructor & Destructor Documentation

◆ ~RelativeEncoder()

virtual rev::RelativeEncoder::~RelativeEncoder ( )
inlinevirtual

Member Function Documentation

◆ GetPosition()

virtual double rev::RelativeEncoder::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::spark::SparkFlexExternalEncoder, rev::spark::SparkMaxAlternateEncoder, and rev::spark::SparkRelativeEncoder.

◆ GetVelocity()

virtual double rev::RelativeEncoder::GetVelocity ( ) const
pure virtual

Get the velocity of the motor. This returns the native units of 'RPM' by default, and can be changed by a scale factor using setVelocityConversionFactor().

Returns
Number the RPM of the motor

Implemented in rev::spark::SparkFlexExternalEncoder, rev::spark::SparkMaxAlternateEncoder, and rev::spark::SparkRelativeEncoder.

◆ SetPosition()

virtual REVLibError rev::RelativeEncoder::SetPosition ( double  position)
pure virtual

Set the position of the encoder.

Parameters
positionNumber of rotations of the motor
Returns
REVLibError::kOk if successful

Implemented in rev::spark::SparkFlexExternalEncoder, rev::spark::SparkMaxAlternateEncoder, and rev::spark::SparkRelativeEncoder.

Friends And Related Function Documentation

◆ spark::SparkMaxAlternateEncoder

friend class spark::SparkMaxAlternateEncoder
friend

◆ spark::SparkRelativeEncoder

friend class spark::SparkRelativeEncoder
friend

◆ spark::SparkFlexExternalEncoder

friend class spark::SparkFlexExternalEncoder
friend

The documentation for this class was generated from the following file: