Class CANCoderAdapter
java.lang.Object
xbot.common.controls.sensors.XAbsoluteEncoder
xbot.common.controls.sensors.XCANCoder
xbot.common.controls.sensors.wpi_adapters.CANCoderAdapter
- All Implemented Interfaces:
DataFrameRefreshable
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class xbot.common.controls.sensors.XCANCoder
XCANCoder.XCANCoderFactoryNested classes/interfaces inherited from class xbot.common.controls.sensors.XAbsoluteEncoder
XAbsoluteEncoder.XAbsoluteEncoderFactory -
Field Summary
Fields inherited from class xbot.common.controls.sensors.XAbsoluteEncoder
info -
Constructor Summary
ConstructorsConstructorDescriptionCANCoderAdapter(DeviceInfo deviceInfo, String owningSystemPrefix, DevicePolice police, PropertyFactory pf) -
Method Summary
Modifier and TypeMethodDescriptionintdoubleGets the magnet offset configured on the encoder device.booleanbooleansetMagnetOffset(double offsetInDegrees) Sets the magnet offset configured on the encoder device.voidsetPosition(Angle newPosition) setUpdateFrequencyForPosition(double frequencyInHz) Updates how often we get data about the CANCoder position.Stops all signals that are not explicitly set.voidupdateInputs(XAbsoluteEncoderInputs inputs) voidupdateInputs(XCANCoderInputs inputs) Methods inherited from class xbot.common.controls.sensors.XCANCoder
hasResetOccurred, refreshDataFrameMethods inherited from class xbot.common.controls.sensors.XAbsoluteEncoder
getAbsolutePosition, getHealth, getPosition, getVelocity
-
Constructor Details
-
CANCoderAdapter
@AssistedInject public CANCoderAdapter(@Assisted("deviceInfo") DeviceInfo deviceInfo, @Assisted("owningSystemPrefix") String owningSystemPrefix, DevicePolice police, PropertyFactory pf)
-
-
Method Details
-
getDeviceId
public int getDeviceId()- Specified by:
getDeviceIdin classXAbsoluteEncoder
-
getPosition_internal
-
getAbsolutePosition_internal
-
getVelocity_internal
-
getHealth_internal
-
setPosition
- Specified by:
setPositionin classXAbsoluteEncoder
-
getMagnetOffset
public double getMagnetOffset()Gets the magnet offset configured on the encoder device. Blocking call.- Returns:
- The magnet offset in degrees
-
setMagnetOffset
public boolean setMagnetOffset(double offsetInDegrees) Sets the magnet offset configured on the encoder device.- Parameters:
offsetInDegrees- The magnet offset in degrees- Returns:
- True on success.
-
setUpdateFrequencyForPosition
Description copied from class:XCANCoderUpdates how often we get data about the CANCoder position.- Specified by:
setUpdateFrequencyForPositionin classXCANCoder- Parameters:
frequencyInHz- How many times per second we want to get data.- Returns:
- The status code returned from the underlying object.
-
stopAllUnsetSignals
Description copied from class:XCANCoderStops all signals that are not explicitly set. For example, if you haven't called setUpdateFrequencyForPosition, this will stop that signal! Useful for reducing CAN bus traffic for data we're not reading.- Specified by:
stopAllUnsetSignalsin classXCANCoder- Returns:
- The status code returned from the underlying object.
-
clearStickyFaults
- Specified by:
clearStickyFaultsin classXCANCoder
-
hasResetOccurred_internal
public boolean hasResetOccurred_internal() -
updateInputs
- Specified by:
updateInputsin classXAbsoluteEncoder
-
updateInputs
- Specified by:
updateInputsin classXCANCoder
-