View Single Post
  #2   Spotlight this post!  
Unread 30-01-2016, 23:00
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,751
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Auto Aim with Camera

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
Reply With Quote