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

#include <AbsoluteEncoderConfig.h>

Inherits rev::spark::BaseConfig.

Public Member Functions

 AbsoluteEncoderConfig ()=default
 
 ~AbsoluteEncoderConfig () override=default
 
 AbsoluteEncoderConfig (const AbsoluteEncoderConfig &)=delete
 
AbsoluteEncoderConfigoperator= (const AbsoluteEncoderConfig &)=delete
 
 AbsoluteEncoderConfig (AbsoluteEncoderConfig &&) noexcept=delete
 
AbsoluteEncoderConfigoperator= (AbsoluteEncoderConfig &&) noexcept=delete
 
AbsoluteEncoderConfigApply (AbsoluteEncoderConfig &config)
 
AbsoluteEncoderConfigSetSparkMaxDataPortConfig ()
 
AbsoluteEncoderConfigInverted (bool inverted)
 
AbsoluteEncoderConfigPositionConversionFactor (double factor)
 
AbsoluteEncoderConfigVelocityConversionFactor (double factor)
 
AbsoluteEncoderConfigZeroOffset (double offset)
 
AbsoluteEncoderConfigAverageDepth (int depth)
 
AbsoluteEncoderConfigStartPulseUs (double startPulseUs)
 
AbsoluteEncoderConfigEndPulseUs (double endPulseUs)
 
- Public Member Functions inherited from rev::spark::BaseConfig
virtual ~BaseConfig ()=default
 
virtual std::string Flatten ()
 

Additional Inherited Members

- Protected Types inherited from rev::spark::BaseConfig
using SparkConfig_t = std::variant< int32_t, uint32_t, float, bool >
 
- Protected Member Functions inherited from rev::spark::BaseConfig
 BaseConfig ()=default
 
 BaseConfig (const BaseConfig &)=delete
 
BaseConfigoperator= (const BaseConfig &)=delete
 
 BaseConfig (BaseConfig &&) noexcept=delete
 
BaseConfigoperator= (BaseConfig &&) noexcept=delete
 
template<typename ConfigType >
void PutParameter (uint8_t parameterId, ConfigType value)
 
std::optional< SparkConfig_tGetParameter (uint8_t parameterId)
 
std::optional< SparkConfig_tGetParameter (BaseConfig &fromConfig, uint8_t parameterId)
 
void RemoveParameter (uint8_t parameterId)
 
void RemoveParameter (BaseConfig &fromConfig, uint8_t parameterId)
 
void Apply (BaseConfig &config)
 

Constructor & Destructor Documentation

◆ AbsoluteEncoderConfig() [1/3]

rev::spark::AbsoluteEncoderConfig::AbsoluteEncoderConfig ( )
default

◆ ~AbsoluteEncoderConfig()

rev::spark::AbsoluteEncoderConfig::~AbsoluteEncoderConfig ( )
overridedefault

◆ AbsoluteEncoderConfig() [2/3]

rev::spark::AbsoluteEncoderConfig::AbsoluteEncoderConfig ( const AbsoluteEncoderConfig )
delete

◆ AbsoluteEncoderConfig() [3/3]

rev::spark::AbsoluteEncoderConfig::AbsoluteEncoderConfig ( AbsoluteEncoderConfig &&  )
deletenoexcept

Member Function Documentation

◆ operator=() [1/2]

AbsoluteEncoderConfig & rev::spark::AbsoluteEncoderConfig::operator= ( const AbsoluteEncoderConfig )
delete

◆ operator=() [2/2]

AbsoluteEncoderConfig & rev::spark::AbsoluteEncoderConfig::operator= ( AbsoluteEncoderConfig &&  )
deletenoexcept

◆ Apply()

AbsoluteEncoderConfig & AbsoluteEncoderConfig::Apply ( AbsoluteEncoderConfig config)

Applies settings from another AbsoluteEncoderConfig to this one.

Settings in the provided config will overwrite existing values in this object. Settings not specified in the provided config remain unchanged.

Parameters
configThe AbsoluteEncoderConfig to copy settings from
Returns
The updated AbsoluteEncoderConfig for method chaining

◆ SetSparkMaxDataPortConfig()

AbsoluteEncoderConfig & AbsoluteEncoderConfig::SetSparkMaxDataPortConfig ( )

Configures the data port to use the absolute encoder, which is specifically required for SPARK MAX.

NOTE: This method is only necessary when using an absolute encoder with a SPARK MAX without configuring any of its settings

IMPORTANT: SPARK MAX does not support using an absolute encoder in conjunction with an alternate encoder.

Returns
The modified AbsoluteEncoderConfig object for method chaining

◆ Inverted()

AbsoluteEncoderConfig & AbsoluteEncoderConfig::Inverted ( bool  inverted)

Set the phase of the absolute encoder so that it is in phase with the motor itself.

Parameters
invertedThe phase of the encoder
Returns
The modified AbsoluteEncoderConfig object for method chaining

◆ PositionConversionFactor()

AbsoluteEncoderConfig & AbsoluteEncoderConfig::PositionConversionFactor ( double  factor)

Set the conversion factor for the position of the absolute encoder. Position is returned in native units of rotations and will be multiplied by this conversion factor.

Parameters
factorThe conversion factor to multiply the native units by
Returns
The modified AbsoluteEncoderConfig object for method chaining

◆ VelocityConversionFactor()

AbsoluteEncoderConfig & AbsoluteEncoderConfig::VelocityConversionFactor ( double  factor)

Set the conversion factor for the velocity of the absolute encoder. Velocity is returned in native units of rotations per minute and will be multiplied by this conversion factor.

Parameters
factorThe conversion factor to multiply the native units by
Returns
The modified AbsoluteEncoderConfig object for method chaining

◆ ZeroOffset()

AbsoluteEncoderConfig & AbsoluteEncoderConfig::ZeroOffset ( double  offset)

Set the zero offset of the 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 as if the zero offset was set to 0, the position conversion factor was set to 1, and inverted was set to false.

Parameters
offsetThe zero offset in the range [0, 1)
Returns
The modified AbsoluteEncoderConfig object for method chaining

◆ AverageDepth()

AbsoluteEncoderConfig & AbsoluteEncoderConfig::AverageDepth ( int  depth)

Set the average sampling depth of the absolute encoder. This is a bit size and should be either 1, 2, 4, 8, 16, 32, 64, or 128 (default).

Parameters
depthThe average sampling depth of 1, 2, 4, 8, 16, 32, 64, or 128
Returns
The modified AbsoluteEncoderConfig object for method chaining

◆ StartPulseUs()

AbsoluteEncoderConfig & AbsoluteEncoderConfig::StartPulseUs ( double  startPulseUs)

Set the length of the start pulse for this encoder. This pulse will be treated as the 0.0 position.

Parameters
startPulseUsThe minimum high pulse in microseconds
Returns
The modified AbsoluteEncoderConfig object for method chaining

◆ EndPulseUs()

AbsoluteEncoderConfig & AbsoluteEncoderConfig::EndPulseUs ( double  endPulseUs)

Set the length of the end pulse for this encoder. This pulse will be treated as the 1.0 position.

Parameters
endPulseUsThe minimum low pulse in microseconds
Returns
The modified AbsoluteEncoderConfig object for method chaining

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