|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#14
|
||||
|
||||
|
Re: Quick Question about Threads
Disclaimer: I have little to no experience with vision tracking apart from pseudo discussions with people who do.
I'm not sure there is any need to periodically fetch and analyse an image. For me, I would only get an image when it is needed, and only take one and analyse that. I know for a fact that most of the teams that did well in champs did exactly that. Processing multiple images is just wasting valuable processing power. If it take 2-5 seconds to process one image well, versus doing 10 images in the same amount of time badly, it seems like an obvious decision to do it once thoroughly. Kind of like this: 1. User presses "track" button (mapped to somewhere on the controller) 2. Stop robot, Take picture 3. Send image to a new vision processing thread (or executor) 4. Wait (keep robot stopped) until thread sends speed (or whatever data you need) back to main thread (use thread.join() or object.wait()) 5. Shoot using data This is far more efficient than constantly looking for the target. 100% CPU all of the time can literally slow your robot down. (watchdog, PWM signal sent less) Unless you are using the target to dynamically line yourself up (which would be impressive), I can't think of a good reason to track it periodically. Last edited by joelg236 : 14-12-2012 at 15:38. |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|