GlobalNavigation
Class MapGUI

java.lang.Object
  extended by SonarGUI
      extended by GlobalNavigation.MapGUI

public class MapGUI
extends SonarGUI

Extends LocalNavigation.SonarGUI to display map-related data (first read the doc for that class).

New methods (and corresponding ROS messages) have been added to draw rectangles and polygons.


Nested Class Summary
protected  class MapGUI.Poly
          A visual polygon.
protected  class MapGUI.Rect
          A visual rectangle.
 
Field Summary
static java.lang.String APPNAME
          The application name.
static java.awt.Color DEFAULT_POLY_COLOR
          Default color for MapGUI.Polys.
static java.awt.Color DEFAULT_RECT_COLOR
          Default color for MapGUI.Rects.
static int ERASE_POLYS
          Bitfield constant for GUIEraseMessage.
static int ERASE_RECTS
          Bitfield constant for GUIEraseMessage.
static float POLY_LINE_WIDTH
          Line width of the lines making up a MapGUI.Poly in pixels.
protected  java.awt.Color polyColor
          The current MapGUI.Poly color.
protected  java.util.Set<MapGUI.Poly> polys
          All the MapGUI.Polys.
protected  boolean polysEnabled
          Whether to paint the polys.
static float RECT_LINE_WIDTH
          Line width of the lines making up a MapGUI.Rect in pixels.
protected  java.awt.Color rectColor
          The current MapGUI.Rect color.
protected  java.util.Set<MapGUI.Rect> rects
          All the MapGUI.Rects.
protected  boolean rectsEnabled
          Whether to paint the rects.
 
Constructor Summary
MapGUI()
          See LocalNavigation.SonarGUI().
MapGUI(int poseSaveInterval)
          See LocalNavigation.SonarGUI(int).
MapGUI(int poseSaveInterval, double maxTV, double maxRV)
          Consruct a new MapGUI.
 
Method Summary
 void addPoly(java.util.List<java.awt.geom.Point2D.Double> vertices, boolean closed, boolean filled, java.awt.Color color)
          Add a polygon for display.
 void addRect(double x, double y, double width, double height, boolean filled, java.awt.Color color)
          Add a rect for display.
 void addRect(java.awt.geom.Rectangle2D.Double r, boolean filled, java.awt.Color color)
          Add a rect for display.
 void erasePolys()
          Erase all previously polys.
 void eraseRects()
          Erase all previously plotted rects.
 java.lang.String getAppName()
          
 void onStart(Node node)
          Hook called by ROS to start the gui
protected  void paintInWorldOverGridUnderPosesHook(java.awt.Graphics2D g2d)
          
protected  void paintPolys(java.awt.Graphics2D g2d)
          Paint all polys.
protected  void paintRects(java.awt.Graphics2D g2d)
          Paint all rects.
 void testGraphicsHook()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

APPNAME

public static final java.lang.String APPNAME

The application name.

See Also:
Constant Field Values

ERASE_RECTS

public static final int ERASE_RECTS

Bitfield constant for GUIEraseMessage.

See Also:
Constant Field Values

ERASE_POLYS

public static final int ERASE_POLYS

Bitfield constant for GUIEraseMessage.

See Also:
Constant Field Values

RECT_LINE_WIDTH

public static final float RECT_LINE_WIDTH

Line width of the lines making up a MapGUI.Rect in pixels.

See Also:
Constant Field Values

POLY_LINE_WIDTH

public static final float POLY_LINE_WIDTH

Line width of the lines making up a MapGUI.Poly in pixels.

See Also:
Constant Field Values

DEFAULT_RECT_COLOR

public static final java.awt.Color DEFAULT_RECT_COLOR

Default color for MapGUI.Rects.


DEFAULT_POLY_COLOR

public static final java.awt.Color DEFAULT_POLY_COLOR

Default color for MapGUI.Polys.


rectsEnabled

protected boolean rectsEnabled

Whether to paint the rects.


polysEnabled

protected boolean polysEnabled

Whether to paint the polys.


rectColor

protected java.awt.Color rectColor

The current MapGUI.Rect color.


polyColor

protected java.awt.Color polyColor

The current MapGUI.Poly color.


rects

protected java.util.Set<MapGUI.Rect> rects

All the MapGUI.Rects.


polys

protected java.util.Set<MapGUI.Poly> polys

All the MapGUI.Polys.

Constructor Detail

MapGUI

public MapGUI(int poseSaveInterval,
              double maxTV,
              double maxRV)

Consruct a new MapGUI.

See LocalNavigation.SonarGUI(int, double, double).


MapGUI

public MapGUI(int poseSaveInterval)

See LocalNavigation.SonarGUI(int).


MapGUI

public MapGUI()

See LocalNavigation.SonarGUI().

Method Detail

getAppName

public java.lang.String getAppName()

Default impl returns APPNAME.

Returns:
the title for the GUI frame

addRect

public void addRect(double x,
                    double y,
                    double width,
                    double height,
                    boolean filled,
                    java.awt.Color color)

Add a rect for display.

Parameters:
x - the llc x coord in world frame (m)
y - the llc y coord in world frame (m)
width - the width in world frame (m)
height - the height in world frame (m)
filled - whether to fill the rect
color - the rect color or null to use current

addRect

public void addRect(java.awt.geom.Rectangle2D.Double r,
                    boolean filled,
                    java.awt.Color color)

Add a rect for display.

Parameters:
r - the rect
filled - whether to fill the rect
color - the rect color or null to use current

addPoly

public void addPoly(java.util.List<java.awt.geom.Point2D.Double> vertices,
                    boolean closed,
                    boolean filled,
                    java.awt.Color color)

Add a polygon for display.

Parameters:
vertices - the vertices in ccw order
closed - whether to close the poly
filled - whether to fill the poly
color - the poly color or null to use current

eraseRects

public void eraseRects()

Erase all previously plotted rects.


erasePolys

public void erasePolys()

Erase all previously polys.


paintInWorldOverGridUnderPosesHook

protected void paintInWorldOverGridUnderPosesHook(java.awt.Graphics2D g2d)

This impl paintRects(java.awt.Graphics2D), paintPolys(java.awt.Graphics2D), iff each is enabled.


paintRects

protected void paintRects(java.awt.Graphics2D g2d)

Paint all rects.

Parameters:
g2d - the graphics context

paintPolys

protected void paintPolys(java.awt.Graphics2D g2d)

Paint all polys.

Parameters:
g2d - the graphics context

onStart

public void onStart(Node node)
Hook called by ROS to start the gui


testGraphicsHook

public void testGraphicsHook()
                      throws java.lang.InterruptedException

This impl tests the map graphics.

Throws:
java.lang.InterruptedException