RoboJDETM v2.0

com.ridgesoft.robotics
Class SonarRangeFinder

java.lang.Object
  extended by com.ridgesoft.robotics.SonarRangeFinder
All Implemented Interfaces:
RangeFinder
Direct Known Subclasses:
DevantechSRF04, DevantechSRF08, ParallaxPing

public abstract class SonarRangeFinder
extends Object
implements RangeFinder

Abstract class that implements the distance methods of the RangeFinder interface for sonar range finders.

Distances are calculated using using the speed of sound at sea level.


Constructor Summary
protected SonarRangeFinder()
          Constructs a SonarRangeFinder.
 
Method Summary
 float getDistanceCm()
          Gets the distance to the nearest object in centimeters based on the speed of sound at sea level (340.29 m/s).
 float getDistanceInches()
          Gets the distance to the nearest object in inches based on the speed of sound at sea level (1116.4 ft/s).
abstract  int getEchoDelay()
          Gets the echo delay.
abstract  void ping()
          Generates a ping.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait
 

Constructor Detail

SonarRangeFinder

protected SonarRangeFinder()
Constructs a SonarRangeFinder.

Method Detail

getDistanceCm

public float getDistanceCm()
Gets the distance to the nearest object in centimeters based on the speed of sound at sea level (340.29 m/s).

Specified by:
getDistanceCm in interface RangeFinder
Returns:
distance in centimeters or -1 if no data

getDistanceInches

public float getDistanceInches()
Gets the distance to the nearest object in inches based on the speed of sound at sea level (1116.4 ft/s).

Specified by:
getDistanceInches in interface RangeFinder
Returns:
distance in inches or -1 if no data

getEchoDelay

public abstract int getEchoDelay()
Gets the echo delay.

Returns:
delay time until the echo of the ping is heard in microseconds, compensated for blanking time, -1 if pulse not complete or no pulse

ping

public abstract void ping()
Generates a ping.

Specified by:
ping in interface RangeFinder

RoboJDETM v2.0

Copyright (c) 2003-2009 RidgeSoft, LLC. All rights reserved.
www.ridgesoft.com