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

#include <SparkRelativeEncoder.h>

Inherits rev::RelativeEncoder.

Public Member Functions

 SparkRelativeEncoder (SparkRelativeEncoder &&rhs)=default
 
SparkRelativeEncoderoperator= (SparkRelativeEncoder &&rhs)=default
 
 SparkRelativeEncoder (const SparkRelativeEncoder &rhs)=default
 
 ~SparkRelativeEncoder () 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 SparkBase
 

Detailed Description

Get an instance of this class by using SparkBase::GetEncoder() or SparkBase::GetEncoder(SparkRelativeEncoder::Type, int).

Constructor & Destructor Documentation

◆ SparkRelativeEncoder() [1/2]

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

◆ SparkRelativeEncoder() [2/2]

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

◆ ~SparkRelativeEncoder()

rev::spark::SparkRelativeEncoder::~SparkRelativeEncoder ( )
overridedefault

Member Function Documentation

◆ operator=()

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

◆ GetPosition()

double SparkRelativeEncoder::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 SparkRelativeEncoder::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 SparkRelativeEncoder::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

◆ SparkBase

friend class SparkBase
friend

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