CS 474/574: Autonomous Systems
Documentation Page
Nserver manual
Nomadic's manual for the Nomad200 robot includes a section on
Nserver. If your web browser is configured to handle Postscript
files, you can view it right here. Otherwise, there's a copy
in the /doc directory of the CS474 account; run the
Postscript viewing program ghostview to see it.
Using Nserver
The manual in the /doc directory of the CS474 account
document how the Nserver program supplied by Nomadic Inc. operates.
For the purposes of this class, I've had to modify that operation
somewhat. The command-line syntax of our server is:
Usage:
Nserver [-help -noisy -port ]
where options are:
-help: Print a short help message
-noisy: Load a "noisy" robot setup
-port: Force a port setting
robot.setup and world.setup are optional files which are
used as the robot and world setup files.
Note all options can be abbreviated to the first letter.
Note that there are TWO different robot setups --- an "ideal" robot
which has perfect sensors, and a "noisy" robot which has random noise
associated with sensor readings. By default, the robot is "ideal."
Note that the robot and world setup files are optional.
Thus, if you just type Nserver (assuming you've got your path
set up right), you should get a vanilla, idealized robot.
Running remotely
Since this is a client-server model, it is also possible to run
Nserver on the Linux machines, but do your programming somewhere else
(assuming you recompile the appropriate libraries). If you do, you
have to do a couple of things:
- Create a way for the server and client to connect on the same
port, presumably by copying the .Nserverport file (see the
next section).
- Tell your client where the server is. This can be accomplished
by setting the environment variable SERVER_MACHINE_NAME in
your environment.
A couple of details
A little inspection will quickly tell you that what I've done is to
use a shell script to run Nserver. Why? Well, Nserver uses a
client-server model, with the connection between the two occurring
over a fixed TCP/IP port (7019) by default. This is a problem since,
it is not possible for more than one user to run Nserver. So, I've
made up a scheme for dynamically allocation port numbers. The
port flag bypasses this scheme and "forces" the use of a
particular port.
In order to make this happen, the following games are played:
- The script looks for a file, .Nserverport, in your home
directory. If one is there, it assumes that you are already running
Nserver and quites.
- Otherwise, it tries to find a free port. This is done by looking
in /tmp on your machine to see if there is a lock file indicating
someone is using a port.
- Assuming a port is found, the script runs Nserver with that port
number, and also write a .Nserverport file.
- When you run your program, it looks for .Nserverport and
uses the port number contained in it to establish the connection to
the server.
Obviously, there are many ways for this scheme to go wrong if the
appropriate files are note deleted at the appropriate times. Hence,
understanding this scheme will help you fix up problems, should they
occur.
The Sout Robots
See the scout howto page.
Copyright (c) 1997
Greg Hager,
Dept. of
Computer Science,
Yale University
Last modified Jan. 26, 1997.