|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#5
|
||||
|
||||
|
Re: How to make Axis Follow a color
The OP said they wanted a robot to track a color, not track a robots color. Maybe he wants to track a ball...
There are quite a few different options depending on what it is you want to do. Some places to start... If you are programming in C++ or Java, when you installed wpilib you should have gotten a few different sample projects. There's a sample project from 2009 called TrackerDemoProject. This program tracked targets based on color, and turned the robot to keep the target in the center of the camera frame. There's another sample project, from 2010 called CircleTrackerDemoProject. This program looks for a circular target and rotates the chassis to center the target in the cameras view. If you are programming in Java, these sample projects are accessed from File --> New Project --> Samples --> FRC Java. Roborealm is a piece of software you get for free (there's a code in the KOP). They have a long list of guides for filtering images in different ways. This program can run on your driver station to offload some of the processing required (so it doesn't slow down your cRIO). If you're trying to track a ball you could threshold the image based on known ball colors, then try to detect an ellipse. OpenCV can be used, you'll need to run this on your driverstation laptop. One way is as a widget in the smart dashboard. See the vision paper that 341 posted here on CD. Another option is to run a co-processor (like a beaglebone on board your robot) on board your robot, which connects to the camera and sends processed data to the cRIO over ethernet. If you couldn't tell, there's lots of options. If you give us more information about your setup (what language you're programming in, where you want to do your image processing, what software you want to use, etc.) we can help narrow things down. Info on what you're trying to detect would be helpful to in describing what algorithm you might be able to use to detect the colored object. Last edited by otherguy : 15-01-2014 at 21:00. |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|