Basic Simulator Help: Getting started

Overview

To run the system you must first get the code. To get the code, you follow two easy steps as specified in Getting the code. You then compile the code, and finally run it.

Getting the Code:

The code is located in a CVS repository on calvin.prodigy.cs.cmu.edu. CVS is a code repository system that maintains all the previous versions of the code. It also maintains a list of log files with each checked in version. You can check out old versions of the code in cases where something got badly broken or compare your changes to what is in the repository. When there are lots of people working on a project, this can be a very useful tool. For more information about CVS do a "man cvs" command or look at the CVS home page.

To get the code for a fresh check out on a new machine you need to first set up some environment variables. For the lab machines this is already done. The two environment variables are CVSROOT (where the repostiory is located), and CVS_RSH what to pipe CVS through. We are goign to use ssh. This requires you to have an account on calvin. To set up your environment variables in zsh type:

~/mydir> export CVSROOT=:ext:calvin.prodigy.cs.cmu.edu:/home/small/repository
~/mydir> export CVS_RSH=ssh

If you are using tcsh or csh, execute the following instead:

~/mydir> setenv CVSROOT :ext:calvin.prodigy.cs.cmu.edu:/home/small/repository
~/mydir> setenv CVS_RSH ssh

if you are not sure what shell you are using type echo $SHELL to find out. You can change shells with chsh command. You need to know where the shell is located however.

Now to check out the code, execute:

~/mydir> cvs co dragons

This will get you a copy of the code, all under teh dragons directory. To now make the code go to the making and compiling help.

Other CVS commands of use are:

  • cvs upd -d -P to update your code. If you want to see what update will do without actually doing anything, execute cvs -n -q upd -d -P. Update will update your code, if it can, with changes from the repository. You will see files listed as U somefilename. The character at the front tells you what kind of update happened. The different types are:
    • U - your file was updated
    • ? - CVS did not know about this file
    • M - your file was merged with teh changed repository
    • C - your file conflicts with the repository. This means someone else changed the code underneath. Use cvs diff to find the differences.
  • cvs diff < filename > find out the differences between your file and a file in the repository
  • cvs log < filename > display the log file for a given filename
  • cvs commit < filename > commit a file to the repository. Do not do this without first checking with one of the porject leaders!!!

Finally, if you want to set up your environment variables for CVS automatically, put them in your shell rc resource file. This is located in your home directory (ie ~/.) with the file name of .zshrc for zsh and .tcshrc for tcsh and so on.

If you have problems with cvs email someone for help like brett , Jim , or Mike for help.

Compiling/Making the Code:

To compile the code you need to go to the top-level dragons directory and run make. This will automatically make all the submodules and link the binaries located in the bin directory to the appropriate executables.You will then get a whole lot of output. If you get any errors the make program should halt andreport what that error was. If it was a fresh checkout/update then something is wrong and you should contact the Brett with the make error output as part of your message.

If you run make in one of the subdirectories it will only make the stuff in that directory. Make will symlink all the executables to the bin directory

Running the Code:

To run the code go to the bin directory. I usually run with 3 windows, one for each executing program.

  1. The first step is to run the simulator or the rsever. The ./simulator runs the simulation package and the ./rsever runs the real robots and must run on calvin. Both have various command line options. Run them with -h to find out what the options are.
  2. Next run the main soccer program from the bin directory. Do this by executing ./soccer in the bin directory. If you are not running soccer on calvin you need to specify what machine it can connect to to find the rserver or simulator. You do this via the -V < host > command line option. As with all programs -h will list all the options.
  3. The next step is to run the GUI. This can be done from any machine. Execute the command ./gui from teh bin directory to start it. If you are not running on calvin you need to specify what machine to connect to for vision -V < host > and soccer -S < host >
  4. Now choose the players by clicking on the yellow and blue tool bar icon (this is meant to be a team of robots). Hold the mouse of the button to get the tool tip if you are not sure. When you click this a side panel will show up that has a range of edit boxes. Type how many opponents you want. Then type the robot cover ...something like:
    • Diffbot 0 enter cover 1 and click the check button 
    • Diffbot 1 enter cover 2 and click the check button 
    • Diffbot 2 enter cover 3 and click the check button 
    • Omnibot 0 enter cover 4 and click the check button 
    • Omnibot 1 enter cover 5 and click the check button

    Then click set. You should get 5 robots appearing on the field with however many opponents you selected.

  5. To move them by hand click and drag with the left mouse button. To orient click and drag with teh right mouse button. To get them to go to a point click and drag with the middle mouse button To drive them manually click on one and use i, k forward and backwards, j, l sideways on the omnibot a, s turn left and right
  6. The debug level controls the debug display. It is something like:
    • 10 allows all - kalman filter position, obstacle avoidance, kicking 
    • 5 or 6 - obstacle avoidance and kicking
    play around with it and see what you get.
  7. To run a particular tactic type the name and its parameters in the tactics box. To run the team type strategy 4 3 2 1 0. Click on the GC toolbar icon to get the game control panel. Then click move to kickoff us or kickoff them. Then click start to make it all happen. Currently the opponents don't actually move....this is going to happen soon.

Brett Browning
Last modified: Thu Oct 24 19:07:13 EDT 2002