|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectGlobalNavigation.GlobalNavigation
public class GlobalNavigation
Driver for the GlobalNavigation lab.
Field Summary | |
---|---|
static java.lang.String |
APPNAME
Name to use when run as an application. |
|
bumpSub
|
protected CSpace |
cspace
The configuration space. |
protected java.awt.geom.Point2D.Double |
currentWaypoint
The current waypoint. |
protected int |
currentWaypointIndex
|
static java.awt.Color |
FAR_COLOR
Color of the farthest cell(s). |
static double |
FOLLOW_PATH_MAX_RV
Max rotational velocity while following path (rad/s). |
static double |
FOLLOW_PATH_RV_GAIN
Proportional gain for rotation controller while following path. |
static double |
FOLLOW_PATH_TV
Translational velocity while following path (m/s). |
static int |
GO
State constant, following path. |
static java.awt.Color |
GOAL_COLOR
Color of the goal cell. |
protected java.awt.geom.Point2D.Double |
goalPoint
Goal point. |
protected Grid |
grid
|
static double |
GRID_RESOLUTION
|
protected PolygonMap |
map
The map, read from file in #main . |
protected double |
maxDist
Maximum distance from any cell that can reach the goal to the goal (m). |
|
odoSub
|
static java.awt.Color |
PATH_COLOR
Color of the path. |
protected int |
redrawCounter
|
static int |
ROBOT_BUMPER_LEFT
Left bumper (orc port 9) index. |
static int |
ROBOT_BUMPER_RIGHT
Right bumper (orc port 8) index. |
protected static double |
robotRadius
(Solution) |
static double |
ROTATE_FIRST_THRESHOLD
Rotate before translation threshold (radians) |
protected java.awt.geom.Point2D.Double |
startPoint
Start point. |
protected int |
state
The current robot state. |
static int |
STOP
State constant, robot stopped. |
protected VisibilityGraph |
visibilityGraph
The graph |
protected java.util.List<java.awt.geom.Point2D.Double> |
waypoints
|
protected java.awt.geom.Rectangle2D.Double |
worldRect
World bounds. |
static double |
WP_THRESHOLD
Waypoint reached threshold (m). |
Constructor Summary | |
---|---|
GlobalNavigation()
|
Method Summary | |
---|---|
void |
displayCSpace()
Display cspace to the GUI. |
void |
displayGrid()
Display grid to the GUI. |
void |
displayMap()
Display map to console and to the GUI. |
void |
displayPath()
Display a set of line segments from currentWaypoint to the
goal. |
void |
displayVisibilityGraph()
|
static void |
fillColor(ColorMsg color2,
java.awt.Color color)
|
void |
fillPointMsg(GUIPointMsg msg,
java.awt.geom.Point2D.Double point,
java.awt.Color color,
long shape)
|
static void |
fillPolyMsg(GUIPolyMsg msg,
PolygonObstacle obstacle,
java.awt.Color c,
boolean filled,
boolean closed)
|
static void |
fillRectMsg(GUIRectMsg msg,
java.awt.geom.Rectangle2D.Double r,
java.awt.Color c,
boolean filled)
|
void |
fillSegmentMsg(GUISegmentMsg segmentMsg,
java.awt.Color color,
java.awt.geom.Point2D.Double start,
java.awt.geom.Point2D.Double other)
|
GraphName |
getDefaultNodeName()
|
void |
handle(BumpMsg msg)
Implements stop on bump. |
void |
handle(OdometryMsg msg)
Implements path following. |
void |
instanceMain(java.lang.String[] arg)
Displays map, computes cspace and grid, displays grid and path, and initiates path following. |
protected static java.awt.Color |
interpolateColor(double maxDist,
double dist)
Generate an interpolated color between FAR_COLOR and GOAL_COLOR . |
void |
onShutdown(Node arg0)
|
void |
onShutdownComplete(Node node)
|
void |
onStart(Node node)
Driver, calls instanceMain(java.lang.String[]) . |
void |
setMotionMsg(MotionMsg msg,
double d,
double rv)
|
void |
testConvexHull()
Exercise the convex hull and polygon display code. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String APPNAME
Name to use when run as an application.
public static final int STOP
State constant, robot stopped.
public static final int GO
State constant, following path.
public static int ROBOT_BUMPER_RIGHT
Right bumper (orc port 8) index.
public static int ROBOT_BUMPER_LEFT
Left bumper (orc port 9) index.
public static final double FOLLOW_PATH_TV
Translational velocity while following path (m/s).
public static final double FOLLOW_PATH_RV_GAIN
Proportional gain for rotation controller while following path.
public static final double FOLLOW_PATH_MAX_RV
Max rotational velocity while following path (rad/s).
public static final double ROTATE_FIRST_THRESHOLD
Rotate before translation threshold (radians)
public static final double WP_THRESHOLD
Waypoint reached threshold (m).
protected PolygonMap map
The map, read from file in #main
.
protected java.awt.geom.Rectangle2D.Double worldRect
World bounds.
protected java.awt.geom.Point2D.Double startPoint
Start point.
protected java.awt.geom.Point2D.Double goalPoint
Goal point.
protected VisibilityGraph visibilityGraph
The graph
protected CSpace cspace
The configuration space.
protected Grid grid
public static final double GRID_RESOLUTION
public static final java.awt.Color FAR_COLOR
Color of the farthest cell(s).
public static final java.awt.Color GOAL_COLOR
Color of the goal cell.
public static final java.awt.Color PATH_COLOR
Color of the path.
protected java.awt.geom.Point2D.Double currentWaypoint
The current waypoint.
protected int currentWaypointIndex
protected java.util.List<java.awt.geom.Point2D.Double> waypoints
protected double maxDist
Maximum distance from any cell that can reach the goal to the goal (m).
.
protected int state
The current robot state.
protected int redrawCounter
protected static double robotRadius
publicbumpSub
publicodoSub
Constructor Detail |
---|
public GlobalNavigation()
Method Detail |
---|
public void displayMap()
Display map
to console and to the GUI.
public void fillPointMsg(GUIPointMsg msg, java.awt.geom.Point2D.Double point, java.awt.Color color, long shape)
public static void fillPolyMsg(GUIPolyMsg msg, PolygonObstacle obstacle, java.awt.Color c, boolean filled, boolean closed)
public static void fillRectMsg(GUIRectMsg msg, java.awt.geom.Rectangle2D.Double r, java.awt.Color c, boolean filled)
public void displayGrid()
Display grid
to the GUI.
Obstacle cells are not displayed; all others are colored according to
their distance from the goal (see FAR_COLOR
and GOAL_COLOR
).
public void displayCSpace()
Display cspace
to the GUI.
public void displayVisibilityGraph()
public void fillSegmentMsg(GUISegmentMsg segmentMsg, java.awt.Color color, java.awt.geom.Point2D.Double start, java.awt.geom.Point2D.Double other)
public static void fillColor(ColorMsg color2, java.awt.Color color)
protected static java.awt.Color interpolateColor(double maxDist, double dist)
Generate an interpolated color between FAR_COLOR
and GOAL_COLOR
.
maxDist
- the distance of the farthest cell(s) from the goal (m)dist
- the distance of the specified cell from the goal (m)public void displayPath()
Display a set of line segments from currentWaypoint
to the
goal.
public void testConvexHull()
Exercise the convex hull and polygon display code.
public void handle(OdometryMsg msg)
Implements path following.
public void setMotionMsg(MotionMsg msg, double d, double rv)
public void handle(BumpMsg msg)
Implements stop on bump.
public void onStart(Node node)
Driver, calls instanceMain(java.lang.String[])
.
public void instanceMain(java.lang.String[] arg)
Displays map, computes cspace and grid, displays grid and path, and initiates path following.
public void onShutdown(Node arg0)
public void onShutdownComplete(Node node)
public GraphName getDefaultNodeName()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |