Package com.ctre.phoenix6.sim
Class CANrangeSimState
java.lang.Object
com.ctre.phoenix6.sim.CANrangeSimState
Class to control the state of a simulated
CANrange.-
Constructor Summary
ConstructorsConstructorDescriptionCANrangeSimState(CoreCANrange device) Creates an object to control the state of the givenCANrange. -
Method Summary
Modifier and TypeMethodDescriptionfinal StatusCodesetDistance(double meters) Sets the simulated distance of the CANrange.final StatusCodesetDistance(edu.wpi.first.units.measure.Distance distance) Sets the simulated distance of the CANrange.final StatusCodesetSupplyVoltage(double volts) Sets the simulated supply voltage of the CANrange.final StatusCodesetSupplyVoltage(edu.wpi.first.units.measure.Voltage voltage) Sets the simulated supply voltage of the CANrange.
-
Constructor Details
-
CANrangeSimState
Creates an object to control the state of the givenCANrange.Note the recommended method of accessing simulation features is to use
CoreCANrange.getSimState().- Parameters:
device- Device to which this simulation state is attached
-
-
Method Details
-
setSupplyVoltage
Sets the simulated supply voltage of the CANrange.The minimum allowed supply voltage is 4 V - values below this will be promoted to 4 V.
- Parameters:
volts- The supply voltage in Volts- Returns:
- Status code
-
setSupplyVoltage
Sets the simulated supply voltage of the CANrange.The minimum allowed supply voltage is 4 V - values below this will be promoted to 4 V.
- Parameters:
voltage- The supply voltage- Returns:
- Status code
-
setDistance
Sets the simulated distance of the CANrange.- Parameters:
meters- The distance in meters- Returns:
- Status code
-
setDistance
Sets the simulated distance of the CANrange.- Parameters:
distance- The distance- Returns:
- Status code
-