|
Re: Vision target
A few notes on the default camera code:
1. To compensate for the smaller image, you could run the camera at a higher resolution so it can still see it (from a full-field distance the normal target is only a few pixels in the lowest resolution mode, so it won't see the little one at all.).
2. It uses a gyro to angle itself based on the vision data. There is some tuning in this that must be done. Since the target blurs when moving, you can only get frames when not moving.
3. It only ever gets one camera image. You can do a check on the gyro that says something like "when not moving update image and try again" to get closer.
4. Vision processing takes up a TON of CPU. We weren't able to do any vision stuff this year (or last) because the timing of the asynchronous loops would be sporadic, and since PID controls use T, if T is not constant then they will freak out (the gyro also uses T but it is handled on the FPGA, not the main processor). If it is not a problem for you, you could send a trigger to the camera to only process when you need the frames. You could do this by having a Occurrence that you trigger when you want the image, which would trigger the camera code, then have another one to trigger the main loop to use the data. Since Occurrences are triggers, it would be impossible for the camera code to run multiple times on one call as it would be if you passed a Boolean enable bit.
As for the target, we printed an 8 1/2x11 and used it for basic testing of the camera code, then printed a full-size one which we taped first to the wall in the hallway then to the wooden goal when it was built. One of our engineers is in design at Chrysler, so he printed out a big target on paper.
__________________
Kettering University - Computer Engineering
Kettering Motorsports
Williams International - Commercial Engines - Controls and Accessories
FRC 33 - The Killer Bees - 2009-2012 Student, 2013-2014 Advisor
VEX IQ 3333 - The Bumble Bees - 2014+ Mentor
"Sometimes, the elegant implementation is a function. Not a method. Not a class. Not a framework. Just a function." ~ John Carmack
|