An easier way to start Flat4 and the Flat5 display

Overview

Flat4 is written in C and Flat5 is written in Java. Currently, most of our control laws are written in LISP. Consquently, to start Flat one must coordinate the startup of several different process, possibly running on different machines.

You can use a LISP program called flat-start to help start the necessary programs. Below are instructions for using the program.

Loading process:

  1. In LISP, load any code used by your control laws.

  2. :ld /u/robot/flat-root/flat4/src/flat-start
  3. (flat-start)

  4. Activate your controller in Flat.
  5. Start Flat.
  6. Run your program.

Example demo startup

The LISP code below is used to start SSH+ Demo3, called the control demo. It calls flat-start.
(defun start-control-demo ()

  ;; This tells us whether we have loaded the SSH yet
  (unless (member :SSH+ *features*)
    (load "/u/robot/ssh+/ssh")
    (load-algy-file "algy-common-kb")
    )

  (load-control-demo)

  ;; Start Flat display and simulator
  (load "/u/robot/flat-root/flat4/src/flat-start")
  (flat-start)

  (format *standard-output* "~2%Press START on the Flat Control Window")
  (y-or-n-p "Did you press START? ")

  (format *standard-output* "~2%Calling (DEMO)")
  (demo)

  (format *standard-output* "~2%Move Spot to the starting point in the Flat Display.")
  (y-or-n-p "Is Spot in the starting location? ")

  (format *standard-output* "~2%Starting the demo.  Use: Go from corner-1 to elevator-1~%")
  (run-control-demo T)

  (format *standard-output* "~2%Ready to end the demo.")
  (y-or-n-p "Type Y when you are ready to end the demo: ")

  (end-demo)

  (format *standard-output* "~%Run (START-CONTROL-DEMO) to re-run the demo.")
  )

Example FLAT-START interaction

Here is an example of starting Flat using the flat-start program.
In this example, the Flat display is run on the machine called arachne.cs.utexas.edu
and the Flat simulator is run on shadow.csres.utexas.edu.

Notes:

  1. flat-start uses SSH to remotely run programs. You will need to enter your passphrase or password to start remote programs.
  2. Ignore the messages "stty: : Invalid argument"
  3. The startup program has a set of default port numbers that it requests, however these ports may not be available. Watch the startup messages to see which port is actually used by the program.
  4. The Flat simulator connects to the Flat display over port 1085 (default).
  5. The simulator sends the name of the environment file to the display.
    However, if they are running on different machines, the path may not
    be the same. If this happens, the display will be unable to find
    the environment file and will print an error message. However,
    the display was already given the name of the environment file when
    it was started, so you can ignore the error message.
-------- Run the Flat Display ---------

 Please set the correct values (hit RETURN to use a default value):
   Host machine for the Flat display (arachne.cs.utexas.edu): <cr>
   Command to run the Flat display (java flat.Flat): <cr>
   Port (1085): <cr>
   Classpath (/u/robot/flat-root/flat5): <cr>
   Environment (/u/robot/flat-root/flat5/env/taylor-level-4.env): <cr>
Confirm Flat Display command line (java flat.Flat 1085 /u/robot/flat-root/flat5/env/taylor-level-4.env -classpath/u/robot/flat-root/flat5): <cr>

Enter Y when the Flat environment display is visible: 
** (background) ** Flat display is running in process 29336
stty: : Invalid argument
stty: : Invalid argument
stty: : Invalid argument
stty: : Invalid argument

** (background) ** Output from Flat display: Flat /u/robot/flat-root/flat5/env/taylor-level-4.env 1085
Port 1085 is busy...trying another
** (background) ** Output from Flat display: Flat Display is now accepting TCP connections on Port 1086y

*** Please verify that the .flat configuration file 
*** specifies the correct port number for the display.

-------- Run the Flat Simulator ---------

 Please set the correct values (hit RETURN to use a default value):
   Host machine for the Flat simulator (arachne.cs.utexas.edu): shadow.csres.utexas.edu
   Name of the Flat program (flat): <cr>
   Directory path to flat (/home/hewett/research/flat-root/flat4/): <cr>
   Configuration file for flat (/home/hewett/research/flat-root/flat4/.flat): <cr>
   Environment description file (/home/hewett/research/flat-root/flat5/env/taylor-level-4.env): <cr>
Confirm Flat command line (ssh -C shadow.csres.utexas.edu '/home/hewett/research/flat-root/flat4/flat /home/hewett/research/flat-root/flat5/env/taylor-level-4.env -config /home/hewett/research/flat-root/flat4/.flat'): <cr>
** (background) ** Flat simulator is running in process 29374
stty: : Invalid argument
stty: : Invalid argument
Executing ssh-askpass to query the password...


-------- Contact Flat and start the demo ---------

Confirm simulator host (shadow.csres.utexas.edu): <cr>
** (background) ** Output from Flat simulator: Reading .bashrc...Sonar will ignore: string "x" 298 170
Sonar will ignore: string "x" 175 93

** (background) ** Output from Flat display: Connection received...display ready.
** (background) ** Output from Flat display: ERROR: /home/hewett/research/flat-root/flat5/env/taylor-level-4.env not found.
** (background) ** Output from Flat display: Unable to load the environment file: /home/hewett/research/flat-root/flat5/env/taylor-level-4.env
Confirm simulator port (1069): <cr>

(START-DEMO :HOST "shadow.csres.utexas.edu" :PORT 1069) 
Enter Y when the Flat simulator display is visible: y


** Flat startup completed.  Continue with demo-specific commands.


[FLAT home]


Author: Micheal Hewett
Email: hewett@cs.utexas.edu
Last Updated: Wednesday, 29 September, 1999