Shapebugs

Software

Download

[swarm-2.2.tar.gz] Swarm 2.2 simulator (www.swarm.org)
[shapebugs.tar.gz] Shapebugs (Updated August 20, 2005)

Installing Swarm 2.2 simulator

The user must first install (or verify the availability of) appropriate versions of the needed software in order to provide a proper compilation and execution environment for Swarm. We no longer maintain an up-to-date archive of the packages needed by Swarm, as they are readily found on the web. The list of packages needed by Swarm 2.2 is:

  • Tcl/Tk -- either built from source or using -devel binary packages on your favorite distribution
  • BLT 2.4z, not 3.0
  • libpng 1.2.5
  • zlib 1.2.2
  • xpm-4.2 (or the xpm-nox package for Cygwin)
  • X11R6 on Linux and MacOS X (with SDK)
  • Optionally, HDF5 1.6.2
  • Optionally, Java SDK 1.4.2
  • GCC 3.4.4 with Objective C (gcc-4.0 is preferable particularly on non-x86 platforms such as PowerPC, Alpha etc..)
  • GNU Make

Once the environment has been set up, and the source downloaded and de-tarred into an appropriate directory, the user should consult the README and INSTALL file to learn what options should be specified to the configure script that configures Swarm to the local system. Compilation and linking are done using make as usual, after this step.

You also need an explicit make install step, after the initial make build to cleanly install Swarm to an appropriate location (for example /usr/local). This is explained futher in the README and INSTALL files contained in the distribution.

After compilation and installation of Swarm a set of program libraries and header files against which Swarm applications can be compiled and linked is available.

Installing Shapebugs

First, install the Swarm 2.2 simulator as described above. Unzip the Java source files and the included makefile. Make sure the appropriate environment variables are set up. JAVA_HOME should point to a current version of Java, and SWARMHOME should point to the Swarm software directory as described in the README file that comes with the Swarm 2.2 distribution. Run make to compile the Java classes into a single binary executable.

Running Shapebugs

The Shapebugs program can be run in graphical mode or batch mode. In graphical mode, the usage is:

jshapebugs.exe <shapemap.bmp> <obstacles.bmp> <#bugs> <movErr> <proxErr> <intv> <window> <outFile>

In batch mode, the usage is:

jshapebugs.exe <shapemap.bmp> <obstacles.bmp> <#bugs> <script>

The command line arguments are all required. A brief description of their meaning is below:

shapemap.bmp 1-bit B/W bitmap that specifies the shape to aggregate into
obstacles.bmp 1-bit B/W bitmap that specifies impenetrable obstacles in the landscape. Must match the size of shapemap.bmp. If no obstacles are desired, you must still supply a solid bitmap with no obstacles specified on it.
#bugs The number of bugs to put on the world
movErr Movement error. Described in relation to the step size. i.e. if the robot takes steps of 3 units and movement error is 0.5, then each step may have an error of up to 1.5 units.
proxErr Proximity sensor error. Described in absolute terms. i.e. a proximity error setting at 3 units means the sensor has noise up to 3 units in magnitude regardless of the maximum range of the sensor.
intv Trilateration interval. Specifies the frequency of repeated trilaterations.
window Trilateraton window size. Specifies the number of trilaterations to average over when deciding on a position.
outFile Blank file to accept program output text.
script In batch mode, movErr, proxErr, intv and window can be specified in a batch script for multiple runs with different values.