Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Camera Code Update (http://www.chiefdelphi.com/forums/showthread.php?t=53984)

whytheheckme 14-02-2007 17:39

Re: Camera Code Update
 
Quote:

Originally Posted by Kevin Watson (Post 578306)
Does Diet Pepsi taste better that Diet Coke?

-Kevin

Duh..... Diet Pepsi (Boycott Coke!!)

Diet Pepsi is the best soda ever!

Jacob

gnirts 14-02-2007 23:42

Re: Camera Code Update
 
Quote:

Originally Posted by Kevin Watson (Post 578306)
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?

I don't know if it's significant, but I found the PWM center values were way too high at the defaults. They are both under 15,000 now (so that tilt goes 0* thru 90* and pan goes -45* thru 45*). Maybe my servos are just mounted funky? And just out of curiousity, how did you decide 90* was enough in the pan direction?

Also, what are your thoughts on adjusting the PWM Pan Center so that 127 causes pixel 80 to be on the center of the bot? Right now, when you square up the camera with our chassis, the actual field-of-view (which we found to be around 42* in the pan direction) is about 75% on the right side of our 'bot. (We have adjusted the Pan Target pixel so that when tracking the camera unit points straight at the target, but now I am thinking that this isn't really desirable. Who cares where it points, you want the mx values on the center of the image sensor, right?)

Other than that, assuming merged the changes correctly into my copy of the code, it works just fine.

Thanks in advance,
Robinson Levin

jdejoannis 15-02-2007 13:22

Re: Camera Code Update
 
Quote:

Originally Posted by gnirts (Post 578556)
Also, what are your thoughts on adjusting the PWM Pan Center so that 127 causes pixel 80 to be on the center of the bot? Right now, when you square up the camera with our chassis, the actual field-of-view (which we found to be around 42* in the pan direction) is about 75% on the right side of our 'bot. (We have adjusted the Pan Target pixel so that when tracking the camera unit points straight at the target, but now I am thinking that this isn't really desirable. Who cares where it points, you want the mx values on the center of the image sensor, right?)

We adjusted the center pixel too. It was at ~40 and we moved it to ~80. The main reason was because we just didn't like the way it looked. But as an afterthought, it will probably be less likely to lose the target and revert to the search pattern. And if the camera looks dead ahead when it facing the light, then you can use PAN_SERVO to drive towards the target.

Jason

PS: see you soon ;)

gnirts 17-02-2007 00:38

Re: Camera Code Update
 
Quote:

Originally Posted by jdejoannis (Post 578804)
We adjusted the center pixel too. It was at ~40 and we moved it to ~80.

Are you sure these are the right values? IIRC the camera has 160 pixels in the pan direction, and the default was at 79. To center our camera on the target ours needs to be about 108.

Quote:

And if the camera looks dead ahead when it facing the light, then you can use PAN_SERVO to drive towards the target.
You still can if you go into pwm.h and adjust the PWM_CENTER value like so:
  1. Put the light directly in front of your robot (but far enough away from it, until its just a few pixels).
  2. The camera should aim to the left or right of it if the pan tracking pixel is at the center of the image sensor (default).
  3. Go into the tracking menu and step the pan PWM until the pan error is as close to zero pixels as you can get it.
  4. Add (127 - pwmValueWithZeroPanError) * 36 to PWM_CENTER for the pan PWM (or subtract. test which one helps).
Now a pan servo of 127 should mean the light is dead ahead (though the camera unit will be pointed away from it).

Is this better than changing the pan target pixel?

Thanks in advance,
Robinson

[note] The value 36 should be replaced with whatever you are using for the pwm gain you are using, but 36 is the default with the new code.

JimGRobot 22-02-2007 19:21

Re: Camera Code Update
 
Thanks for updating the camera code...

One thing that we added to tracking.c were two accessor functions for getting pan and tilt error. We tried using a combination of PWM error and these finer values to control our motors. I'm not sure it helps, but having the functions in tracking.c was convenient.

We had to move the pan_error and tilt_error vaiables from local to file-global to make this work, and added function prototypes to tracking.h.

If you don't want to make this change to your code, no worries, we can just tweak the new version...

Thanks,
Jim Greenhaw
Team 1388


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