![]() |
Re: Camera Code Update
Quote:
Here's an overview of one way to go about it. Where it tests for the pan value being greater than the maximum limit, set a flag instead of resetting to minimum. Add a similar test for the pan value being less than the minimum and reset the flag if it is. Where the code adds the step size to the current pan value, have it subtract instead if the flag is set. |
Re: Camera Code Update
1 Attachment(s)
I've uploaded version 2.2 of the bells & whistles camera code. See the attached document for a list of changes. As it's very close to the ship date, I would caution everyone to think really, really hard before ripping open your nearly complete code and dumping my changes in. For this reason I'm not sure if I'll add a link to this code on my website before the ship date. I guess I'll wait to see what the Chief Delphi crowd thinks. As always, please let me know if you find any bugs in the code or documentation. Anyway, here's a link: http://kevin.org/frc/frc_camera_22.zip.
Edit: I found a bug in the search code I published above, so don't use it. -Kevin |
Re: Camera Code Update
I found a bug in the old search code. Not sure if someone has seen this before or not. We have our camera mounted upside down. So, top is bottom and left is right. The camera still tracks the right way because the image is flipped, but the search code looks at the floor instead of the ceiling. When we have the target in front of the robot and elevated a bit, the search code freaks out. As it transitions from its max tilt pwm to its min tilt pwm, it does a diagonal. While traveling this path, it gets a new t packet (I see the red light on the camera flash) as it passes where the light is. As soon as it gets to the other corner, it doesn't see the light anymore, but it continues to drop to the middle tilt search pwm and scan on that level, at which it does not get a new t packet.
This problem will go away when we change the search code to our own algorithm, but I still think it is a bit of a problem. |
Re: Camera Code Update
I'd like to make one suggestion - we've found the common sense says the light is probably closest to the position that you lost at it. If you comment out the "New_Search = 1" line in the old code, the camera will just continue searching from it's current location.
Generally it results in a much quicker lock, because if it was only a temporary loss of the light (say a robot drives in front of you) the camera may well catch the light on the next pan, rather than resetting the tilt completely and starting a new search. This is especially true when the robot is under the light to score. It also fixes the issue some teams are having where the camera "freaks out" and starts doing the tilt down then pan that someone else mentioned here. |
Re: Camera Code Update
Quote:
|
Re: Camera Code Update
Quote:
-Kevin |
Re: Camera Code Update
Does line 365 need to be changed to Tilt_Min?
|
Re: Camera Code Update
Quote:
-Kevin |
Re: Camera Code Update
Quote:
Jason |
Re: Camera Code Update
Quote:
-Kevin |
Re: Camera Code Update
Quote:
Quote:
I realize that this may be confusing, so perhaps I need to consider changing the name(s) to something else. -Kevin |
Re: Camera Code Update
Quote:
Jason |
Re: Camera Code Update
How's it going with this code? Any problems, complaints, etc? Should I go public with it? Does Diet Pepsi taste better that Diet Coke?
-Kevin |
Re: Camera Code Update
Quote:
So far, after small amounts of testing the new code (i.e. seeing if it searches and tracks, and testing the menus), I have not found any bugs. |
Re: Camera Code Update
Quote:
|
| All times are GMT -5. The time now is 00:26. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi