Quote:
Originally Posted by kinganu123
You may want to
1. Run ALL the camera stuff in another thread
|
I tried doing that first, but it suffered from the same problem. I thought it was because I wasn't writing the thread right, but apparently that is not so.
Quote:
Originally Posted by kinganu123
2. Hook up the camera directly to the bridge (recommended)
I personally don't how its done (we can't seem to get ours to connect), but I'm fairly certain both are possible
|
Will try that.
Quote:
Originally Posted by shawkinsl
How does the robot behave when you don't run any camera initializing code? If it is still misbehaving, your issue probably lies somewhere else in your code. (look particularly close at your looped methods.)
I also highly recommend opening a new thread for anything that requires delays (or really handles anything graphical at all -- like images from a camera).
|
It behaves normally without retrieving the camera instance.
Quote:
Originally Posted by omalleyj
Code:
camera = AxisCamera.getInstance();
camera.writeResolution(AxisCamera.ResolutionT.k160x120);
camera.writeCompression(30);
camera.writeMaxFPS(1);
You are doing the above only once right (e.g. in the init method or a constructor)? Not in a loop? You should be able to run the camera at a much higher frame rate and not even notice. That said, the other suggestion of running directly through the radio (if you don't need to process images) is a good idea. A separate thread should not be necessary if you aren't actually doing any processing, the getInstance() means you are using the camera's own thread anyway.
|
Yes, just once in the robotInit function, which I know is only running once.
I don't plan on making the main thread do camera work; running it in the main thread was simply to check if the camera was working.
EDIT: By the bridge, do you mean the wireless router, or the cRIO? It was plugged into the cRIO board, and when I connected it to the router, it gave me "[cRIO] AxisCameraParams: connect: S_errno_EHOSTDOWN"