Go to Post Thou shalt becometh pinned in eliminations. - JesseK [more]
Home
Go Back   Chief Delphi > Technical > Control System > FRC Control System
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 05-01-2009, 08:45
martin417's Avatar
martin417 martin417 is offline
Opinionated old goat
AKA: Martin Wilson
no team
Team Role: Mentor
 
Join Date: Feb 2008
Rookie Year: 2008
Location: Buford, GA
Posts: 720
martin417 has a reputation beyond reputemartin417 has a reputation beyond reputemartin417 has a reputation beyond reputemartin417 has a reputation beyond reputemartin417 has a reputation beyond reputemartin417 has a reputation beyond reputemartin417 has a reputation beyond reputemartin417 has a reputation beyond reputemartin417 has a reputation beyond reputemartin417 has a reputation beyond reputemartin417 has a reputation beyond repute
camera / vision system too laggy

DISCLAIMER: I am a mechanical engineer, and a mechanical mentor for the team. If I say something stupid about programming / computers, chalk it up to that.

Since we got the control system early, we decided to play around with programming. We mounted the system on a practice chassis and tried many different things. Using Labview turned out to be very easy once you get the hang of it. What we did find though, was that the vision system (at least through Labview) was very laggy. It was at least 1/2 to 1 second behind reality at all times. As is, this would be useless for controlling a launcher. Has anyone found a way around this limitation?
__________________
Former Mentor Team 1771
Former mentor Team 4509
Reply With Quote
  #2   Spotlight this post!  
Unread 05-01-2009, 09:15
EricVanWyk EricVanWyk is offline
Registered User
no team
 
Join Date: Jan 2007
Rookie Year: 2000
Location: Boston
Posts: 1,597
EricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond repute
Send a message via AIM to EricVanWyk
Re: camera / vision system too laggy

Try using the dashboard to watch the video stream, rather than a VI's front panel or a probe.
Reply With Quote
  #3   Spotlight this post!  
Unread 05-01-2009, 09:28
Unsung FIRST Hero
Greg Marra Greg Marra is offline
[automate(a) for a in tasks_to_do]
FRC #5507 (Robotic Eagles)
Team Role: Mentor
 
Join Date: Oct 2004
Rookie Year: 2005
Location: San Francisco, CA
Posts: 2,031
Greg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond repute
Re: camera / vision system too laggy

Quote:
Originally Posted by martin417 View Post
What we did find though, was that the vision system (at least through Labview) was very laggy. It was at least 1/2 to 1 second behind reality at all times. As is, this would be useless for controlling a launcher. Has anyone found a way around this limitation?
What you're seeing is delayed between getting from the robot to the laptop you're programming from. The actual robot controller "sees" what you see before it bothers sending the picture over to the laptop.
Reply With Quote
  #4   Spotlight this post!  
Unread 05-01-2009, 09:32
martin417's Avatar
martin417 martin417 is offline
Opinionated old goat
AKA: Martin Wilson
no team
Team Role: Mentor
 
Join Date: Feb 2008
Rookie Year: 2008
Location: Buford, GA
Posts: 720
martin417 has a reputation beyond reputemartin417 has a reputation beyond reputemartin417 has a reputation beyond reputemartin417 has a reputation beyond reputemartin417 has a reputation beyond reputemartin417 has a reputation beyond reputemartin417 has a reputation beyond reputemartin417 has a reputation beyond reputemartin417 has a reputation beyond reputemartin417 has a reputation beyond reputemartin417 has a reputation beyond repute
Re: camera / vision system too laggy

Quote:
Originally Posted by EricVanWyk View Post
Try using the dashboard to watch the video stream, rather than a VI's front panel or a probe.
Even without watching the video stream, the reaction of the robot to a change in target position was about 1/2 to 1 second behind, so I don't think it has anything to do with how you monitor the stream.

One thing I'm not sure about is the burn vs. debug mode. We started with the basic robot project for learning purposes, and there is a known bug that will not allow you to build this project to the cRIO, but only run it in "debug" mode. I was under the impression that the only difference is persistence through a power cycle, but I am not certain. Can this affect the speed at which it runs?
__________________
Former Mentor Team 1771
Former mentor Team 4509
Reply With Quote
  #5   Spotlight this post!  
Unread 05-01-2009, 10:19
StevenB StevenB is offline
is having FRC withdrawal symptoms.
AKA: Steven Bell
no team
Team Role: College Student
 
