Tuesday, January 31, 2006

Starting to see the light?

Y'all, good job today. Shirin, Chris and I worked on getting the turret to move a little less violently and prevent constant smackdown of the limit switches. With a very low value of pwm02 = 123 for CCW motion and a higher value of pwm02 = 142, we worked out the bias from the van door motor. Sort of . . .

For tomorrow: There's a zip file on the IDEO FTP site named 2006_EM_013006.zip. Download it if you're interested in seeing where we are.

So here's the deal. Rather than wading through the 'bells and whistles' version of the vision camera code, I've made an attempt to take the default code that we're familiar with and integrate it with the streamlined camera code. What does that mean?

1. You need to put in the default calibrated values into camera.h. You have those values now right?

2. I essentially took the 2006_EM_011506.mcp project and added the following files from the frc_camera_s.zip: camera.c, camera.h, terminal.c, terminal.h, serial_ports.c, serial_ports.h, and finally tracking.c and tracking.h which I actually don't use but are necessary for terminal.c to run.

3. You realize that you can learn and do a lot by just looking at TERMINAL.C. Please open it up and look at what it does. It's the function that prints the current state of a slew of camera values to the screeen every few seconds.

Okay, so what do you see printed to the screen?

- pan angle
- tilt angle
- pan error
- tilt error
- blob size
- confidence

What do all these things mean? Check page 34 and 35 of the CMUCam2 Workbook, and since all of you programming fans have read the ENTIRE manual already, this will be a good refresher .

So think about your basic strategy here. You just want to continue with your turret panning until all the following conditions are met (for example):

- your pan error is below a certain allowable value
- your tilt error is below a certain allowable value
- your blob size is above a certain desired value
- your confidence is above a certain desired value

Pan pan pan, search search search, and when all the above conditions are met. STOP EVERYTHING. STOP ALL YOUR MOTORS and shoot the darn ball!!

I hope 'nested if statement' is at the tip of your tongue!!! Is it?? Is it??!

The code I've included compiles, but since we don't yet have any hardware to plug it into, I do not vouch for its ability to actually do anything productive and I am not guilty if it results in personal harm or property damage.

Most interesting to look at user_routines_fast.c to start with.

Good luck,

Em

0 Comments:

Post a Comment

<< Home