Go to Post FIRST has set me on a completely different path in life. And I'm all the better for it. - Vincent Chan [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 30-01-2010, 12:00
ringo115 ringo115 is offline
Registered User
FRC #1647
 
Join Date: Jan 2009
Location: New Jersey
Posts: 42
ringo115 is on a distinguished road
Camera lag solution

So our camera has about a 5 second lag in its response to something going in front of it. Is there any way of reducing the lag, The increasing resolution and lowering compression didnt work, is there any other way of fixing it?
  #2   Spotlight this post!  
Unread 30-01-2010, 12:37
reversed_rocker's Avatar
reversed_rocker reversed_rocker is offline
Alumni
AKA: Ken Condon
FRC #0706 (Cyberhawks)
Team Role: College Student
 
Join Date: Nov 2008
Rookie Year: 2008
Location: Hartland
Posts: 69
reversed_rocker is on a distinguished road
Re: Camera lag solution

i had the exact same problem, try logging into the developer mode on the drive statino netbook and open up the driver station program (there are icons for it on the desktop) as soon as i did that, the camera ran much much much much much faster. we're talking from a 2 second lag time to close to real time, probly doubled the frame rate as well. as to why this is, i have no idea. i hope its not like this during the competition.
  #3   Spotlight this post!  
Unread 30-01-2010, 13:27
reversed_rocker's Avatar
reversed_rocker reversed_rocker is offline
Alumni
AKA: Ken Condon
FRC #0706 (Cyberhawks)
Team Role: College Student
 
Join Date: Nov 2008
Rookie Year: 2008
Location: Hartland
Posts: 69
reversed_rocker is on a distinguished road
Re: Camera lag solution

ok, slight modification. You know how if you have multiple tabs open in windows xp you click on the taskbar on the one you want to be on top? well open up both the FRC Driver Station and the FRC Dashboard, then select the FRC Driver Station tab on the task bar. dont know why, but this magically makes the camera faster. as soon as you click on the dashboard tab on the task bar, the camera lags up again
  #4   Spotlight this post!  
Unread 30-01-2010, 15:17
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,753
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 solution

After a bit of testing, here is my observation.

The big lag is not caused by any specific window ordering, but occurs when the dashboard computer cannot keep up with the cRIO. If you time the rate at which the cRIO sends the images and modify things like which windows are open and which windows are updating, you can sometimes cause the PC to process the images more slowly than they are being sent.

When more images are coming in than are being processed, the excess quickly creates a delay between real world and what you see on the screen. When the buffer is full, the images are dropped, and you will also see some jumpiness as some images are missing.

At this point, I'm still diagnosing the sorts of things that can contribute to this to see what we should change, but in general, if you have your dev environment, dashboard, and driver station all on a single computer, say a small laptop, this may happen sometimes. From what I've seen, minimizing the dev windows is often enough to correct it, and when you aren't running the dev tools at all, it will be even less of an issue.

Greg McKaksle
  #5   Spotlight this post!  
Unread 30-01-2010, 17:49
Ryan Gordon Ryan Gordon is offline
Registered User
FRC #2854 (EVHS Robotics)
Team Role: Mentor
 
Join Date: Feb 2009
Rookie Year: 2009
Location: San Jose, CA
Posts: 40
Ryan Gordon is an unknown quantity at this point
Re: Camera lag solution

Im just fishing here, but would that lag not happen if you open up Task Manager, nagivate to the Processes tab, and set the dashboard process priority to High / Above Normal / Realtime?
  #6   Spotlight this post!  
Unread 30-01-2010, 19:39
bobwrit's Avatar
bobwrit bobwrit is offline
//No Comment
AKA: ...
FRC #1977 (Loveland High Robotics)
Team Role: Alumni
 
Join Date: Oct 2008
Rookie Year: 2008
Location: Somewhere
Posts: 298
bobwrit is just really nicebobwrit is just really nicebobwrit is just really nicebobwrit is just really nicebobwrit is just really nice
Re: Camera lag solution

Quote:
Originally Posted by Ryan Gordon View Post
Im just fishing here, but would that lag not happen if you open up Task Manager, nagivate to the Processes tab, and set the dashboard process priority to High / Above Normal / Realtime?
We tried this today and it definitely helped a lot. We brought our lag down from ~1 second to like... ~.2 seconds.
__________________

FRC Team 1977 Alumni

Has Attended:2008 Colorado regional
2009 Colorado Kickoff
2009 Colorado Regional
2010 Colorado Kickoff
2010 Colorado Regional




The most exciting phrase to hear in science, the one that heralds new discoveries, is not "Eureka!"(I found it!), but rather, "Hmm.... That's funny" ---Isaac Asimov
Chance favors the prepared mind ---Louis Pasteur
And you can tell me, that I can't make a diffrence because I'm just one, but one is all it takes to start it. And you can tell me, that I can't change the world because I'm too young, but I wont stand here and be your target. ---FM Static
  #7   Spotlight this post!  
