Coordinated Construction Robots

From DRLWiki

Jump to: navigation, search
The robots assemble a structure in the Holodeck.

While working on this project, the robots are both the only friend you have and the only one you can blame when things go wrong. This produces a very awkward relationship.

Contents for This Page

Inverse Kinematics

Inverse kinematics is the mapping of coordinates in the world to the joint angles the robot should use to reach that location. For full details, see Coordinated Construction Inverse Kinematics.


Holodeck Setup

To begin, push the button on the Vicon box to turn on the motion capture. After the machine has started up, log into the center computer and open ViconIQ. Click the "Calibrate" button in the top bar, and then the "Load calibration..." button in the lower right. Load the following file:

C:\Documents and Settings\enneirda\My Documents\Roomba Assembly Configuration\test_database.eni\Adrienne \Roomba_1\Static_test\Session1 cal

If everything has been done correctly, the motion capture will begin automatically. Finally, log onto the third (Ubuntu) machine. Edit the file so that it only contains the robots that you'll be using (dab=2, dac=3, etc.) and then run it.

Robot Setup

Each robot has four batteries.

  1. iRobot (Roomba) battery - use the charger in the Holodeck. It's the yellow thing on the underside of the Roomba, you can remove it to test it on other Roombas.
  2. Dell Netbook battery - use the charger in the Holodeck (the one with the little LED on it)
  3. Arm battery - rechargeable, shared battery packs with the flyers. IMPORTANT: if you run these batteries down too low you will not be able to recharge them, so always recharge them at the end of the day.
  4. 9V - used for the gripper, when low throw away and get more from the supply room

To start, unplug the two battery chargers, move the robots to the center of the room, and plug in the other two batteries. Then, ssh into the robots from the Dell laptop on the table next to the other systems. For convenience, there you can use the command


where X is the robot number. That way, each terminal will be a different color and you don't have to remember the IP addresses of the robots.

The code is located in ~/robot_assembly_repo/newTrunk. Once in that folder, run
svn up
so that you have the latest code, and then compile the code with
You will need to rerun ant every time you make a code change, or else you'll still be running your old code. When you're ready to run the robot, run
java brain.<brain file here>
where the file is the file that your robot brain is stored in, without the .java. Press enter. The robot should begin its startup sequence, the arm should spring into motion, and you should hear some tones. When everything is ready, you will be prompted to hit any key (enter) to begin the program.

If something goes wrong, check out Troubleshooting below to try to figure it out.

Recalibrating Robot Models

If you need more accuracy or it seems a robot model is not calibrated right, you may need to recreate the robot models.

Before you open Vicon IQ, navigate to

C:\Documents and Settings\enneirda\My Documents\Roomba Assembly Configuration\test_database.eni\Adrienne \Roomba_1\Static_test\

And rename every model that you're going to replace by adding a .bak onto the end of the filename (or some way to preserve them as a backup). Then start Vicon IQ normally and load the calibration.

Position your robot such that it is at the origin - that is, it has 0 for its x, y, and theta in the world. You can not use the Vicon data for this, since the old model is not properly calibrated and isn't loaded anyway. You have to figure out a creative way to position your robot at (0,0,0) on the Vicon IQ grid. You might use some loose markers to line it up, or change views to make sure everything is lined up properly... just be creative. You can be very precise if you do this step carefully.

In Vicon, you will see that the program no longer recognizes the markers as your robot. This is because it no longer has access to the model file. When you are sure your robot is at (0,0,0), go to the Capture screen and on the right tab list choose "Create/Edit Models". Click "Begin Editing" and then highlight the markers attached to your robot. Make sure you do not have any other markers selected, and push the dot button next to "Create Object". Name your robot the correct name (THIS IS VERY IMPORTANT! If the model is not one of dab, dac, dad, or dae, it WILL NOT WORK!) and choose the color that you want for the robot. Hit Ok, and then "Create Object".

Next, click on "Object" near the lower-right hand corner of the screen, and set Object Global Position to (0,0,0). Then press "Save and Apply".

Click on the Modeling screen, and then File->Open the model file you just created. Your model should appear on-screen. On the left pane, under Segments, choose the model that you just made. In the lower-right, rename it to "Root". If you don't rename it, the xBee computer will not know what to broadcast. Once you've renamed it, File->Save. Your model is now ready, but you will probably have to reload it by unchecking and checking it in the Active Objects pane.


Program hangs / arm is stuck

The most immediate problem is that the arms will often get locked when you kill the program, resulting in a stalled/frozen program the next time you run the code. To fix this, kill (ctrl-C) the program, then unplug the arm (black) USB cable from the netbook. Plug back in, and then try to run the code again.

Bad position data

This means that the robot isn't getting valid position data from the xBee transmitter. This could be due to a number of things.

  • Are all of the robots in the center of the Holodeck? If one wanders out of range of the cameras, you won't be able to gets its position data.
  • Did you edit the shell script on the Ubuntu folder to only include the robots you're using? It might be looking for robots that you don't want to use and therefore are under the canvas.
  • Did one of the systems freeze/crash? Make sure that the ViconIQ on the Windows computer and the shell script on the Ubuntu computer are still responsive. Restart both if necessary.

TooManyListenersException / arm keeps resetting

Not a clue why this happens, but restarting the netbook fixes it.

Script on UFO (Ubuntu) computer won't run or has a segmentation fault

This happens when the computer can't find the xBee module that's attached to the computer. Unplug the xBee module USB cord plugged into the computer, and then plug it back in. Wait a few seconds, and the program should now run without a problem. If it doesn't open up a command prompt and try running the script that way. If it still doesn't work, ensure that Vicon IQ is running properly and connected to the Vicon system.

Roomba isn't moving

Make sure that the Roomba is on. If it is on (at least one green light is on), trying pushing the button with the "play" symbol. The robot should play some notes and begin to move.

If it DOESN'T move, then something is wrong with the Roomba itself - likely a battery issue. Switch out the battery with one of the others and see if it works.

If it DOES move, then you've got a communications issue. Unplug all serial and USB cables and plug them back in. Try restarting the computer.

Gripper isn't seeing anything

The most frequent cause of this is a broken cable between the gripper IR sensor and the controller board. To replace one of these you will need four parts:

  • Connectors. There are spare ones in the lab, but if you need to order more they're Molex 51021-0400
  • Crimpings. There are spare ones of these in the lab, but if you need more try to find ones that fit the specs of the above connectors.
  • Wire. There's a spool in one of the covered shelves at the west end of the lab.
  • Crimper. Eduardo is the only one that has one that works for this size.

See Also

Personal tools