|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
It's our first year as a rookie team and we have some questions about using a servo-mounted camera for ball tracking.
-Can we just use the example "2014 Ball Detection" code provided by FRC, and if so, how do we implement it into our own code? -How would we calculate the trajectory of a ball mid-air? We could do the calculations and come up with the functions ourselves but it seems like a safer bet to use someone else's tried-and-tested code. -Is there anything else I'm overlooking in terms of necessary pieces of code for using the camera to track ball movement? Thanks in advance for the help! |
|
#2
|
||||
|
||||
|
Re: Ball Tracking
As far as implementing the example, I would say re-make what you see in the example wherever you plan to do the calculation.
On trajectory, You may need to take the area and location of the ball for one image, then compare it to the area and location of the next image and the next one and the next one, each making these comparisons to get speed of the ball and/or possibly the direction. Keep in mind your camera would have to be stationary for each image, limiting your movement however long you wanted to perform the calculation. |
|
#3
|
||||
|
||||
|
Re: Ball Tracking
You can import the ball track Project from examples into your robot project. I would recommend however to try and import it into your dashboard project and have the dashboard do the vision calculations on your computer as to not overload your cRIO.
|
|
#4
|
||||
|
||||
|
Re: Ball Tracking
Now I have another question. How do I get the data that gets processed by the code running on my computer (the ball tracking project) about the ball's location to get sent to the dashboard running on the cRIO?
Is there a way to transfer variables/values from applications running on the cRIO to one running locally on my computer? |
|
#5
|
|||
|
|||
|
Re: Ball Tracking
The dashboard tutorial, and in particular tutorial 8 will explain one way to do it.
Greg McKaskle |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|