We are trying to make an auto-aim system with our camera. We have looked through the 2016 vision control sample program and are not sure where to start, which parts of the example are required and which aren’t, etc. Has anyone had success with this? If so, how should we go about doing this?
The vision example is a simplified robot framework with a more detailed Vision Processing VI that uses the LED light color and particle processing to describe any targets in the image. If you wish to integrate this, you use the Vision Processing VI from the example in place of the one from the robot.
Once a particle scores high enough on the various tests to be considered a target, there is a subVI that normalizes its position to use a -1 to 1 coordinate system that resembles what a joystick would return. It also uses the bounding box of the particle to estimate distance to the target. There are a number of different ways to estimate distance and position, but the example shows only the one based on bounding box width.
Driving the robot with input from the camera can be done using error term of the target distance from the goal position within the image (this is often the center point of the image). You can then turn the robot to decrease the distance from goal/center. Since camera feedback is often slow, it is advisable to close the loop using a sensor such as a gyro. This means the the target’s position and distance are used to identify the amount to turn and either the gyro or camera are used to measure progress in execution the turn.
Greg McKaskle
Sorry for such a late comment on this, but is there somewhere that I can actually see an example of this being done? I understand the concept but I have been unable to do this in my own Labview code. Most of my attempts have not been successful. Thanks in advance!
There is a great you tube video on labview vision processing. Just search for 2016 frc labview vision
When it comes to actually aiming, I used global variables coming out of the vision processing VI as the process variable going into a PID with the output going to the drive motors.
(This is my first post, I’m not sure if this helps)