High-Fidelity Simulator
The High-Fidelity Simulator is a system that works with TeamTalk as a set of virtual Boeing Treasure Hunt configured MOAST robots running in a USARSim theater. Here's a 0:54 video clip of a session with a screen capture of the TeamTalk interface, overlaid with the concurrent Unreal Client video.
Contents |
Components
The following four components make up the high-fidelity simulation system interacting with TeamTalk.
Requirement | Realized By Component | Notes |
---|---|---|
A virtual world with physics | A Windows machine, (or Linux with caveats) running the USARSim server. | The server runs natively under Linux, however compilation can only be done in Windows (or under WINE). The level editor requires Windows and does not run under WINE. |
A human-centric visualization of the virtual world | Another Windows or Linux machine (with a decent video card) running an Unreal client. | The Unreal maps and models cause frame rates to drop to unacceptable levels without a decent video card. We're currently using the ATI Radeon X1800GTO. Conceivably the server and client can run on the same machine, but care needs to be taken as both processes can cause significant CPU loads. In particular the client tends to use whatever resources a particular machine has in order to maximize the realism. |
A camera emulation for the robots | Yet another Windows machine running the Image Server (ImageSrv) | ImageSrv is a wrapper around an Unreal Tournament client. It runs an Unreal Tournament client, and manipulates the virtual position of the client so that images are rendered as if they came from a camera mounted on the robot. The virtual positions can be multiplexed, so that one ImageSrv suffices to serve as multiple cameras (with lower frame-rate). The underlying Unreal client cannot run in conjunction with any other Unreal client on the same machine, so it is not possible to run the Image server on the Unreal client machine. It is conceivable that the Image Server runs on the same machine as the USARSim server or even the TeamTalk tablet; however, one must be careful about CPU constraints. |
Virtual autonomous robots operating in the virtual world | x additional Linux machines running BTH/MOAST | 1 per simulated robot |
Installation and Configuration
Software Requirements
Software Requirements | Required at Build-time by | Required at Run-time by | Notes |
---|---|---|---|
Unreal Tournament 2004 | USARSim | USARSim, Unreal client, and ImageSrv | If you have the Editor's Choice edition, unselect the ECE mods during install. In the examples below, Unreal Tournament is installed in C:\UT2004 on Windows and UTROOT on Linux. |
The NIST Real-Time Control Systems Library | MOAST | MOAST | |
gcc and gcc-c++ on Linux | MOAST | ||
Subversion | USARSim, ImageSrv, BTH/MOAST | We recommend the the useful Subversion Windows Explorer plug-in: ToirtoiseSVN. |
Optional Software
Software Requirements | Required at Build-time by | Required at Run-time by | Notes |
---|---|---|---|
Microsoft Visual Studio 2005 with Visual C++ | ImageSrv | Compiling ImageSrv may be difficult and may not be necessary, see Image Server Installation | |
Microsoft DirectX SDK | ImageSrv | Compiling ImageSrv may be difficult and may not be necessary, see Image Server Installation | |
Simple Direct Media Layer version >= 1.2.8</strike> | BTH/MOAST | BTH/MOAST | SDL is used by MOAST for it's joystick interface. We don't use the joystick controls, so this is not necessary. Modern Linux distributions should already have this in any case (try sdl-config --version). If you're installing SDL outside of /usr/local, be sure to set the SDL_CONFIG environement variable to the path of your local sdl-config file before attempting to build BTH/MOAST. |
USARSim Server
The Linux installation works, but is not recommended because it is complicated by the need to run system compilation under WINE.
Windows
- Install Unreal Tournament 2004.
- Uninstall any previous versions of UT2004
- If you have the Editor's Choice edition, unselect the ECE mods during install.
- Apply the latest UT2004 patch[1].
- Install the USARSim Base Files (Only Version 3.14). These should go into your UT2004 folder.
- Install the AAA_MapBaseFiles[2]. These should go into your UT2004 folder.
- Checkout project-specific code (using subversion)
- http://trac.speech.cs.cmu.edu/repos/teamtalk/trunk/usarsim
- http://trac.speech.cs.cmu.edu/repos/teamtalk/tags/BTH-0.2/usarsim (the latest, 10:07, 31 August 2007 (EDT), stable version)
- NOTE: Subversion will not overwrite unversioned directories, so you'll have to temporarily move or rename the following folders:
- Animations, Maps, Sounds, StaticMeshes, System, Textures
- Once you have the code checked out copy (without overwriting) the contents of the old folders into the new ones.
- Compile.
C:\UT2004\System> make.bat
Linux
Since compilation can only be done in Linux under WINE. Development installations of the USARSim server will require two installations, an installation under WINE for compilation and a native Linux installation for running.
- Load Unreal Tournament 2004. If you have the Editor's Choice edition, unselect the ECE mods during install.
- Under WINE, we run
[~/.wine/d:]$ wine Setup.exe
Install intoUTROOT/ut2004-windows
- For our native Linux installation, we run the Linux installer
[UTROOT]$ cp /media/UT2004ECE/linux-installer.sh . [UTROOT]$ ./linux-installer.sh
Install intoUTROOT/ut2004-linux
- Apply the latest patches[3] for both the wine and native installations.
- Install the AAA_MapBaseFiles[4]. This is only necessary to do for the runtime (native Linux) installation.
- Checkout (with subversion) http://trac.speech.cs.cmu.edu/repos/teamtalk/trunk/usarsim (for the latest, 10:07, 31 August 2007 (EDT), stable version use http://trac.speech.cs.cmu.edu/repos/teamtalk/tags/BTH-0.2/usarsim) into both the WINE and Linux installations. Subversion will not overwrite unversioned directories, so you will need to temporarily move the System and Maps directories before the checkout; then copy (without overwriting) the files back into that directory after the checkout. Here's a line-by-line example for the WINE installation:
[UTROOT/ut2004-windows]$ mv System System.sav [UTROOT/ut2004-windows]$ mv Maps Maps.sav [UTROOT/ut2004-windows]$ svn co http://trac.speech.cs.cmu.edu/teamtalk/usarsim/trunk . [UTROOT/ut2004-windows]$ mv -i System.sav/* System [UTROOT/ut2004-windows]$ mv -i Maps.sav/* Maps [UTROOT/ut2004-windows]$ rm -rf *.sav
- Compile with
[UTROOT/ut2004-windows/System]$ make
The make script will compile USARSim under WINE, and then copy the made files into the native Linux installation.
CMU
Since we already have a dedicated server up and running you may prefer to skip this step and just use that server.
Unreal Client
If you plan to run the client on the same machine as the server (see requirements in High-Fidelity Simulator#Installation Overview), then you can skip client installation. The client is installed with the server. If you're running the client on another machine:
- Load Unreal Tournament 2004
- Apply the latest patch[5].
- Install USARSim-2004
- You'll need to copy the TreasureHunt files to the client. Note that you cannot simply build from the same sources on both the client and server as you might expect. You'll get a version mismatch error that way.
- If you have a Linux server: The Linux server creates a TreasureHuntSim.zip package (which is created in the build process). It will be created in the root Unreal Tournament directory of the server. Unzip it in the root Unreal Tournament folder of the client after every server build.
- If you have a Windows server: The Windows batch file build does not create this package. You should
- Get the TresureHunt distribution from the subversion repository and put it on the client.
- Copy all of the .u files in the System directory from the server to the client after every server build.
CMU
If you're using the dedicated server, it should publish the TreasureHunt package here, http://xxx.speech.cs.cmu.edu/Sim/TreasureHuntSim.zip, just replace xxx with the hostname. Unzip it in the root Unreal Tournament folder of the client after every server build.
Image Server
ImageSrv is a wrapper around an Unreal Tournament client. It runs an Unreal Tournament client, and manipulates the virtual position of the client so that images are rendered as if they came from a camera mounted on the robot. The virtual positions can be multiplexed, so that one ImageSrv suffices to serve as multiple cameras (with lower frame-rate). The underlying Unreal client cannot run in conjunction with any other Unreal client on the same machine, so it is not possible to run the Image server on the Unreal client machine. It is conceivable that the Image Server runs on the same machine as the USARSim server or even the TeamTalk tablet; however, one must be careful about CPU constraints.
Note: Steps 1-2 can be skipped if you've already installed an Unreal client on this machine, and steps 1-3 can be skipped if you've already installed a USARSim server on this machine.
- Load Unreal Tournament 2004
- Apply the latest patch[6].
- Checkout ImageSrv
- For the main development trunk use http://trac.speech.cs.cmu.edu/repos/teamtalk/trunk/usarsim/Tools/ImageSrv.
- For the latest, 10:07, 31 August 2007 (EDT), stable version use http://trac.speech.cs.cmu.edu/repos/teamtalk/tags/BTH-0.2/usarsim/Tools/ImageSrv.
Compile ImageSrv.sln with MSVC++.- The current version of ImageSrv was built against DirectX 8, and is incompatible with the current Microsoft DirectX SDK distributions. As such it cannot be compiled unless one has a working DirectX 8 SDK. Most Windows systems, however, should have run-time DirectX 8 libraries. A compiled ImageSrv.exe is included in the distribution.
- Copy ImageSrv.exe, FreeImage.dll, and Info.html into the System directory.
BTH/MOAST Robots
- Install the NIST Real-Time Control Systems Library from http://www.isd.mel.nist.gov/projects/rcslib/getrcs.html
- Set the RCSLIB_DIR environment variable to point to the RCS directory, and (if installed outside of your normal library load path) append the RCS lib directory to the LD_LIBRARY_PATH. An example in tcsh, assuming that the RCS install prefix was your home directory:
[~]$ setenv RCSLIB_DIR `pwd`
then: if your environment variable field is NOT empty:
[~]$ setenv LD_LIBRARY_PATH $LD_LIBRARY_PATH:$RCSLIB_DIR/lib
OR if your environment variable field is empty:
[~]$ setenv LD_LIBRARY_PATH ${RCSLIB_DIR}/lib
- Get the BTH/MOAST package via subversion.
- For the main development trunk, use http://trac.speech.cs.cmu.edu/repos/teamtalk/trunk/moast-bth
- For the latest, 10:07, 31 August 2007 (EDT), stable release, use http://trac.speech.cs.cmu.edu/repos/teamtalk/tags/BTH-0.2/moast-bth
- Do an SVN Checkout for the treasure_hunt folder, while in the moast-bth directory:
[~]$ svn checkout svn://metropolis.cta.ri.cmu.edu/treasure_hunt/trunk treasure_hunt
-
Copy Makefile.conf.sample to Makefile.conf in PlayManager folder.
[~]$ cd PlayManager/ [~]$ cp Makefile.conf.sample Makefile.conf
- Make. You can safely ignore warnings about SDL (see #Software Requirements).
[moast-bth]$ ./bootstrap [moast-bth]$ make
Configuration
For consistency, the robots can be configured using the same configuration file that TeamTalk uses (see User's Guide#Configuration). You may copy moast-bth/TeamTalkSimulator/peerfile-example.txt (as shown below) into moast-bth/TeamTalkSimulator/peerfile.txt, and edit as needed.
alphie 127.0.0.1:32787 callie safe bashful 127.0.0.1:32788 david dangerous
Running
Keep in mind the following run-time component dependencies when running the Simulation
- TeamTalk -> MOAST/BTH -> USARSim (and Image Server)
- MOAST/BTH -> USARSim (and Image Server)
- Image Server -> USARSim
- Unreal Client -> USARSim
Note that TeamTalk per se doesn't depend on the Unreal Client, the Unreal client is an extra-TeamTalk visualization tool.
Given the dependencies, here's a safe order to run things (followed by TeamTalk).
USARSim Server
- From the System directory, run
Linux
[UTROOT/ut2004-linux/System]$ ./usar_sx.sh DM-RoboticsLab_250
At CMU, this directory exists here: /usr0/ut2004-linux/System/
Windows
C:\UT2004\System> usar_sx.bat DM-RoboticsLab_250
Unreal Client
- From the System directory, run
ut2004 HOST?game=TreasureHunt.TreasureHuntGame?TimeLimit=0?GameStats=False?NumBots=0 -ini=USARSim.ini -log=usar_server.log
where HOST
is the host name of the USARSim server. A shortcut may be useful.
PW=findT
Image Server
Run ImageSrv. Set the server (127.0.0.1 by default) to the hostname of the USARSim server.
BTH/MOAST Robots
Set the USARSimHost environment variable to the hostname of the USARSim server.
Since several computers may be needed, the system may run in a PBS queue, but this is not strictly necessary.
Not in PBS queue
[moast-bth/TeamTalkSimulator]$ ./runSimulator.sh
With PBS
[moast-bth/TeamTalkSimulator]$ ./qSimulator.pl
To close all tasks associated with the simulator:
[moast-bth/TeamTalkSimulator]$ qdel $ticket