Go to Post but you can rest assured: I have restored the balance by letting the GDC know that I know that they know that you know they have a pattern. -Leav - Leav [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
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 18-03-2016, 00:15
Araknos Araknos is offline
Co-captain, Elec./Prog. Ace (Lead)
AKA: Anthony Demetrescu
FRC #3476 (Code Orange)
Team Role: Leadership
 
Join Date: Jan 2016
Rookie Year: 2012
Location: California
Posts: 4
Araknos is an unknown quantity at this point
Recording Two Video Streams via Labview Dashboard

My team has two cameras on their robot; we have recently decided that we want to have two simultaneous video streams instead of switching between them. Camera switching worked, albeit with a slight lag during switching.

After our first regional, however, I realized that we needed to record the video stream from the cameras for after match viewing to facilitate debugging and match review.

I have successfully retrieved both camera feeds and displayed them. However, I have only been able to have one of the two camera feed save to AVI after recording. The selection of feed seems to be random.

I modified the AVI creation code VI so that it accepts an outside path instead of grabbing the one from the log file path, so that I can have it save as two separate files. However, this does not work.

What in the Dashboard code is preventing me from saving two files?

Thanks in advance.
Reply With Quote
  #2   Spotlight this post!  
Unread 18-03-2016, 12:01
ahudson ahudson is offline
Registered User
FRC #3179
 
Join Date: Jan 2010
Location: aDAIR
Posts: 47
ahudson is infamous around these parts
Re: Recording Two Video Streams via Labview Dashboard

May I ask how you were able to view 2 camera images simultaneously? We have the drive station set up to have two camera images, but it is not showing both camera images. Any ideas what we are not doing?
Reply With Quote
  #3   Spotlight this post!  
Unread 19-03-2016, 20:45
Araknos Araknos is offline
Co-captain, Elec./Prog. Ace (Lead)
AKA: Anthony Demetrescu
FRC #3476 (Code Orange)
Team Role: Leadership
 
Join Date: Jan 2016
Rookie Year: 2012
Location: California
Posts: 4
Araknos is an unknown quantity at this point
Re: Recording Two Video Streams via Labview Dashboard

The way I had implemented it was to duplicate the "WPI_CameraRead MJPG For Dashboard" VI and give it a separate IP corresponding to the other camera. In order to use more than one camera, you have to assign them unique IPs and explicitly address them in the Dashboard code; you cannot use the "Camera IP" local variable, as it will only return one IP (not sure which though).

It's funny that you mention this though, because I am currently trying to fix a problem where when one camera is disconnected, waiting when opening one TCP port causes pausing in the reading of the image in the other.

I am currently working on this problem. Will post when I figure anything out.
Reply With Quote
  #4   Spotlight this post!  
Unread 20-03-2016, 07:30
adciv adciv is offline
One Eyed Man
FRC #0836 (RoboBees)
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2010
Location: Southern Maryland
Posts: 478
adciv is a name known to alladciv is a name known to alladciv is a name known to alladciv is a name known to alladciv is a name known to alladciv is a name known to all
Re: Recording Two Video Streams via Labview Dashboard

With regards to the pausing, I'm guessing you're reading them both in the same while loop. That VI blocks until it reads in an image. To solve this, move one to a separate loop.
__________________
Quote:
Originally Posted by texarkana View Post
I would not want the task of devising a system that 50,000 very smart people try to outwit.
Reply With Quote
  #5   Spotlight this post!  
Unread 20-03-2016, 19:52
Araknos Araknos is offline
Co-captain, Elec./Prog. Ace (Lead)
AKA: Anthony Demetrescu
FRC #3476 (Code Orange)
Team Role: Leadership
 
Join Date: Jan 2016
Rookie Year: 2012
Location: California
Posts: 4
Araknos is an unknown quantity at this point
Re: Recording Two Video Streams via Labview Dashboard

Quote:
With regards to the pausing, I'm guessing you're reading them both in the same while loop. That VI blocks until it reads in an image. To solve this, move one to a separate loop.
Unfortunately, the problem isn't that simple. They are in two separate while loops, which would normally cause them to run in parallel. However, in one of the deeply nested VIs (HTTP Authentication, I believe), there is a TCP Open block which has a timeout of 2 seconds. So, when one camera has failed to make a connection, the HTTP VI is called repeatedly, only pausing for the default 500ms wait that occurs when the camera is not active.

While the one camera is waiting on a connection to open (TCP Open), it blocks the TCP Read operation of the other camera used to get the image.

I have "solved" this problem by limiting the number of times a camera can attempt to connect (in case one is unplugged). Then, I decide when to try again based upon what the robot is doing. In my case, it will retry the vision camera when shooting, and retry the intake camera when driving around (robot tells the Dashboard what to do via NetworkTables).

I have still not solved the problem of being able to record both at once, although I assume it may have something to do with a conflict in resources (access to file system, encoding, etc.).
Reply With Quote
  #6   Spotlight this post!  
Unread 24-03-2016, 22:46
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,748
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: Recording Two Video Streams via Labview Dashboard

I think that the solution is to make a second call to the Dashboard_Create AVI vi. Pass in the name you want for the second camera. Oh, and you'll want to make the Dashboard Create VI be reentrant. The Preallocated clone will compile such that the feedback node inside the VI is unique per call and will correctly manage more than one file refnum.

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


All times are GMT -5. The time now is 18:33.

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