Class UltrasonicSim

java.lang.Object
edu.wpi.first.wpilibj.simulation.UltrasonicSim

public class UltrasonicSim extends Object
Class to control a simulated Ultrasonic.
  • Constructor Details

    • UltrasonicSim

      public UltrasonicSim(Ultrasonic ultrasonic)
      Constructor.
      Parameters:
      ultrasonic - The real ultrasonic to simulate
    • UltrasonicSim

      public UltrasonicSim(int ping, int echo)
      Constructor.
      Parameters:
      ping - unused.
      echo - the ultrasonic's echo channel.
  • Method Details

    • setRangeValid

      public void setRangeValid(boolean valid)
      Sets if the range measurement is valid.
      Parameters:
      valid - True if valid
    • setRangeInches

      public void setRangeInches(double inches)
      Sets the range measurement.
      Parameters:
      inches - The range in inches.
    • setRangeMeters

      public void setRangeMeters(double meters)
      Sets the range measurement.
      Parameters:
      meters - The range in meters.