Thread: Camera Lag
View Single Post
  #6   Spotlight this post!  
Unread 13-02-2015, 20:12
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,750
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
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
Reply With Quote