Step 3: Run your controller (LISP)

This step assumes that you are using the LISP flat-client program. There are also C and Java clients that have fewer features.

If you have not already done so, start LISP and load the flat-client program:

  (load "/u/robot/flat-root/flat5/flat/controller/flat-client")
Then, start the controller using the (flat-client ...) function:
USER(2): (flat-client :port 6100 :display-port 4500 :display-hostname "tahoe.csres.utexas.edu")
Open a connection to the display?y
#
USER(3): flat-client: connection established.
USER(3): 

At the same time, Flat will display the following messages:
Accepted connection.
Flat: wall clock interval is 100000 usec.
Flat: simulation will run at 1.000 times real time.

Now, find the Manager window for your robot:

Flat Manager window

Press Start and the simulation will start. The robot has a default velocity of 0, so it will not move until the controller tells it to. Press Stop to pause the simulation, and Step to single-step the simulation. Press Action to see the sensor scans in real time.

To move the robot on the display (for example, if it runs into a wall), left-click on the display and the robot will jump to that position. Right-click or control-left-click will make the robot rotate to face the current mouse position.

To stop the robot while the simulation continues, the controller must adjust the speed of the robot. Go back to the LISP session and try the following commands:

   (flat-stop)      Sets the linear and rotational velocities to 0.
   (flat-go)        Sets the linear velocity to the value of *default-speed*
   (flat-speed 200) Sets the linear velocity to 200 mm/sec.
   (flat-turn-left) Sets the rotational velocity to 10 deg/sec counterclockwise.
   (flat-turn-right) Similarly for clockwise rotation.
Velocities can be negative. Forward velocity is always in the direction the robot is pointing.

Follow this link for more information on the capabilities of flat-client.

Step 3: Run your controller (Java)

This step assumes that you are using the Java flat-client program. The LISP version described above has many more features.

First, add /u/robot/flat-root/flat5/FlatClient.jar to your CLASSPATH.

  java flat.controller.FlatClient -port 6100
You will see the following output:
beignet:/u/hewett/updown $ java flat.controller.FlatClient -port 1095
speed = 1000 mm/sec.
sleep = 500 ms.
omega = 0 deg/sec.
Accepted connection.
Flat: wall clock interval is 100000 usec.
Flat: simulation will run at 1.000 times real time.
FlatClient: connection established.
flat: Starting Spot.
Controller: Lisp Controller