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
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiondouble
Typically not recommended - usegetWrappedPosition()
instead.int
protected double
void
Consumes and processes inputs from the device or subsystem.void
setInverted
(boolean inverted) abstract void
updateInputs
(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:
getChannel
in interfaceXBaseIO
-
setInverted
public void setInverted(boolean inverted) -
inversionFactor
protected double inversionFactor() -
updateInputs
-
refreshDataFrame
public void refreshDataFrame()Description copied from interface:DataFrameRefreshable
Consumes and processes inputs from the device or subsystem.- Specified by:
refreshDataFrame
in interfaceDataFrameRefreshable
-