|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object simbad.sim.BaseObject simbad.sim.Device simbad.sim.SensorDevice simbad.sim.PickSensor simbad.sim.RangeSensorBelt
This class models a circular belt of range sensors : Sonar , Bumpers (future : Laser, Ir).
Sensors are arranged circularly around the robot. User can access to the measurement and hits state of each sensor individualy
or obtain an average measurement in a quadrant.
Note that the sensors are not affected by noise. however you can easily add some gaussian noise with the java.util.Random class.
Random generator = new Random(seed);
and
value = sonars.getMeasurement(0)+generator.nextGaussian()*stddev;
Implementation notes :
We use java 3D picking feature to emulate sensing.
A PickCylinderRay is used on each update to test whether there is an potential obstacle.
Each ray is then checked with a PickSegement.
Field Summary | |
static int |
FLAG_SHOW_FULL_SENSOR_RAY
|
static int |
TYPE_BUMPER
|
static int |
TYPE_IR
|
static int |
TYPE_LASER
|
static int |
TYPE_SONAR
|
Constructor Summary | |
RangeSensorBelt(float radius,
float minRange,
float maxRange,
int nbsensors,
int type,
int flags)
Constructs a RangeSensorBelt. |
|
RangeSensorBelt(javax.vecmath.Vector3d[] positions,
javax.vecmath.Vector3d[] directions,
int type,
int flags)
Constructs a RangeSensorBelt. |
Method Summary | |
javax.swing.JPanel |
createInspectorPanel()
Creates the panel associated to the device. |
int |
getBackLeftQuadrantHits()
Returns number of sensor hits in the back left quadrant: [PI/2,PI]. |
double |
getBackLeftQuadrantMeasurement()
Returns the averaged measure of the sensors situated in the bacck left quadrant: [PI/2,PI]. |
int |
getBackQuadrantHits()
Returns number of sensor hits in the back quadrant: [3PI/4,5PI/4]. |
double |
getBackQuadrantMeasurement()
Returns the averaged measure of the sensors situated in the back quadrant: [3PI/4,4*PI/4]. |
int |
getBackRightQuadrantHits()
Returns number of sensor hits in the back right quadrant: [PI,3PI/2]. |
double |
getBackRightQuadrantMeasurement()
Returns the averaged measure of the sensors situated in the back right quadrant: [PI,3*PI/2]. |
int |
getFrontLeftQuadrantHits()
Returns number of sensor hits in the front left quadrant: [0,PI/4]. |
double |
getFrontLeftQuadrantMeasurement()
Returns the averaged measure of the sensors situated in the front left quadrant: [0,PI/4]. |
int |
getFrontQuadrantHits()
Returns number of sensor hits in the front quadrant: [-PI/4,PI/4]. |
double |
getFrontQuadrantMeasurement()
Returns the averaged measure of the sensors situated in the front quadrant: [-PI/4,PI/4]. |
int |
getFrontRightQuadrantHits()
Returns number of sensor hits in the front right quadrant: [3PI/2,2*PI]. |
double |
getFrontRightQuadrantMeasurement()
Returns the averaged measure of the sensors situated in the front right quadrant: [3PI/2,2*PI]. |
int |
getLeftQuadrantHits()
Returns number of sensor hits in the left quadrant: [PI/4,PI*3/4]. |
double |
getLeftQuadrantMeasurement()
Returns the averaged measure of the sensors situated in the left quadrant: [PI/4,PI*3/4]. |
float |
getMaxRange()
Returns the maximum sensing range in meters. |
double |
getMeasurement(int sensorNum)
Returns the last measure collected for the individual sensor. |
int |
getNumSensors()
Return the number of individual sensor in the belt. |
int |
getQuadrantHits(double minAngle,
double maxAngle)
Returns number of hits in quadrant [minAngle,maxAngle]. |
double |
getQuadrantMeasurement(double minAngle,
double maxAngle)
Returns the averaged measure of the sensors situated in quadrant [minAngle,maxAngle]. |
int |
getRightQuadrantHits()
Returns number of sensor hits in the right quadrant: [5PI/4,7PI/4]. |
double |
getRightQuadrantMeasurement()
Returns the averaged measure of the sensors situated in the right quadrant: [5*PI/4,7*PI/4]. |
double |
getSensorAngle(int sensorNum)
Returns the angle of this sensor. |
boolean |
hasHit(int sensorNum)
Returns the hit state of the sensor. |
boolean |
oneHasHit()
Returns true if one of the sensors has hit. |
Methods inherited from class simbad.sim.Device |
attach, detach, getCanBeTraversed, getName, getRotationTransform, getTranslationTransform, getUpdatePerSecond, rotateY, setCanBeTraversed, setColor, setUpdateOnEachFrame, setUpdatePerSecond, translateTo |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int TYPE_SONAR
public static final int TYPE_IR
public static final int TYPE_LASER
public static final int TYPE_BUMPER
public static final int FLAG_SHOW_FULL_SENSOR_RAY
Constructor Detail |
public RangeSensorBelt(float radius, float minRange, float maxRange, int nbsensors, int type, int flags)
radius
- - the radius of the belt.minRange
- - the minimal range of each sensor ray. Not used for TYPE_BUMPER.maxRange
- - the maximal range of each sensor ray. Not used for TYPE_BUMPER.nbsensors
- - the number of sensors in the belt (typically 4,6,12,24 or 36).type
- - to specify the sensor behaviorpublic RangeSensorBelt(javax.vecmath.Vector3d[] positions, javax.vecmath.Vector3d[] directions, int type, int flags)
positions
- : the position of each sensor relative to belt center.directions
- : the sensing ray direction of each sensor relative to sensor positions.
the magnitude of the vector corresponds to the max range.Method Detail |
public double getMeasurement(int sensorNum)
sensorNum
- num of the sensor.
public double getFrontQuadrantMeasurement()
public double getFrontLeftQuadrantMeasurement()
public double getFrontRightQuadrantMeasurement()
public double getLeftQuadrantMeasurement()
public double getBackLeftQuadrantMeasurement()
public double getBackQuadrantMeasurement()
public double getBackRightQuadrantMeasurement()
public double getRightQuadrantMeasurement()
public double getQuadrantMeasurement(double minAngle, double maxAngle)
minAngle
- in radians the right limit of the quadrant.maxAngle
- in radians the left limit of the quadrant.
public int getFrontQuadrantHits()
public int getFrontLeftQuadrantHits()
public int getFrontRightQuadrantHits()
public int getLeftQuadrantHits()
public int getBackLeftQuadrantHits()
public int getBackQuadrantHits()
public int getBackRightQuadrantHits()
public int getRightQuadrantHits()
public int getQuadrantHits(double minAngle, double maxAngle)
minAngle
- in radians the right limit of the quadrant.maxAngle
- in radians the left limit of the quadrant.
public boolean hasHit(int sensorNum)
sensorNum
- num of the sensor.
public boolean oneHasHit()
public int getNumSensors()
public double getSensorAngle(int sensorNum)
sensorNum
- - num of the sensor.
public float getMaxRange()
public javax.swing.JPanel createInspectorPanel()
Device
createInspectorPanel
in class Device
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |