Modifier and Type | Class and Description |
---|---|
static class |
Search.SearchState |
Thread.State, Thread.UncaughtExceptionHandler
Modifier and Type | Field and Description |
---|---|
static double[][] |
cardinals |
int |
currCardinal |
private double[] |
E |
private float |
lastDistanceDetected |
private double |
lastX |
private double |
lastY |
private double[] |
N |
private Navigation |
nav |
private ArrayList<double[]> |
objectLocations |
private Odometer |
odo |
private double[] |
S |
static Search.SearchState |
searchState |
private USSensor |
usSensor |
private double[] |
W |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
Constructor and Description |
---|
Search(Odometer odometer,
ColorSensor colorSensor,
USSensor usSensor,
double[][] GREEN)
Constructor for Search Class
|
Modifier and Type | Method and Description |
---|---|
static float |
colorDistance(float[] a,
float[] b)
Measures distance between two RGB color vectors
|
protected void |
FOV(double angle)
Perform a swipe scan of a certain aperture angle to precisely identify block
At this stage the robot is ensured to be in close proximity of block
|
private void |
inspectObject(double X,
double Y)
When object is in sight, approach slowly and inspect
|
protected static boolean |
isStyrofoamBlock()
Checks if the oject in front of the robot is a styrofoam block
|
void |
run()
Starts search thread
|
private boolean |
testForObject()
Checks if there is an object that can be detected by the robot
|
private boolean |
testForStyrofoam()
Approach an object to verify its nature
|
private void |
travelToAxis(boolean frontwards)
Travel to the corresponding axis
Axis based on current cardinal point.
|
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
private Odometer odo
private Navigation nav
private USSensor usSensor
private double[] N
private double[] W
private double[] S
private double[] E
public static double[][] cardinals
public int currCardinal
private ArrayList<double[]> objectLocations
private float lastDistanceDetected
private double lastX
private double lastY
public static Search.SearchState searchState
public Search(Odometer odometer, ColorSensor colorSensor, USSensor usSensor, double[][] GREEN)
odometer
- Odometer objectcolorSensor
- ColorSensor objectusSensor
- USSensor objectGREEN
- coordinates of the green scoring zonepublic void run()
private boolean testForStyrofoam()
private boolean testForObject()
private void inspectObject(double X, double Y)
protected void FOV(double angle)
angle
- the field of view (FOV) to scanprivate void travelToAxis(boolean frontwards)
frontwards
- direction to move in relative to robotprotected static boolean isStyrofoamBlock()
public static float colorDistance(float[] a, float[] b)
a
- first RGB vectorb
- second RGB vector