Package com.revrobotics.encoder.config
Class DetachedEncoderConfig
java.lang.Object
com.revrobotics.config.BaseConfig
com.revrobotics.encoder.config.DetachedEncoderConfig
-
Nested Class Summary
Nested classes/interfaces inherited from class com.revrobotics.config.BaseConfig
BaseConfig.CANType -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreate a new object to configure the DetachedEncoder -
Method Summary
Modifier and TypeMethodDescriptionangleConversionFactor(double factor) Set the conversion factor for the angle of the encoder.apply(DetachedEncoderConfig other) Applies settings from anotherDetachedEncoderConfigto this one.apply(DetachedSignalsConfig config) Applies settings from aDetachedSignalsConfigto thisDetachedEncoderConfig.averageDepth(int depth) Set the sampling depth of the velocity calculation process of the encoder.dutyCycleEndPulseUs(double endPulseUs) Set the length of the end pulse for this encoder.dutyCycleOffset(double offset) Set the zero offset when using the absolute angle, the position that is reported as zero.dutyCyclePeriodUs(double periodUs) Set the expected absolute position signal period in us.dutyCycleStartPulseUs(double startPulseUs) Set the length of the start pulse for this encoder.dutyCycleZeroCentered(boolean isZeroCentered) Set whether to enable zero-centering when using the absolute angle.flatten()inverted(boolean inverted) Set the phase of the encoder.positionConversionFactor(double factor) Set the conversion factor for the position of the encoder.velocityConversionFactor(double factor) Set the conversion factor for the velocity of the encoder.Methods inherited from class com.revrobotics.config.BaseConfig
apply, getParameter, getParameter, putParameter, putParameter, putParameter, removeParameter, removeParameter
-
Field Details
-
signals
-
-
Constructor Details
-
DetachedEncoderConfig
public DetachedEncoderConfig()Create a new object to configure the DetachedEncoder
-
-
Method Details
-
apply
Applies settings from anotherDetachedEncoderConfigto this one.Settings in the provided config will overwrite existing values in this object. Settings not specified in the provided config remain unchanged.
- Parameters:
other- TheDetachedEncoderConfigto copy settings from- Returns:
- The updated
DetachedEncoderConfigfor method chaining
-
apply
Applies settings from aDetachedSignalsConfigto thisDetachedEncoderConfig.Settings in the provided config will overwrite existing values in this object. Settings not specified in the provided config remain unchanged.
- Parameters:
config- TheDetachedSignalsConfigto copy settings from- Returns:
- The updated
DetachedEncoderConfigfor method chaining
-
inverted
Set the phase of the encoder.- Parameters:
inverted- The phase of the encoder- Returns:
- The modified
DetachedEncoderConfigobject for method chaining
-
velocityConversionFactor
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:
factor- The conversion factor to multiply the native units by- Returns:
- The modified
DetachedEncoderConfigobject for method chaining
-
averageDepth
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:
depth- The velocity calculation process's sampling depth- Returns:
- The modified
DetachedEncoderConfigobject for method chaining
-
positionConversionFactor
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:
factor- The conversion factor to multiply the native units by- Returns:
- The modified
DetachedEncoderConfigobject for method chaining
-
angleConversionFactor
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:
factor- The conversion factor to multiply the native units by- Returns:
- The modified
DetachedEncoderConfigobject for method chaining
-
dutyCycleZeroCentered
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:
isZeroCentered- Whether to enable zero centering- Returns:
- The modified
DetachedEncoderConfigobject for method chaining
-
dutyCycleOffset
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.
NOTE: This parameter is NOT reset when configuring with
ResetMode.kResetSafeParameters.- Parameters:
offset- The zero offset in the range [0, 1)- Returns:
- The modified
DetachedEncoderConfigobject for method chaining
-
dutyCycleStartPulseUs
Set the length of the start pulse for this encoder. This pulse will be treated as the 0.0 position.- Parameters:
startPulseUs- The minimum high pulse in microseconds- Returns:
- The modified DetachedEncoderConfig object for method chaining
-
dutyCycleEndPulseUs
Set the length of the end pulse for this encoder. This pulse will be treated as the 1.0 position.- Parameters:
endPulseUs- The minimum low pulse in microseconds- Returns:
- The modified DetachedEncoderConfig object for method chaining
-
dutyCyclePeriodUs
Set the expected absolute position signal period in us.- Parameters:
periodUs- The expected absolute position signal period- Returns:
- The modified DetachedEncoderConfig object for method chaining
-
flatten
- Overrides:
flattenin classBaseConfig
-