Package edu.wpi.first.wpilibj.simulation
Class UltrasonicSim
java.lang.Object
edu.wpi.first.wpilibj.simulation.UltrasonicSim
public class UltrasonicSim extends Object
Class to control a simulated
Ultrasonic
.-
Constructor Summary
Constructors Constructor Description UltrasonicSim(int ping, int echo)
Constructor.UltrasonicSim(Ultrasonic ultrasonic)
Constructor. -
Method Summary
Modifier and Type Method Description void
setRangeInches(double inches)
Sets the range measurement.void
setRangeMeters(double meters)
Sets the range measurement.void
setRangeValid(boolean valid)
Sets if the range measurement is valid.
-
Constructor Details
-
UltrasonicSim
Constructor.- Parameters:
ultrasonic
- The real ultrasonic to simulate
-
UltrasonicSim
Constructor.- Parameters:
ping
- unused.echo
- the ultrasonic's echo channel.
-
-
Method Details
-
setRangeValid
Sets if the range measurement is valid.- Parameters:
valid
- True if valid
-
setRangeInches
Sets the range measurement.- Parameters:
inches
- The range in inches.
-
setRangeMeters
Sets the range measurement.- Parameters:
meters
- The range in meters.
-