Class XRPRangefinder

java.lang.Object
edu.wpi.first.wpilibj.xrp.XRPRangefinder

public class XRPRangefinder extends Object
This class represents the ultrasonic rangefinder on an XRP robot.
  • Constructor Details

    • XRPRangefinder

      public XRPRangefinder()
      Constructs an XRPRangefinder.

      Only one instance of a XRPRangefinder is supported.

  • Method Details

    • getDistanceMeters

      public double getDistanceMeters()
      Get the measured distance in meters. Distance further than 4m will be reported as 4m.
      Returns:
      distance in meters
    • getDistanceInches

      public double getDistanceInches()
      Get the measured distance in inches.
      Returns:
      distance in inches