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

Tekkotsu Links:   Wiki Tutorial Resources Bugs CVS

Cognitive Robotics: Lab 6 & Homework 5

In this lab you will hand-craft a motion sequence to make the robot pick up and flip a soda can. But we'll start with an easier problem: getting it to nod "yes".

Part I: Calliope Startup

This should be familiar from last week, but since powering up the Calliope is a bit complicated, the instructions are repeated here.
  1. Make sure the netbook is booted and running, and the cables from the USB hub and the Kinect are plugged in.
  2. Unplug the Create power cord.
  3. Unplug the Calliope charger.
  4. If you would like to run on external power (recommended for this lab), plug in the external power adapter.
  5. Turn on the Create by pressing its power button.
  6. Move the Calliope's arm to a safe position.
  7. Power up the Calliope:
    • To run on external power, flip the power switch down.
    • To run on battery power, flip the power switch up.
  8. You may need to run the fix_usb_serial.sh script.
  9. Start Tekkotsu and look for error messages.
  10. Start the ControllerGUI and verify that you can move the pan/tilt and are getting images from the Kinect. Note: it can take a few seconds for the Kinect to sort itself out after powering up.
If you don't already have a Relax sript in you ControllerGUI's script menu (bottom right), give yourself one by going to Root Control > Background Services and clicking once on Relax Behavior to select it without activating it. Then click the Add button in the ControllerGUI window and click "OK". Now this service is available in your script menu and you can use it to relax or unrelax all the servos. Check the Tekkotsu console for a message that tells you whether the servos are relaxed or unrelaxed.

Part II: Posture Files

  1. If you have the Head Controller running, turn it off. Otherwise it will fight with the posture editor. Note: the proper way to turn off any of the GUI tools is to click on the ControllerGUI button that activated the tool. Do not click on the window's close button; that kills the window but leaves the tool running.
  2. Go to Root Control > File Access > Posture Editor.
  3. Straighten the head by setting NECK:pan and NECK:tilt to 0. To do this, click on an effector name such as NECK:pan, then type the new effector value in the ControllerGUI's "Send Input" window and hit Enter.
  4. Click on Save Posture and type lookstraight.pos in the Send Input window. Hit Enter to save the posture. Look at the Tekkotsu console and you'll see that the posture file has been stored on the robot in /home/user/project/ms/data/motion/calliope5kp/lookstraight.pos.
  5. Follow a similar procedure to create lookup.pos and lookdown.pos.
  6. Use the Load Posture command to move the robot to the "look up" posture and then to the "look down" posture.
  7. Copy the files from the robot to your AFS directory by doing the following on the workstation:
    cd ~/project/ms/data/motion/calliope5kp getmyfile robotname project/ms/data/motion/calliope5kp/filename
  8. Edit the files on the workstation to take out all the effectors except for NECK:PAN and NECK:TILT.

Part III: Motion Sequences

  1. Review the lecture notes on motion sequences.
  2. Create a file nodyes.mot that makes the robot nod "yes" by loading posture files to first center the pan/tilt and then move it up, then down, then back to neutral. Note that the speed of the motion is governed by how many millisconds you give the robot to reach its new target position. This robot's "head" has a lot of mass; please be gentle with the tilt servo.
  3. Upload nodyes.mot to the robot using sendmyfile. Install it in the /home/user/project/ms/data/motion/calliope5kp/ directory.
  4. Run Tekkotsu and go to Root Control > File Access > Run Motion Sequence to test out your motion sequence.

Part IV: Running a Motion Sequence From a State Machine

Construct a state machine with a DynamicMotionSequenceNode that causes the robot to say "Yes indeed!" whie nodding its head up and down. Test it on your robot.

Part V: Flip The Soda Can

Do this for homework. Some notes on working with the arm: (a) Do not leave the arm extended for long periods of time. This heats up the servos, reducing their life, and wears down the battery. Instead, use the Arm Controller's "Relax" button to relax the arm when you're not actively using it. (b) If you put too much of a load on a servo, such as by driving the arm into the table or closing the gripper too tightly on an object, you will get a "LOAD ERROR" message on the console and the servo will shut down. You may also see the red error LED on the back of the servo blinking. To correct this condition, relax the arm for a few seconds and then unrelax it.

  1. Place an empty soda can in front of the robot. See if you can use the Arm Controller to pick up the can, then rotate the wrist to flip the can upside-down, place the can back on the table, and move the arm out of the way. The Arm Controller can be awkward to use (we're working on an improved version), so you might prefer to use the Posture Editor instead. But don't run both at the same time or they will fight.
  2. Write a series of postures to position the arm to approach the can, grasp the can, lift the can, rotate the can, place the can back in the same location, release the can, and withdraw the arm.
  3. Construct a motion sequence to smoothly perform this series of actions.
  4. Construct a state machine that performs the motion sequence in a loop. How reliable is the behavior? That is, how many times can the sequence be repeated before it fumbles the grasp and loses the can?
  5. Modify your state machine so that the robot holds the can up and looks at it with the camera to verify that it was picked up successfully. You may want to wrap the can in colored tape to facilitate better can detection. If the can is not visible, the grasp has failed, and the robot should politely ask the human to put the can back where it can find it, wait 5 seconds, and try the grasp again. If the can is visible then the robot should continue with its can flipping behavior.

Part VI: Park the Arm

Do this part if you are taking the graduate version of this class (15-694).

Write a state machine to safely fold up and park the arm without hitting anything. In order to do this you will have to move the arm to a nearly parked position and then relax it to let it settle. Look at how the Arm Controller implements the "Relax" button to learn how to do this; the source is in /usr/local/Tekkotsu/Behaviors/Mon/ArmController.cc.

What to Hand In

Hand in your source code and posture and motion sequence files for each of parts II through V or VI. Due Friday, March 2.

Dave Touretzky and Ethan Tira-Thompson