Robot Control

applet home
help contents
quickstart
general help
tutorials
 

 

Tutorial One: Creating and Loading Maps

When you first open the applet, you should see a large white area, with a small blue triangle in the centre, representing the robot. The design of the robot is quite simple - its only method of perception is a single whisker sensor on its left side that tells it whether or not it has hit a wall. There are only three types of entities in the robot's world: the robot itself, walls, and locations. Walls are simply obstructions that the robot must go around. If it hits a wall, then it is considered to have crashed. Locations are, as the name suggests, places that the robot can go.

To create locations, click on the button beside the words 'Create Location' on the left hand side of the window. Then, if you click somewhere on the canvas, you will see a dialog with the coordinates of the location and a space to enter its name. Location names must begin with a lowercase letter and cannot have spaces in them. For those of you familiar with prolog naming conventions, location names must be prolog constants. The location dialog looks like this:


To create walls, click on the button beside the words 'Create Wall' on the left hand side of the window. Then, click anywhere on the canvas to place one side of the wall. Click on the canvas again to place the other side of it. Walls can run through locations, though they will be drawn as though they were behind them. Both locations and walls can be created at any time, even while the robot is running. Once you have created some locations and obstacles, the applet might look something like the picture below.


To move objects around, select them and drag them. You can move anything, including the robot, but the robot cannot be moved while it is running.

If you want to work with a pre-written map, go to the 'File' menu and select 'Load Sample Graph'. You will see a dialog box that looks like this one:


There are currently three maps, each of which contains a few locations and walls. Simply select the map you would like to load, and click the 'Load' button. The sample maps also come with plans for the robot, which are discussed at the start of the next tutorial.