Package xbot.common.controls.sensors
Class XDutyCycleEncoder
java.lang.Object
xbot.common.controls.sensors.XDutyCycleEncoder
- All Implemented Interfaces:
DataFrameRefreshable,XBaseIO
- Direct Known Subclasses:
DutyCycleEncoderWpiAdapter,MockDutyCycleEncoder
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoubleTypically not recommended - usegetWrappedPosition()instead.intprotected doublevoidConsumes and processes inputs from the device or subsystem.voidsetInverted(boolean inverted) abstract voidupdateInputs(XDutyCycleEncoderInputs inputs)
-
Field Details
-
channel
protected int channel -
inverted
protected boolean inverted
-
-
Constructor Details
-
XDutyCycleEncoder
-
-
Method Details
-
getAbsolutePosition
Typically not recommended - usegetWrappedPosition()instead.- Returns:
- the absolute position of the encoder in degrees from (0, 360)
-
getAbsoluteDegrees
public double getAbsoluteDegrees() -
getWrappedPosition
- Returns:
- the absolute position of the encoder in degrees from (-180, 180)
-
getChannel
public int getChannel()- Specified by:
getChannelin interfaceXBaseIO
-
setInverted
public void setInverted(boolean inverted) -
inversionFactor
protected double inversionFactor() -
updateInputs
-
refreshDataFrame
public void refreshDataFrame()Description copied from interface:DataFrameRefreshableConsumes and processes inputs from the device or subsystem.- Specified by:
refreshDataFramein interfaceDataFrameRefreshable
-