Join Date: May 2005
Rookie Year: 2005
Location: Stanford, CA
Posts: 416
StevenB has a reputation beyond reputeStevenB has a reputation beyond reputeStevenB has a reputation beyond reputeStevenB has a reputation beyond reputeStevenB has a reputation beyond reputeStevenB has a reputation beyond reputeStevenB has a reputation beyond reputeStevenB has a reputation beyond reputeStevenB has a reputation beyond reputeStevenB has a reputation beyond reputeStevenB has a reputation beyond repute
Re: camera / vision system too laggy

Quote:
Originally Posted by martin417 View Post
Even without watching the video stream, the reaction of the robot to a change in target position was about 1/2 to 1 second behind, so I don't think it has anything to do with how you monitor the stream.
My only experience comes with hooking the camera directly up to the computer and using the provided software. My sister was goofing around with it and pointed it at the screen displaying the image. This created an infinite "picture within a picture" effect, with each sub-picture lagging the one enclosing it. This video sort of demonstrates it. When an object was waved in front of the camera, it moved sequentially through the frames. As the object moved into the smaller frames, the frame rate increased. When the whole frame (real life) changed, it took more than a second before we saw the change on the screen, but when the fifth sub-picture changed, it took a much shorter time. I'm sorry I don't have a video of it at the moment, as it is very interesting and instructive.

My theory is that this is entirely a problem with the camera's data rate, which is dependent on how much it can compress the frame. If the camera is watching a mostly stationary scene (like most webcams and security cameras are designed to do), it will perform ok. If the camera moves much at all, expect a painfully low frame rate.
__________________
Need a physics refresher? Want to know if that motor is big enough for your arm? A FIRST Encounter with Physics

2005-2007: Student | Team #1519, Mechanical Mayhem | Milford, NH
2008-2011: Mentor | Team #2359, RoboLobos | Edmond, OK
2014-??: Mentor | Looking for a team...
Reply With Quote
  #6   Spotlight this post!  
Unread 05-01-2009, 11:12
TDohse TDohse is offline
Registered User
AKA: Thomas
no team (NI)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 39
TDohse is an unknown quantity at this point
Re: camera / vision system too laggy

Quote:
Originally Posted by martin417 View Post
I was under the impression that the only difference is persistence through a power cycle, but I am not certain. Can this affect the speed at which it runs?
Yes, it can. Each front panel you have open on your PC will be in constant communication with the RT code to update controls & indicators. In some cases, having multiple front panels open with many {controls | indicators} while running in debug can result in a noticeable slow down.

One option is to build & deploy the code as an application, alternatively you can close unneeded front panels.
Reply With Quote
  #7   Spotlight this post!  
Unread 05-01-2009, 16:29
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,582
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: camera / vision system too laggy

Quote:
Originally Posted by martin417 View Post
One thing I'm not sure about is the burn vs. debug mode. We started with the basic robot project for learning purposes, and there is a known bug that will not allow you to build this project to the cRIO, but only run it in "debug" mode. I was under the impression that the only difference is persistence through a power cycle, but I am not certain. Can this affect the speed at which it runs?
LabVIEW update 2 should not have the problem of building the basic robot project. It also optimizes some of the vision processing.

You can further optimize it by decreasing the resolution of the camera and/or decimating the camera image prior to processing.

Running in debug mode does slow down the processor, and if you have many front panels open it can do so significantly.
Reply With Quote
  #8   Spotlight this post!  
Unread 08-01-2009, 23:16
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,752
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 / vision system too laggy

Camera lag will always be there, but you can make it much much smaller than what you are describing. If you open and run the vision demos, you will see lag when you are viewing the entire image via the debugging tools, but it isn't 1/2 sec. If you switch it to show the mask the lag will be far smaller.

A better measure of the lag and aiming ability is to open the servo camera example. Since it is already controlling something, you can turn off most or all of the UI displays and get a better feel for the ability for it to respond. Again, the lag is still there, it always will be, but it is pretty small at that point.

You don't mention much about the setup that was producing lots of lag. Just a guess, but 640x480 images, especially if decoded and displayed on the cRIO will have pretty substantial lag.

Greg McKaskle
Reply With Quote
Reply


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
stereo vision system with OV7620 steveg Programming 3 04-05-2006 12:40
vision camera Adama Programming 3 19-01-2006 17:12
Camera Vision Range Muhnki Programming 7 05-02-2005 23:26
Camera Vision Range Muhnki Programming 7 05-02-2005 23:26
Vision System Guide? Bridgette Electrical 1 08-01-2005 19:03


All times are GMT -5. The time now is 16:41.

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