|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmaslab.orc.IRRangeSensor
public class IRRangeSensor
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 | |
---|---|
IRRangeSensor(Orc orc,
int port)
Create an IRRangeSensor without any parameters-- useful only when you provide your own parameters. |
Method Summary | |
---|---|
double |
getArcAngle()
The rough interior angle of the arc upon which an object might lie, in radians. |
double |
getRange()
Distance that the sensor currently is measuring, in meters. |
double |
getRangeUncertainty()
Variance of the sensor's current measurement. |
static IRRangeSensor |
make2Y0A02(Orc orc,
int port)
Create and return an IRRangeSensor configured with approximate parameters for a Sharp 2Y0A02. |
static IRRangeSensor |
makeGP2D12(Orc orc,
int port)
Create and return an IRRangeSensor configured with approximate parameters for a Sharp GP2D12. |
void |
setParameters(double Xd,
double Xm,
double Xb)
Configure the distance parameters. |
void |
setParameters(double Xd,
double Xm,
double Xb,
double arcAngle,
double voltageVariance)
Configure distance and other parameters. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public IRRangeSensor(Orc orc, int port)
Method Detail |
---|
public void setParameters(double Xd, double Xm, double Xb)
public void setParameters(double Xd, double Xm, double Xb, double arcAngle, double voltageVariance)
public static IRRangeSensor make2Y0A02(Orc orc, int port)
public static IRRangeSensor makeGP2D12(Orc orc, int port)
public double getRange()
RangeSensor
getRange
in interface RangeSensor
public double getRangeUncertainty()
RangeSensor
getRangeUncertainty
in interface RangeSensor
public double getArcAngle()
RangeSensor
getArcAngle
in interface RangeSensor
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |