Hardware‎ > ‎The Critterbot Robot‎ > ‎

Getting Started with the Critterbot and Disco

This ambition of this page is to give an overhead view of the Critterbot's standard operating procedure, and how you might begin to use the platform for your own research.

(supercedes http://groups.google.com/group/rlai-critterbot/web/critterbot-standard-operating-procedure)

Repositories

Disco:

  • To interact with the Critterbot you will generally need Disco, at least in some form.  Disco is undergoing frequent changes before release, so keep in mind you should update it regularly, any large changes should be announced to the mailing list.
  • Check out disco into your account on gremlin using "svn co https://www-user.cs.ualberta.ca/repos/Disco/branches/critterbot/ disco".  This will checkout the repository to the folder disco.  Change the final disco to a different location if you wish, for instance "code/disco".  SVN will create the final directory for you, but you will have to create any high directories before running the command.  Optionally append "-username yourcsid" to the checkout command if your csid is different from your local username.
  • There is a one-time configuration step that has to be performed after checking out disco.  On gremlin, cd into the repository directory (hereafter referred to as "disco") and type "cp make/LIBSEXAMPLE.d make/LIBS.d".  If you check out the code to an OS X machine, run "cp make/LIBSMAC.d make/LIBS.d" instead.
  • Disco will run fine under OS X as well, if you want to install it on your laptop (OS X or Linux) the same instructions apply, but note the change above for OS X.
  • To compile Disco run "make" from either the "disco" or "disco/bin" directory.  This will take a minute or two, depending on the speed of the machine.
Simulator and JavaDrops (Optional if you plan on writing in C/C++ and don't need the Simulator):
  • Java code, including JavaDrops - the Java Disco interface, the Simulator, and the GUI, are in the Google Code repository.  The recommended package for editing and running this is Eclipse, the following instructions assume you have Eclipse installed, if you want to use something else, you're pretty much on your own.  There are however NetBeans projects for the three main java packages.
  • First you will need to install Subclipse, which provides SVN access within Eclipse.  In Eclipse, go to "Help->Software Updates" or "Help->Install New Software", and add a new update site, "http://subclipse.tigris.org/update_1.4.x", it is important not to use SVN version 1.6, as updates made to the repository from 1.6 are not backwards compatible with the version most people are using right now.  Check all the options from the Subclipse update site and choose Install.
  • Follow the instructions to install and restart Eclipse, then go to "File->Import" and choose "Checkout Projects from SVN".  Next choose to create a new repository location, and enter "https://rlai-critterbot.googlecode.com/svn/trunk" as the location.  It will prompt you for your Google Code username and password, which can be accessed by going to "http://code.google.com/p/rlai-critterbot/source/checkout", signing in, and following the link to see your password.  This is NOT your normal Google password.  It is suggested to let Eclipse save your password so you don't have to keep looking it up.  If you are not a member of the Google Code group you will not be given a password but allowed to checkout read only.  Contact someone to get write access to the repository.
  • You will then be presented with a list of folders, first choose JavaDrops and select Finish, it should import the JavaDrops project into Eclipse.
  • Repeat from "File->Import", selecting the saved repository location, to import both the GUI and the Simulator.
ARM Firmware (Very Optional):
  • The ARM code currently is built from the command line, although it would be relatively trivial to import the project into Eclipse.  Checkout the code using "svn co https://rlai-critterbot.googlecode.com/svn/trunk/firmware/arm firmware_arm".
  • To build you will need the arm-elf-gcc cross compiler installed on your machine.  Be aware it does not currently appear to be possible to compile for a 32-bit target on 64-bit systems with much success, so double check before installing.  Good sources for the arm-elf-gcc toolchain are "http://www.gnuarm.com/" and "http://www.mikrocontroller.net/download/".
  • Make sure the command arm-elf-gcc is available to confirm the cross compiler was correctly installed and added to your path.
  • From the "firmware_arm" directory run "make bin", this should compile and link the arm code, and report back a binary size.  If something goes wrong look into your toolchain installation.  The maximum size you can currently send to the ARM is 40,000 bytes.
AVR Firmware (Very Very Optional):
  • You will need to install avrdude and the avr-gcc toolchain on your computer.  For OS X there is a convenient package you can download from "http://www.obdev.at/products/crosspack/download.html" that will install these utilities. 
  • You will also need the Eclipse CDT framework.  "http://www.eclipse.org/cdt/downloads.php" has links to Eclipse update sites, make sure you select the link for your version of Eclipse.
  • Finally you want the Eclipse AVR plugin, the update site is "http://avr-eclipse.sourceforge.net/updatesite/".
  • Once these are installed you can import the folders "trunk/firmware/avr/CritterbotAVRMotor" and "trunk/firmware/avr/CritterbotAVRPower" from the Google Code repository.  Each of these folders is its own Eclipse project.  Switch to the C/C++ perspective in Eclipse and click on the hammer icon to build each project respectively.

Startup
  • If the robot is connected to the charger and fully charged (GREEN lights in a complete circle,) unplug the charger.
  • If the robot is charging, (YELLOW lights in a partial circle,) wait for it to finish charging.
  • ssh into the robot's on-board computer, Walter, "ssh root@walter" from gremlin
  • Make sure the ARM in is Machine Interface mode, run "arm_mi"
  • Disregard the next bullet point temporarily, due to a bug we're trying to resolve.  Start the Disco Control process in a new terminal on gremlin.  From the "disco/bin" directory, run "./Control.bin -x robot.xml -u 10.0.1.20", -x specifies the XML file to run from, -u specifies the IP address of the machine you are running on.  If you want to log data, create a critterlog directory in your home directory, and change the line at the bottom of robot.xml to <logger logDir="/home/youruserid/critterlog">.
  • Start the Disco Control process in a new terminal on gremlin.  From the "disco/bin" directory, run "Control -x robot.xml", -x specifies the XML file to run from, -u specifies the IP address of the machine you are running on.  NOTE:  There is purposefully no ./ in front of Control and no trailing .bin.  The command Control is aliased to run from user critterbot's Disco repository, so logfiles are always created in a standard way.  The xml file however is referenced to your local directory.
  • Start the robot interface on Walter, "Robot" at the command line.
  • Type "send" into the terminal running Control, if everything is working you should see regular printouts of sensor data from the robot.  NOTE:  The Control window is an odd interface, especially once the robot is running, control will every second or more spit out some general status data.  Since there is no prompt, as soon as you type a character or two they tend to disappear.  Regardless of what appears on the screen, typing send can best be thought of as the series of keystrokes "s" + "e" + "n" + "d" + "Enter".  As it listens to all input before the Enter key, if you make a typo, just hit Enter to clear the input.
  • All of this data will be automatically logged in "/var/critterlog/year/month/day/hour.crtrlog"
  • Optionally, to connect the Joystick (do not do this at the same time you have an agent connected, they will compete for control,) make sure the joystick is plugged in to the front of gremlin, and in a new terminal in the "disco/bin" directory run "./Process.bin -n Joystick -u localhost"  If you get an error about not finding a joystick, try unplugging and plugging it in again.
  • Type "send" into the terminal running Control. You should be able to move the robot around with the joystick
Agents

Disco:
  • To run a C++ agent written within Disco, open a new terminal on gremlin and from the "disco/bin" directory run "make" to make sure the latest version of your agent has been compiled.
  • Now run "./Process.bin -n AgentNameHere -u localhost" and type "send" in the terminal running Control.  Your agent should start and be in control of the robot.
  • Your agent can be edited and recompiled while Control is running.  Just kill your agent, recompile, and follow the instructions above again.
  • For more information about using Disco, see the Disco Documentation page.
Java:
  • Once Control is running it automatically starts a TCP server on port 2330, Java (or any other language) can connect to this port and send/receive data from the robot.
  • Just start your java agent and it should start running.
Comments