![]() |
Camera Lag
My team is wanting to use a camera on our robot this year. We are using the Microsoft LifeCam 3000, and it works fine. However, there is about a one second delay. This makes the camera only barely useful. Anyone have any ideas how to reduce or eliminate that lag?
|
Re: Camera Lag
We haven't seen a lag anywhere near that long when we did the simpleVision and intermediateVision java examples (we haven't gotten very much farther than that yet). We were able to get what we could believe was 30 fps at 640 pixels across over twisted pair with perhaps a tenth of a second lag (when someone spoke, it looked like a poorly dubbed movie). We haven't tried wireless yet.
|
Re: Camera Lag
Likewise, the MS camera has been extremely responsive for us. There's a delay like you would expect - 100-200 ms.
|
Re: Camera Lag
What are the camera settings and dashboard settings? What bandwidth does the dashboard report?
Greg McKaskle |
Re: Camera Lag
Code:
CameraServer.getInstance().setQuality(50);THANKS! |
Re: Camera Lag
The vision white paper a few years included info on camera settings and how they affect the image and the size.
The summary is that compression will reduce the size of the image. It is hard to estimate the size of a compressed image, so some cameras also support a bandwidth limited option, but WPILib doesn't expose that since it is a bit advanced and not present on all cameras. The frame rate has a direct, linear relationship to the bandwidth needed. The size of the image determines how many pixels and each step down reduces the size by 4x. So, if you give the rest of the settings of the camera, we can give better input. The default dashboard shows the fps or frames per second, and it shows the Mbps or Megabits per second. The selector allows you to change the major contributors to bandwidth usage. The LED gives a pretty good indication as to where you are regarding bandwidth usage. A pretty good rule of thumb is that if you are not receiving as many frames as you request, that your devices will buffer the unread frames and that will cause lag. Also, what is the CPU usage of the laptop and the roboRIO? If either are maxed out, they may introduce lag. Greg McKaskle |
Re: Camera Lag
We lower the bandwith and get the FPS we request. Right now it is the lowest setting we can put it at 160x120 5FPS 30% compression. We should (in theory) have almost no lag. But we should not have the robot stop a full second after we let go of our joystick. Btw the CPU isn't maxed out and I don't know how to check the roboRIO processor.
|
Re: Camera Lag
We lower the bandwith and get the FPS we request. Right now it is the lowest setting we can put it at 160x120 5FPS 30% compression. We should (in theory) have almost no lag. But we should not have the robot stop a full second after we let go of our joystick. Btw the CPU isn't maxed out and I don't know how to check the roboRIO processor.
|
Re: Camera Lag
The roboRIO processor usage is plotted on the chart tab on the right. It is the red line on the lower plot. This info is also logged and can be viewed after the fact using the log file viewer. The Logs... button will launch that for you.
Also, it sounds like you have robot lag, not camera lag like the original post. Does this happen when the camera is disabled? It may make the most sense for you to post some log files. You can open the log file viewer and scroll to the bottom and click on some of the logs for one that isn't mostly empty. Post a screenshot, or you can go to Users/public/documents/FRC/Log Files and access the actual files there. Greg McKaskle |
| All times are GMT -5. The time now is 20:16. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi