REVLib - C++
Loading...
Searching...
No Matches
rev::detached::DetachedEncoderConfig Class Reference

#include <DetachedEncoderConfig.h>

Inherits rev::BaseConfig.

Public Member Functions

 DetachedEncoderConfig ()=default
 
 ~DetachedEncoderConfig () override=default
 
 DetachedEncoderConfig (const DetachedEncoderConfig &)=delete
 
DetachedEncoderConfig & operator= (const DetachedEncoderConfig &)=delete
 
 DetachedEncoderConfig (DetachedEncoderConfig &&) noexcept=delete
 
DetachedEncoderConfig & operator= (DetachedEncoderConfig &&) noexcept=delete
 
DetachedEncoderConfig & Apply (DetachedEncoderConfig &config)
 
DetachedEncoderConfig & Apply (SignalsConfig &config)
 
DetachedEncoderConfig & Inverted (bool inverted)
 
DetachedEncoderConfig & VelocityAverageDepth (int depth)
 
DetachedEncoderConfig & ZeroOffset (double offset)
 
DetachedEncoderConfig & ZeroCentered (bool zeroCentered)
 
DetachedEncoderConfig & StartPulseUs (double startPulseUs)
 
DetachedEncoderConfig & EndPulseUs (double endPulseUs)
 
DetachedEncoderConfig & AbsolutePeriodUs (double periodUs)
 
std::string Flatten () override
 
- Public Member Functions inherited from rev::BaseConfig
virtual ~BaseConfig ()=default
 

Public Attributes

SignalsConfig signals
 

Additional Inherited Members

- Protected Types inherited from rev::BaseConfig
using ParameterType_t = std::variant<int32_t, uint32_t, float, bool>
 
- Protected Member Functions inherited from rev::BaseConfig
 BaseConfig ()=default
 
 BaseConfig (const BaseConfig &)=default
 
BaseConfig & operator= (const BaseConfig &)=delete
 
 BaseConfig (BaseConfig &&) noexcept=delete
 
BaseConfig & operator= (BaseConfig &&) noexcept=delete
 
template<typename ParameterType >
void PutParameter (uint8_t parameterId, ParameterType value)
 
std::optional< ParameterType_t > GetParameter (uint8_t parameterId)
 
void RemoveParameter (uint8_t parameterId)
 
void Apply (BaseConfig &config)
 
- Static Protected Member Functions inherited from rev::BaseConfig
static std::optional< ParameterType_t > GetParameter (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() [1/2]

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

◆ Apply() [2/2]

DetachedEncoderConfig & DetachedEncoderConfig::Apply ( SignalsConfig & config)

Applies settings from a SignalsConfig to this DetachedEncoderConfig.

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

Parameters
configThe SignalsConfig 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

◆ 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

◆ 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 and inverted was set to false.

NOTE: This parameter is NOT reset when configuring with ResetMode::kResetSafeParameters.

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

◆ StartPulseUs()

DetachedEncoderConfig & DetachedEncoderConfig::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 DetachedEncoderConfig object for method chaining

◆ EndPulseUs()

DetachedEncoderConfig & DetachedEncoderConfig::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 DetachedEncoderConfig object for method chaining

◆ AbsolutePeriodUs()

DetachedEncoderConfig & DetachedEncoderConfig::AbsolutePeriodUs ( double periodUs)

Set the expected absolute position signal period in us.

Parameters
periodUsThe expected absolute position signal period
Returns
The modified DetachedEncoderConfig object for method chaining

◆ Flatten()

std::string DetachedEncoderConfig::Flatten ( )
overridevirtual

Reimplemented from rev::BaseConfig.

Member Data Documentation

◆ signals

SignalsConfig rev::detached::DetachedEncoderConfig::signals

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