Class MockCANCoder
java.lang.Object
xbot.common.controls.sensors.XAbsoluteEncoder
xbot.common.controls.sensors.XCANCoder
xbot.common.controls.sensors.mock_adapters.MockCANCoder
- All Implemented Interfaces:
DataFrameRefreshable,ISimulatableSensor
-
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
ConstructorsConstructorDescriptionMockCANCoder(DeviceInfo deviceInfo, String owningSystemPrefix, DevicePolice police, PropertyFactory pf) -
Method Summary
Modifier and TypeMethodDescriptionintdoublebooleanvoidingestSimulationData(org.json.JSONObject payload) voidsetAbsolutePosition(Angle position) voidsetPosition(Angle newPosition) setUpdateFrequencyForPosition(double frequencyInHz) Updates how often we get data about the CANCoder position.voidsetVelocity(AngularVelocity newVelocity) 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
-
MockCANCoder
@AssistedInject public MockCANCoder(@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
-
setVelocity
-
getVelocity_internal
-
setPosition
- Specified by:
setPositionin classXAbsoluteEncoder
-
getPositionOffset
public double getPositionOffset() -
setAbsolutePosition
-
ingestSimulationData
public void ingestSimulationData(org.json.JSONObject payload) - Specified by:
ingestSimulationDatain interfaceISimulatableSensor
-
getHealth_internal
-
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
-