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
ConstructorsConstructorDescriptionXDutyCycleEncoder(DeviceInfo info, DevicePolice police, DataFrameRegistry dataFrameRegistry) -
Method Summary
Modifier and TypeMethodDescriptionorg.wpilib.units.measure.Angleintorg.wpilib.units.measure.Angleprotected 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
public org.wpilib.units.measure.Angle getAbsolutePosition()- Returns:
- the number of rotations the encoder has gone through since it was last reset.
-
getWrappedPosition
public org.wpilib.units.measure.Angle getWrappedPosition()- Returns:
- the position of the encoder wrapped to the range [-180, 180) degrees (or equivalent units).
-
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
-