|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object orc.IRRangeFinder
public class IRRangeFinder
Orc wrapper for Infra-red range sensors. The manufacturer (Sharp) suggests that a line can be fit to a function of the form 1/(d + Xd), where d is the distance and Xd is some calibration value. We use parameters Xm and Xb as the parameters of the line. V = 1/(d + Xd) * Xm + Xb Solving for d: d = (Xm/(V-Xb)) - Xd
Constructor Summary | |
---|---|
IRRangeFinder(Orc orc,
int port)
Create an IRRangeFinder without any parameters-- useful only when you provide your own parameters. |
Method Summary | |
---|---|
double |
getRange()
|
double[] |
getRangeAndUncertainty()
Get the range of the sensor in meters, returning 0 if the sensor appears to be outside its working range. |
static IRRangeFinder |
make2Y0A02(Orc orc,
int port)
Create and return an IRRangeFinder configured with approximate parameters for a Sharp 2Y0A02. |
static IRRangeFinder |
makeGP2D12(Orc orc,
int port)
Create and return an IRRangeFinder configured with approximate parameters for a Sharp GP2D12. |
void |
setParameters(double Xd,
double Xm,
double Xb,
double voltageStdDev)
Configure distance and other parameters. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public IRRangeFinder(Orc orc, int port)
Method Detail |
---|
public double[] getRangeAndUncertainty()
public double getRange()
public void setParameters(double Xd, double Xm, double Xb, double voltageStdDev)
public static IRRangeFinder make2Y0A02(Orc orc, int port)
public static IRRangeFinder makeGP2D12(Orc orc, int port)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |