View Single Post
  #15   Spotlight this post!  
Unread 22-01-2006, 14:15
Matt Krass's Avatar
Matt Krass Matt Krass is offline
"Old" and Cranky. Get off my lawn!
AKA: Dark Ages
FRC #0263 (Sachem Aftershock)
Team Role: Mentor
 
Join Date: Oct 2002
Rookie Year: 2002
Location: Long Island, NY
Posts: 1,187
Matt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond repute
Send a message via AIM to Matt Krass
Re: Scoring Corner Goals During Autonomous

Not to pop the simple bubble, but I have another idea. AFTER you get something simple working, I say try the camera, the light may not be over a corner goal, but its in the same spot all the time and your camera will be in a fixed spot on your robot. It's actually fairly simple to lock on to the camera and use it to figure out where you are based on the servo values, PM me if you'd like more help, I've already written a simple autonomous mode to go to field waypoints based on the light and camera, you could easily use it to drive up to the corner goal, know for sure you're there and dump, and a properly mounted camera deep inside the robot will probably be less likely to be damaged. And it's honestly not very much more complex, Kevin's camera code does a fantastic job of making it track, you just need to take the information from that and use it to drive, it can be very simple, a proportional control will probably do.

Code:
#define Kgain 1 // Adjust this, trial and error for best results, varies by robot
#define TARGET 160 // This is the servo position you want the goal to be at, also trial and error

signed int pan_error;

pan_error = PAN_SERVO - TARGET; //This calculates a positive or negative error for the target, negative is too far left,  positive is too far right

pwm_XX = pan_error * Kgain;
That's heavy pseudo coding but it illustrates the procedure, Kgain is adjustable for responsiveness and the target position is where the camera points when you're facing the goal from say, the start position. Then you could drive forward until the pan matches a second target for being right in front of the goal, but I'm not sure if the camera can pan that far, but you can use it for initial positioning before just driving up and unloading. Safer and more accurate then bump sensors, but more complex, but not terribly much so, and I'll help you as best as I can if you'd like, just drop me a PM
__________________
Matt Krass
If I suggest something to try and fix a problem, and you don't understand what I mean, please PM me!

I'm a FIRST relic of sorts, I remember when we used PBASIC and we got CH Flightsticks in the KoP. In my day we didn't have motorized carts, we pushed our robots uphill, both ways! (Houston 2003!)