|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools |
Rating:
|
Display Modes |
|
#9
|
|||||
|
|||||
|
Re: pic: Team 341 presents Miss Daisy XI
Quote:
2. It's a Core i5 with 6GB of RAM. 3. Camera data goes robot -> laptop through the wireless link to the Driver Station. Computed outputs go back through the link to the cRIO using WPI Network Tables. 4. I'll post our full code after the competition season has begun. For achieving basic throughput between camera, laptop, and cRIO, you can use the example square tracker that comes with the SmartDashboard installer. Here is our basic algorithm: 1. Convert image to HSV color space 2. Perform thresholding in HSV (enforce minimum and maximum hue, minimum saturation, minimum value) 3. Find contours 4. Take convex hull of contours (this is the step that helps ensure that partial obscuration from the rim/basket doesn't kill us) 5. Perform polygon fitting to contours 6. Filter polygons based on (a) number of vertices, (b) aspect ratio, (c) angles of horizontal and vertical lines. 7. Select highest remaining polygon as the top target. 8. Compute angle from camera center to target center and add this to the current robot heading 9. Command the new heading to the robot (it uses gyro and encoders to achieve this heading) 10. Compute range based on trigonometry comparing center of camera axis to center of target height 11. Command shooter RPM setpoint based on linear interpolation of a lookup table The code has been very carefully optimized to reduce the allocation/deallocation of dynamic memory between subsequent calls, which is what lets us operate at breakneck speed. This also involved a lot of debugging to hunt down latent memory leaks existing somewhere in the layering of OpenCV/JavaCV/WPIJavaCV APIs. |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|