REVLib - C++
rev::spark::SparkFlexExternalEncoder Class Reference

#include <SparkFlexExternalEncoder.h>

Inherits rev::RelativeEncoder.

Public Member Functions

 SparkFlexExternalEncoder (SparkFlexExternalEncoder &&rhs)=default
 
SparkFlexExternalEncoderoperator= (SparkFlexExternalEncoder &&rhs)=default
 
 SparkFlexExternalEncoder (const SparkFlexExternalEncoder &rhs)=default
 
 ~SparkFlexExternalEncoder () override=default
 
double GetPosition () const override
 
double GetVelocity () const override
 
REVLibError SetPosition (double position) override
 
- Public Member Functions inherited from rev::RelativeEncoder
virtual ~RelativeEncoder ()
 

Friends

class SparkFlex
 

Constructor & Destructor Documentation

◆ SparkFlexExternalEncoder() [1/2]

rev::spark::SparkFlexExternalEncoder::SparkFlexExternalEncoder ( SparkFlexExternalEncoder &&  rhs)
default

◆ SparkFlexExternalEncoder() [2/2]

rev::spark::SparkFlexExternalEncoder::SparkFlexExternalEncoder ( const SparkFlexExternalEncoder rhs)
default

◆ ~SparkFlexExternalEncoder()

rev::spark::SparkFlexExternalEncoder::~SparkFlexExternalEncoder ( )
overridedefault

Member Function Documentation

◆ operator=()

SparkFlexExternalEncoder & rev::spark::SparkFlexExternalEncoder::operator= ( SparkFlexExternalEncoder &&  rhs)
default

◆ GetPosition()

double SparkFlexExternalEncoder::GetPosition ( ) const
overridevirtual

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

Implements rev::RelativeEncoder.

◆ GetVelocity()

double SparkFlexExternalEncoder::GetVelocity ( ) const
overridevirtual

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

Implements rev::RelativeEncoder.

◆ SetPosition()

rev::REVLibError SparkFlexExternalEncoder::SetPosition ( double  position)
overridevirtual

Set the position of the encoder.

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

Implements rev::RelativeEncoder.

Friends And Related Function Documentation

◆ SparkFlex

friend class SparkFlex
friend

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