15-494 Cognitive Robotics
Spring 2010
Course Links:  Main Lectures Labs Homeworks

Tekkotsu Links:   Tutorial Resources Wiki Bugs CVS

Cognitive Robotics: Lab 1

Part I: Account Setup

You will only have to do this once.
  1. Log in to a lab workstation using your Andrew userid and password.

  2. Start Firefox by clicking on the globe icon at the top of the screen.

  3. Open a gnome-terminal by going to the pulldown menu at the top of the screen and selecting Applications > Accessories > Terminal.

  4. Run the setup script by typing this command in your terminal window:
    > /afs/cs/academic/class/15494-s10/utils/setup-account
  5. In your gnome-terminal, select Edit and then Profile Preferences. Click on Colors, disable the default system color scheme, and select white on black.
  6. Click on Scrolling and set the scrollback size to 5000 lines. Then click the Close button to save your change.

  7. Logout and log back in again.

Part II: Chiara Familiarization and Powerup

Take a minute to look over your Chiara. Note the id number (1 through 6) taped to the top panel. With the power off, it's safe to gently move the legs and arm, but do not move the gripper if one is installed. (The gripper uses delicate microservos that can be damaged by backdriving them.)

Familiarize yourself with the back panel of the robot. Read the lettering surrounding the toggle switch at the top of the panel. Then follow these steps to boot your Chiara:
  1. Make sure the a/c power adaptor (black plug) is plugged into the Chiara's external power jack.

  2. Flip the toggle switch (system power) to the right. This connects the Chiara to external power. (Flipping the switch to the left would run the Chiara on battery power.) The blue robot power light above the external power jack should come on, and you should hear one short beep from the AX-S1 sensor module.

  3. Power-up the Pico-ITX processor by pressing the round black pushbutton. A second blue light, located above the pushbutton, should go on. This is the Pico-ITX power indicator. The yellow light above it, that should be flashing intermittently, is the disk access light. You should feel a slight breeze coming out of the Pico-ITX fan exhaust port on the top panel.

  4. The Chiara will boot in a minute or two. Connect to it via ssh, with userid "student". If you're using robot #1, then type "ssh student@chiara1".

  5. Start a ControllerGUI running on your workstation. First, make a new tab by typing control-shift-T. Then type:
    > ControllerGUI chiara1
  6. To start Tekkotsu running on the Chiara, type this in the shell on the Chiara:
    $ cd ~/project
    $ ./tekkotsu-CHIARA
    When Tekkotsu has completed its initialization and is ready to accept commands, it will say "Chiara ready". You'll also notice that the ControllerGUI window comes alive and displays a command menu.

  7. In the ControllerGUI menu, go to File Access > Play Sound. Click on a sound file, then hit [Return] to play the sound. (You can also double-click on an item to select and confirm in one step.) Use the Back button to return to the Root Control menu.

  8. Click on the Raw Cam button to to display the current camera image.

  9. Make sure you are back at the Root Control menu, then click on the "H" button (in the Teleop row) to launch the Head Remote Control. This will allow you to move the head around. (You should always be at the Root Control menu when launching any of the other monitoring tools because of a known bug that is too obscure to explain here.) Click on the "H" button again to make the Head Remote Control go away.

Part III: Powering Down

  1. Stop Tekkotsu by typing control-D or "quit" in the console window.

  2. Press and release the large black power button on the Chiara's back panel. This tells the computer to power itself down, which takes about 10 seconds. When complete, the blue computer power light will go out.

  3. Now move the toggle switch back to the neutral position, shutting off robot power and extinguishing the system power light.

Part IV: Walking the Dog

This will give you a chance to play with the Chiara's walk engine. The current one is going to be replaced with something more sophisticated, but what we have now is pretty good.
  1. Unplug the external power cord.

  2. Gently place the Chiara on the floor. Lift it from the bottom by gripping the battery and the big red base plate.

  3. Make sure the legs are positioned reasonably for walking and the arm is out of the way (pointing straight ahead is good).

  4. Power up your Chiara using the battery (flip the toggle switch to the left this time) and start Tekkotsu. Note that the ControllerGUI automatically reconnects.

  5. In the ControllerGUI, click on the "W" button in the Teleop row to launch the Walk Remote Control. Take the robot for a short walk.

  6. When you're done with your walk, power down the robot and put it back on the table. For the next part of this lab we will want to use external power so the battery doesn't run down. You cannot switch from battery to external power without crashing the computer, so power it down gracefully instead.

Part V: Compiling Tekkotsu Behaviors

  1. Go to you project directory (on your workstation - not on the robot):
    > cd ~/project

  2. Copy the standard behavior template to create a new behavior:
    > cp templates/behavior.h MyButtonDemo.h

  3. Edit MyButtonDemo.h to fill in the template for the MyButtonDemo class. Specifically, replace CLASSNAME with MyButtonDemo, and replace DESCRIPTION and YOURNAMEHERE with appropriate text.

  4. In the body of MyButtonDemo's DoStart() method, add the following startup code:

    std::cout << "MyButton is starting up." << std::endl; Put a similar message in the shutdown code in the body of the DoStop() method.

  5. Have your behavior subscribe to button press events in the DoStart(), and have processEvent print a different message for the green vs. the yellow button. (The red button will eventually be used for Emergency Stop mode.) Note that the button offset names used as source IDs in button events are defined in ~/Tekkotsu/Shared/ChiaraInfo.h.

  6. Edit the file ~/project/UserBehaviors.h to add MyButtonDemo in two places: a #include entry, and a MENUITEM entry. Just follow the example for HellowWorldBehavior. Note that since your behavior is in the project directory you don't need to specify a path for it, just #include "MyButtonDemo.h".

  7. In your project directory, type "make" to compile Tekkotsu. If the compilation succeeds without errors, the system will tell you that you may now want to run tekkotsu-CHIARA. But don't run it on your PC.

  8. Power up and boot the Chiara using external power, and ssh in.

  9. To copy your executable to the Chiara, type "getmycode xxx" to the Chiara, where xxx is your Andrew userid.

  10. Once you've copied the executable, replacing the previous version of tekkotsu-CHIARA, you can run it on the robot.

  11. Verify that MyButtonDemo appears in the Root Control > Mode Switch menu.

  12. Test your code by activating MyButtonDemo and pressing some buttons.

  13. When you're done testing, power the Chiara down again.

Part VI: Charging the Battery

If you run the Chiara on battery power, you should recharge the battery when you're done:
  1. Disconnect the external power plug.

  2. Plug the charger cable into the white plug just beneath the external power jack. Set the charger mode switch to 1.8 amps.

  3. Flip the Chiara's toggle switch to the right. The charger's red light should come on.

  4. If you're in the lab and you see that a charger has switched from a red light to a green light, flip the Chiara's toggle switch back to the neutral position. The battery is fully charged.


Dave Touretzky and Ethan Tira-Thompson