User Interface

The user interface uses wxPython to create a form and the corresponding canvas to draw data on the form. It can also save maps, for which we use PIL, the Python Imaging Library.

See Using the User Interface

Note

wxPython Website: http://www.wxpython.org/

Graphical User Interface

The user interface visualizes the sensor data and allows the user to control the robot through the WSAD keys.

Commands

The laser components accepts the following commands:

  • LASER: Data points from the laser component.
  • SONAR: Data points from the sonar component.
  • CORNERS: Detected corner points from the position component.
  • RANSAC: Lines found by wall detection from the position component.
  • MAP: Map bitmap from the map component.
  • POS: Estimated position from the position component.
class gui.Gui

Implements the networking part of the GUI component

command(client, command, params)
Receive sensor data
setup()
Set up connections to the sensors
tick()
Perform collision and `stuck’ detection. Also makes sure sensor data is recent enough, and if not automatically halts the robot.
class gui.PointState
Keeps track of data points and map
class gui.RobotControl(parent, id, title, *a, **kw)

GUI implementation in wxWidgets

onKeyDown(event)
Handle key press event
onKeyUp(event)
Handle key release event
onPaint(event)
Paints the sensor data and map on the canvas
timerCallback(event)
wxWidget timer to synchronize with networking component
updateImage()
Updates the bitmap based on the data from the mapping component.
class gui.SpeedState
Keeps track of movement related variables
gui.isCollisionPoint(x, y, d)
Determine if point is possible collision point
gui.updateSpeed()
Update state after keyboard input or collision changes

Table Of Contents

Previous topic

Path Planner

Next topic

Unit testing

This Page