![]() |
Vision tutorials
I'm the lead mentor for a small team. The two groups I primarily work with are desing/build and software/drive team. We don't have the size or support to break into design, cadd, build, software, web, busines, and so on. For a summer project we are going to figure out Vision. We found the WPI Robotbuilder command based video to be amazing jump starting our robots abilities beyond anything we've done in the past. We have not found similar tutorials to get use stared. Seems the bits we found assume a lot of previous vision or programing knowledge.
|
Re: Vision tutorials
What is your preferred language?
Do you have a preferred camera to use - axis (more expensive but it seems either more capable or easier to work with or USB camera (cheaper but it seems to me to have some limitations or requires more effort for flexibility/reliability)? |
Re: Vision tutorials
What are you trying to do with vision? Auto aiming can be tricky, but the main ideas boil down to this:
-Use an LED ring (usually green) to reflect off the tape -Set your camera's exposure as low as it will go while still seeing the reflective tape -Create a binary image of only potential goals (in OpenCV, use an HSV filter) detect find all contours -Throw away anything that isn't the goal (check similarity with opencv, aspect ratio, area vs perimeter, etc) -Now comes the tricky part :-). You'll probably want to calculate distance and angle to the tape. Distance can be done using this equation: F = (P x D) / W, where F is your focal length (probably published, but should double check it with this equation), P is the number of pixels wide your camera is, D is the distance, and W is the width. -To calculate angle, you'll essentially modify the field of view equation. The azimuth angle = arctan( ( center point of goal's x cordinate - ( (image width(pixels))/2 - 0.5) ) / focalLength). -The azimuth is the angle your robot will have to rotate to be dead on with the goal Most of this can be accomplished in OpenCV if you are feeling adventurous. We didn't get vision working this year until after competition, but we did it on a raspberry pi with a USB camera. We then sent the angle and distance over networktables to the roborio. If you have any questions about how to do a specific part of this, feel free to ask. |
Re: Vision tutorials
Definitely check out GRIP, I've heard good things and I'm sure it will be even better by the time next season rolls around.
Also, if looking at working code is your thing, I've been accumulating links to robot code, there's a fair amount of Vision related repos in a variety of different languages: https://firstwiki.github.io/wiki/robot-code-directory |
Re: Vision tutorials
I'll try and respond to all your replies and thank you for them.
Quote:
We have a Axis camera on our robot and have available a USB as well. Quote:
What is the best way to acquire the image and process it is what we are looking for. Should we focus on Grip running on the Rio? Should we focus on maybe RaspberryPi? Can the code be integrated into the robot code using OpenCV? I'm guessing lots of trial and error with the different systems is what is going to go down. Quote:
|
Re: Vision tutorials
I am still waiting on someone that does targeting and uses C++ as their primary programming language.
|
Re: Vision tutorials
Quote:
|
Re: Vision tutorials
Quote:
|
Re: Vision tutorials
Quote:
Do you need help with anything specific? |
Re: Vision tutorials
Quote:
We had a USB lifecam connected to a kangaroo running grip connected to the rio via a USB to ethernet dongle to the radio. We had our green LED ring connected to the PCM so that we could turn it on and off. One of our students designed a 3d Printed mount for the life cam and LED ring as well: https://twitter.com/therealsimslug/s...84190541889536 We had issues with the ethernet connection to the rio with the new radio. We were able to run off of the old dlinks just fine. Never quite sorted it out, and never got good enough at shooting high goals to really use our vision code. But GRIP was very easy to set up. Running it on the kangaroo and using the network tables allowed a small enough lag for us to center on the goal OK. I think if we were to continue to pursue vision, I would come back to this set up. |
| All times are GMT -5. The time now is 10:58. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi