|
Re: [Vision] Multithreading?
We have it running as a separate program on the Driver Station. We use Network Tables to communicate with the RoboRio. It grabs the same picture that is being displayed on the DS for the driver.
when "picture" is 0, the vision program does nothing.
When "picture" is 1, it starts vision processing, and changes the value to "2" to indicate it is working.
When it is done calculating, it sets "Angle", and "Distance", and changes "picture" back to 0.
On the RoboRio, it waits for "picture" to go back to "0". when it sees that, it takes "Angle" and "Distance" and drives there (using NavX).
Rinse, repeat, until Angle and Distance are close enough to shoot.
|