I hope to see a writeup of the method used to do this.
Jerry w
Hi Jerry,
Hey, I like that "brother's keeper" moniker! Pretty accurate!
To answer your question, here's how it evolved...
Single Score:
First, we got the regular autonomous working. Our original system used the camera and searched until it was locked on target. We took the pan angle and used that to determine how "far off" center our robot was pointing. We then called a "rotate" routine repeatedly until we were within an acceptable error range (pointing pretty much right at the target). We then drove forward monitoring that pan angle. If it got too far off, we'd stop, re-rotate and then continue. All this time, the tilt angle kept increasing as we got closer and closer to the target. When we got to the "right angle", we stopped (or backed up if necessary) and then ran the arm through a pre-cap, pre-spear, spear, down, open, unspear set of position calls. That used to take us about 12 or 13 seconds and then later we managed to speed it up a bit (by moving the arm while we were driving) and then had time to drive back "home" with the arm in the "load wall" position ready to receive a tube at the beginning of the match.
One day this summer we got to thinking that we had so much time left after scoring, that maybe we could try for two. The question was how to do it "legally" and as you suggested we went for the "brother's keeper" technique to use our partner's tube for the second run. Here's how that developed...
Double Score:
First of all, we had to get rid of the rotate, drive, rotate, drive technique for two reasons: One it was too slow, and two, it was too hard to "reverse" to get back "home" for that second tube. We switched to using a "power curve" technique that basically added power to the "outside motors" (based on the pan angle), and had the system drive pretty much full-bore towards the light, monitoring the pan and tilt angles the whole time. Once it reached a "close zone", it literally slams on the brakes for about 1/2 second, and then goes into a "fast creep" mode to get to the right distance from the rack. We then use the rotatable shoulder and elbow to make the final correction for angle and distance and reach out (and over) to drop on the first tube on the middle peg. Then it's race back, again at full speed (in low gear anyway - 7 fps or so) back "home" while simultaneously opening the gripper, bringing the shoulder and elbow back to our "load rear" position. When we get home, we "overshoot" by about 6 inches on purpose to "squeeze" the tube into our gripper and then close the jaws and begin to race back. By the way, we use optical wheel encoders to know where we are and track our progress. Okay, so we race back again at full speed and simultaneously swing the arm and tube over the top running for a different set of arm coordinate points going for the top spider. We usually get there right as the arm does, and we brake again, swing over and down and open the jaws. The whole procedure takes almost exactly 12 seconds every time. That's 4 seconds for drive & score, 4 seconds for return and grab, and 4 seconds for drive and score again. The big variable is how long it takes the camera to "lock on" to the target at the beginning of auton mode. That usually ends up being 3 seconds and is one of the big variables that makes or breaks us, the other being if we "catch" the tube when we come back blind.
In practice, such as the practice area at IRI, we often did it 4 or 5 times in a row in under 15 seconds. That was on our homemade rack however which just wasn't designed to be as exact as the real thing. Throw in the variables of the lights on the field (intensity, interference, color), different rack heights, tube inflation levels, rack rotation and distance, and suddenly you're crossing everything you've got hoping it all works out.
Before this past weekend (the night before in fact), we threw in one little fix that really helped. We added some motor bias correction to steer the robot in reverse back much closer to it's starting point, especially when the rack was at odd angles. This helped us grab that second tube a much higher percentage of the time therefore increasing our chances.
Guess that's about it. Kindof a crazy idea, but one of those things where we said, "What the heck! Why not try it!" and it was fun working it out. Plus the autonomous bonus really made it worth working on. Nothing like the temptation of starting out with a 34 to 0 lead to get your juices flowing!
Hope this helps a bit. Cheers!
John