Unread 31-01-2010, 11:53
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,753
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 solution

If the CPU has too many things to do, a line forms and the CPU deals with things one, or depending on architecture, a few things at a time. Priorities are where you give one task cuts in line. Some tasks are left at the back of the line watching other tasks cut over and over again.

If not used carefully, priorities will mean that some tasks will get starved out and will never get any time on the CPU. In particular, I don't think the dashboard should be higher priority than the development tools or the driver station. There is nothing stopping you from setting your own priorities, and I don't think the system will be dangerous if you play with priorities, but if it acts oddly and won't do what you want, put them back to defaults before deciding things are broken.

In most cases, the best way to deal with an overloaded CPU is to figure out how to do less work or do the work more efficiently. Again, this is very different from setting priorities.

Greg McKaskle
  #8   Spotlight this post!  
Unread 31-01-2010, 17:43
Mike Mahar Mike Mahar is offline
Registered User
FRC #0138
 
Join Date: Jan 2007
Location: Amherst, NH
Posts: 64
Mike Mahar will become famous soon enough
Re: Camera lag solution

OK, our video lag is about 5 seconds and the frame rate is about 0.5 seconds. We are running the dashboard on the classmate while logged in under the Driver account. The developer account is not logged in. Our picture size is 160x120. I set the classmate power features to "always on". We are usgin C++

One thing that might be different from other code is that we are running with the Default code instead of the simpleRobot code or VisionDemo.

I tried running everything under the developer account but saw no difference either. The connection to the robot is hard wired 100baseT.

Fortunately, our application this year does not require streaming video and I haven't measured the frame rate internally to the robot for the ellipse matching routines yet.
  #9   Spotlight this post!  
Unread 31-01-2010, 17:48
Radical Pi Radical Pi is offline
Putting the Jumper in the Bumper
AKA: Ian Thompson
FRC #0639 (Code Red Robotics)
Team Role: Programmer
 
Join Date: Jan 2010
Rookie Year: 2010
Location: New York
Posts: 655
Radical Pi has a spectacular aura aboutRadical Pi has a spectacular aura aboutRadical Pi has a spectacular aura about
Re: Camera lag solution

Our delay was fixed by removing the graphs on the right side of the dashboard. Our fixed dashboard is uploaded in http://www.chiefdelphi.com/forums/sh...ad.php?t=81378
  #10   Spotlight this post!  
Unread 31-01-2010, 17:50
ideasrule's Avatar
ideasrule ideasrule is offline
Registered User
FRC #0610 (Coyotes)
Team Role: Programmer
 
Join Date: Jan 2010
Rookie Year: 2009
Location: Toronto
Posts: 108
ideasrule is a jewel in the roughideasrule is a jewel in the roughideasrule is a jewel in the roughideasrule is a jewel in the rough
Re: Camera lag solution

Quote:
Originally Posted by Mike Mahar View Post
OK, our video lag is about 5 seconds and the frame rate is about 0.5 seconds. We are running the dashboard on the classmate while logged in under the Driver account. The developer account is not logged in. Our picture size is 160x120. I set the classmate power features to "always on".
Try logging in to the camera and setting it to the best possible settings (640x480 resolution, 0 compression, automatic exposure and white balance, etc). For us, this reduced the lag time from 5 seconds to half a second.

Now for the half-second delay...I created another thread just before I saw this one, so I'll be following the suggestions in this thread.
  #11   Spotlight this post!  
Unread 31-01-2010, 20:53
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,753
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 solution

I've seen very bad performance when setting compression to 0. Are you sure that is what it is set to?

Greg McKaskle
  #12   Spotlight this post!  
Unread 31-01-2010, 22:05
ideasrule's Avatar
ideasrule ideasrule is offline
Registered User
FRC #0610 (Coyotes)
Team Role: Programmer
 
Join Date: Jan 2010
Rookie Year: 2009
Location: Toronto
Posts: 108
ideasrule is a jewel in the roughideasrule is a jewel in the roughideasrule is a jewel in the roughideasrule is a jewel in the rough
Re: Camera lag solution

Quote:
Originally Posted by Greg McKaskle View Post
I've seen very bad performance when setting compression to 0. Are you sure that is what it is set to?

Greg McKaskle
Yes, 0% compression was sufficient to guarantee a delay no longer than half a second on 640x480. During that one day when we got a reasonably high frame rate, we had the resolution set as 320x240 and the compression set as 0%. I tried increasing the compression to 30%, but that made no appreciable difference.
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
2010 FRC Camera Live Feed Lag ideasrule Programming 23 11-02-2010 02:33
Camera Solution ProgrammerMike7 Programming 12 02-02-2010 10:32
Camera Lag tutkows1 Java 1 27-01-2010 00:20
Camera Lag jmanela NI LabVIEW 6 25-12-2009 08:48
Solution to camera problem techkid7 Programming 1 12-01-2009 08:42


All times are GMT -5. The time now is 21:30.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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