|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
Re: Usb camera
Here is a grip file to help you get started.
It does a half decent job of detecting targets. You might want to play around with contour areas and rgb stuff. I also uploaded some sample picture that you might want to play around with it. Use network tables to use it in the java code |
|
#2
|
|||
|
|||
|
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. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|