Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Java (http://www.chiefdelphi.com/forums/forumdisplay.php?f=184)
-   -   Quick Question about Threads (http://www.chiefdelphi.com/forums/showthread.php?t=110004)

joelg236 14-12-2012 15:36

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.

JesseK 14-12-2012 21:32

Re: Quick Question about Threads
 
Quote:

Originally Posted by joelg236 (Post 1201883)
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.

I can honestly say that properly processing an image well doesn't take even 2 seconds. However, if it did, the good engineer would find the balance of quality vs time. Strategy of a given game may not allow a 2-second waiting sequence if the goal is to have a top-notch performing robot with respect to using vision tracking as part of scoring (auto-aim in '12, 2-tube auton in '11, 5-ball auton in '10, etc).

apples000 14-12-2012 22:16

Re: Quick Question about Threads
 
For rebound rumble, we used LabVIEW to program our robot. We actually found that it was much easier to process about 8-10 images per second and just use a PID loop. The tracking wasn't perfect, but it was simpler to implement than doing the math to figure out the change in angle that our turret needed to have. Also, it was easier to build because our turret never had position feedback and used the image coordinates instead. We were able to sucessfully drive back, tip the bridge, then drive forward and make both baskets lining up using this method, and my goal was to do something similar in Java, which we will use this year.

joelg236 15-12-2012 22:40

Re: Quick Question about Threads
 
Quote:

Originally Posted by JesseK (Post 1201998)
I can honestly say that properly processing an image well doesn't take even 2 seconds. However, if it did, the good engineer would find the balance of quality vs time. Strategy of a given game may not allow a 2-second waiting sequence if the goal is to have a top-notch performing robot with respect to using vision tracking as part of scoring (auto-aim in '12, 2-tube auton in '11, 5-ball auton in '10, etc).

Sorry if that sounded like I was using 2 seconds as some sort of specific number. Like I mentioned, I have no good experience with vision processing and I just used 2 for the sake of the point.


All times are GMT -5. The time now is 11:33.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi