Package xbot.common.controls.sensors
Class SimulatedAnalogDistanceSensor
java.lang.Object
xbot.common.controls.sensors.XAnalogDistanceSensor
xbot.common.controls.sensors.SimulatedAnalogDistanceSensor
- All Implemented Interfaces:
DistanceSensor
,ISimulatableSensor
public class SimulatedAnalogDistanceSensor
extends XAnalogDistanceSensor
implements ISimulatableSensor
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Nested classes/interfaces inherited from class xbot.common.controls.sensors.XAnalogDistanceSensor
XAnalogDistanceSensor.VoltageMaps, XAnalogDistanceSensor.XAnalogDistanceSensorFactory
-
Constructor Summary
ConstructorDescriptionSimulatedAnalogDistanceSensor
(int channel, DoubleFunction<Double> voltageMap, String prefix, PropertyFactory propMan, DevicePolice police) -
Method Summary
Modifier and TypeMethodDescriptiondouble
void
ingestSimulationData
(org.json.JSONObject payload) void
setAveraging
(boolean shouldAverage) void
setDistance
(double distance) void
setDistanceOffset
(double offset) void
setVoltageOffset
(double offset)
-
Constructor Details
-
SimulatedAnalogDistanceSensor
@AssistedInject public SimulatedAnalogDistanceSensor(@Assisted("channel") int channel, @Assisted("voltageMap") DoubleFunction<Double> voltageMap, @Assisted("prefix") String prefix, PropertyFactory propMan, DevicePolice police)
-
-
Method Details
-
getDistance
public double getDistance()- Specified by:
getDistance
in interfaceDistanceSensor
- Specified by:
getDistance
in classXAnalogDistanceSensor
-
setDistance
public void setDistance(double distance) -
setAveraging
public void setAveraging(boolean shouldAverage) - Specified by:
setAveraging
in interfaceDistanceSensor
- Specified by:
setAveraging
in classXAnalogDistanceSensor
-
setVoltageOffset
public void setVoltageOffset(double offset) - Specified by:
setVoltageOffset
in classXAnalogDistanceSensor
-
setDistanceOffset
public void setDistanceOffset(double offset) - Specified by:
setDistanceOffset
in classXAnalogDistanceSensor
-
ingestSimulationData
public void ingestSimulationData(org.json.JSONObject payload) - Specified by:
ingestSimulationData
in interfaceISimulatableSensor
-