REVLib - C++
rev::detached::DetachedEncoderConfig Class Reference

#include <DetachedEncoderConfig.h>

Inherits rev::BaseConfig.

Public Member Functions

 DetachedEncoderConfig ()=default
 
 ~DetachedEncoderConfig () override=default
 
 DetachedEncoderConfig (const DetachedEncoderConfig &)=delete
 
DetachedEncoderConfigoperator= (const DetachedEncoderConfig &)=delete
 
 DetachedEncoderConfig (DetachedEncoderConfig &&) noexcept=delete
 
DetachedEncoderConfigoperator= (DetachedEncoderConfig &&) noexcept=delete
 
DetachedEncoderConfigApply (DetachedEncoderConfig &config)
 
DetachedEncoderConfigInverted (bool inverted)
 
DetachedEncoderConfigVelocityConversionFactor (double factor)
 
DetachedEncoderConfigVelocityAverageDepth (int depth)
 
DetachedEncoderConfigPositionConversionFactor (double factor)
 
DetachedEncoderConfigAngleConversionFactor (double factor)
 
DetachedEncoderConfigZeroOffset (double offset)
 
DetachedEncoderConfigZeroCentered (bool zeroCentered)
 
- Public Member Functions inherited from rev::BaseConfig
virtual ~BaseConfig ()=default
 
virtual std::string Flatten ()
 

Public Attributes

SignalsConfig signals
 

Additional Inherited Members

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

Constructor & Destructor Documentation

◆ DetachedEncoderConfig() [1/3]

rev::detached::DetachedEncoderConfig::DetachedEncoderConfig ( )
default

◆ ~DetachedEncoderConfig()

rev::detached::DetachedEncoderConfig::~DetachedEncoderConfig ( )
overridedefault

◆ DetachedEncoderConfig() [2/3]

rev::detached::DetachedEncoderConfig::DetachedEncoderConfig ( const DetachedEncoderConfig )
delete

◆ DetachedEncoderConfig() [3/3]

rev::detached::DetachedEncoderConfig::DetachedEncoderConfig ( DetachedEncoderConfig &&  )
deletenoexcept

Member Function Documentation

◆ operator=() [1/2]

DetachedEncoderConfig & rev::detached::DetachedEncoderConfig::operator= ( const DetachedEncoderConfig )
delete

◆ operator=() [2/2]

DetachedEncoderConfig & rev::detached::DetachedEncoderConfig::operator= ( DetachedEncoderConfig &&  )
deletenoexcept

◆ Apply()

DetachedEncoderConfig & DetachedEncoderConfig::Apply ( DetachedEncoderConfig config)

Applies settings from another DetachedEncoderConfig 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 DetachedEncoderConfig to copy settings from
Returns
The updated DetachedEncoderConfig for method chaining

◆ Inverted()

DetachedEncoderConfig & DetachedEncoderConfig::Inverted ( bool  inverted)

Set the phase of the encoder.

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

◆ VelocityConversionFactor()

DetachedEncoderConfig & DetachedEncoderConfig::VelocityConversionFactor ( double  factor)

Set the conversion factor for the velocity of the 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 DetachedEncoderConfig object for method chaining

◆ VelocityAverageDepth()

DetachedEncoderConfig & DetachedEncoderConfig::VelocityAverageDepth ( int  depth)

Set the sampling depth of the velocity calculation process of the encoder. This value sets the number of samples in the average for velocity readings. This value must be in the range [1, 64]. The default value is 64.

Parameters
depthThe velocity calculation process's sampling depth
Returns
The modified DetachedEncoderConfig object for method chaining

◆ PositionConversionFactor()

DetachedEncoderConfig & DetachedEncoderConfig::PositionConversionFactor ( double  factor)

Set the conversion factor for the position of the 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 DetachedEncoderConfig object for method chaining

◆ AngleConversionFactor()

DetachedEncoderConfig & DetachedEncoderConfig::AngleConversionFactor ( double  factor)

Set the conversion factor for the angle of the encoder. Angle 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 DetachedEncoderConfig object for method chaining

◆ ZeroOffset()

DetachedEncoderConfig & DetachedEncoderConfig::ZeroOffset ( double  offset)

Set the zero offset when using the absolute angle, 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 DetachedEncoderConfig object for method chaining

◆ ZeroCentered()

DetachedEncoderConfig & DetachedEncoderConfig::ZeroCentered ( bool  zeroCentered)

Set whether to enable zero-centering when using the absolute angle. If enabled, the position will be reported in the range (-0.5, 0.5], instead of the default range [0, 1), assuming the default units of rotations.

Parameters
zeroCenteredWhether to enable zero centering
Returns
The modified DetachedEncoderConfig object for method chaining

Member Data Documentation

◆ signals

SignalsConfig rev::detached::DetachedEncoderConfig::signals

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