![]() |
Camera Vision Processing
Hi,
in my code i have Code:
public void operatorControl(){ |
Re: Camera Vision Processing
You can't rely on the loop being executed every 10ms, it's bound to change as you put in more code (especially image processing). If you wanted to do something every 200ms, you might do something like this:
Code:
import edu.wpi.first.wpilibj.Timer; |
Re: Camera Vision Processing
You might try running the image capture in a separate thread. I've had sketchy luck with threads and FRC Java, but your mileage may vary.
|
Re: Camera Vision Processing
Like what jesusrambo said, running in a seperate thread might actually be a good idea... (Thanks rambo! ill try it). I don't think that overhead would be a problem as long you aren't using a seperate thread for each motor or something unsynchronized as that... If you need help on image tracking ill be more than happy to help. I haven't used the javacv that everyone seems to be raving about but with the image processing functions tat FRC gave us i was able to successfully track imagery.
|
Re: Camera Vision Processing
Im not sure what you guys mean by running it in a seperate thread
|
Re: Camera Vision Processing
1 Attachment(s)
Quote:
If you don't stick a piece of particularly long running loop in a thread (say, one that deliberately waits for 5 seconds before it finishes executing), the rest of your program will get stuck on it, and your other code, like your drive/shoot code will stop executing until the 5 seconds is done. Read this piece of documentation on how you can implement this in Java: http://docs.oracle.com/javase/tutori...l/concurrency/ |
| All times are GMT -5. The time now is 09:57. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi