Go to Post Every team in FIRST can make this choice. Be positive, help others, and work like a maniac behind the scenes. This approach will bring you joy and satisfaction, whether you win or not. - OZ_341 [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 28-03-2016, 15:44
ARaine ARaine is offline
Registered User
FRC #2834
 
Join Date: Feb 2016
Location: Michigan
Posts: 5
ARaine is an unknown quantity at this point
Re: Usb camera

I found that using the vision to directly control a motor was too slow. By using a gyro, I calculated (roughly) the angle needed to rotate so that the center of the target was on the center of the camera's vision.

The calculation was:

arctan([Distance of center target to center vision] / [Constant])

The constant is just a value that I found through experimentation (around 300, may be different for you). This method only works if you have a gyroscope because I then took that calculated angle and plugged it into a PID loop to rotate the robot based on a gyro reading.

I had some success with this in autonomous by performing this operation twice.
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 09:31.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi