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 classes/interfaces inherited from class xbot.common.controls.sensors.XCANCoder
XCANCoder.XCANCoderFactory
Nested 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
ConstructorDescriptionMockCANCoder
(DeviceInfo deviceInfo, String owningSystemPrefix, DevicePolice police, PropertyFactory pf) -
Method Summary
Modifier and TypeMethodDescriptionint
double
boolean
void
ingestSimulationData
(org.json.JSONObject payload) void
setAbsolutePosition
(Angle position) void
setPosition
(Angle newPosition) setUpdateFrequencyForPosition
(double frequencyInHz) Updates how often we get data about the CANCoder position.Stops all signals that are not explicitly set.void
updateInputs
(XAbsoluteEncoderInputs inputs) void
updateInputs
(XCANCoderInputs inputs) Methods inherited from class xbot.common.controls.sensors.XCANCoder
hasResetOccurred, refreshDataFrame
Methods 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:
getDeviceId
in classXAbsoluteEncoder
-
getPosition_internal
-
getAbsolutePosition_internal
-
getVelocity_internal
-
setPosition
- Specified by:
setPosition
in classXAbsoluteEncoder
-
getPositionOffset
public double getPositionOffset() -
setAbsolutePosition
-
ingestSimulationData
public void ingestSimulationData(org.json.JSONObject payload) - Specified by:
ingestSimulationData
in interfaceISimulatableSensor
-
getHealth_internal
-
setUpdateFrequencyForPosition
Description copied from class:XCANCoder
Updates how often we get data about the CANCoder position.- Specified by:
setUpdateFrequencyForPosition
in 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:XCANCoder
Stops 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:
stopAllUnsetSignals
in classXCANCoder
- Returns:
- The status code returned from the underlying object.
-
clearStickyFaults
- Specified by:
clearStickyFaults
in classXCANCoder
-
hasResetOccurred_internal
public boolean hasResetOccurred_internal() -
updateInputs
- Specified by:
updateInputs
in classXAbsoluteEncoder
-
updateInputs
- Specified by:
updateInputs
in classXCANCoder
-