Modifier and Type | Class and Description |
---|---|
static class |
Avoider.AvoidState |
Thread.State, Thread.UncaughtExceptionHandler
Modifier and Type | Field and Description |
---|---|
static Avoider.AvoidState |
avoidState |
private double[] |
currPos |
private Rectangle |
currRect |
private Navigation |
nav |
private Odometer |
odo |
private Rectangle |
RED |
private double[] |
red_cardinals |
private double |
RED_E |
private double |
RED_N |
private double |
RED_S |
private double |
RED_W |
private USSensor |
usSensor |
private Rectangle |
x1 |
private Rectangle |
x2 |
private Rectangle |
x3 |
private Rectangle |
x4 |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
Constructor and Description |
---|
Avoider(Odometer odo,
Navigation nav,
USSensor usSensor,
double[][] RED)
Avoider constructor
|
Modifier and Type | Method and Description |
---|---|
private boolean |
chooseOrientation(double[] currPos)
Choose rotation sense depending on current position and heading
Decides direction to turn when object encountered
|
private void |
linearAvoidance(boolean CCW)
Linear set of instructions to avoid obstacle
Runs recursively if more obstacles are encountered during avoidance
|
private void |
redAvoidance()
Special set of instructions to avoid the RED zone
|
void |
run()
Execution for robot avoidance.
|
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[] currPos
private Rectangle RED
private double RED_N
private double RED_S
private double RED_W
private double RED_E
private double[] red_cardinals
private Rectangle currRect
private final Rectangle x1
private final Rectangle x2
private final Rectangle x3
private final Rectangle x4
public static Avoider.AvoidState avoidState
public Avoider(Odometer odo, Navigation nav, USSensor usSensor, double[][] RED)
odo
- Odometer objectnav
- Navigation objectusSensor
- USSensor objectRED
- coordinates of red zone to always avoidpublic void run()
private void redAvoidance()
private boolean chooseOrientation(double[] currPos)
currPos
- X, Y, heading coordinatesprivate void linearAvoidance(boolean CCW)
CCW
- direction to turn (should be determined by chooseOrientation)