|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Controlling Servos for Vision Targeting
So, I've been working with the code from the FRC Examples on vision processing, and am currently trying to set up a servo-mounted camera to track the vision targets on the high goal. The camera identifies targets just fine, but I'm having trouble getting the pan/tilt module we have to follow the target around as it moves. Most of the things I've tried so far haven't yielded any useful results, anybody out there that's done this before have advice on how I can get this to work?
|
|
#2
|
||||
|
||||
|
Re: Controlling Servos for Vision Targeting
The update rate and processing lag are too large to do feedback control on an image target. You will need to use the image to figure out where to go, and then use other sensors to track how well you are getting there.
Search CD for Vision and Gyro or Vision and IMU and you will find some very active threads that will give you a good start on this. |
|
#3
|
|||
|
|||
|
Re: Controlling Servos for Vision Targeting
The default code and example code from 2009 did a gimbal'd camera. They used a very low image resolution and you really have to be careful to keep the vision loop running fast, but you can make it work. The examples were shipped in 2012 and maybe 2013. I can post them if necessary.
Comparing this to a gyro for closing the loop, the gyro is still an order of magnitude faster than well written vision code. So be sure to keep that in mind. Greg McKaskle |
|
#4
|
|||
|
|||
|
Re: Controlling Servos for Vision Targeting
Quote:
|
|
#5
|
|||
|
|||
|
Re: Controlling Servos for Vision Targeting
It is called servo camera.zip and I uploaded it to ni.com/frc under the documents tab.
Greg McKaskle |
|
#6
|
|||
|
|||
|
Re: Controlling Servos for Vision Targeting
Using GRIP to detect the targets and publish the centerX, I created a simple test program to basically say, if the target is too far to the right, move the camera to the right, and if the camera is too far to the left, move the camera to the left.
You just need to create a threshold say like 140-160 pixels for a 320x240 image to call the center. Last edited by iSpotix : 29-01-2016 at 12:30. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|