Go to Post If everyone could just worry about how much fun they are having rather than how much they disagree with other teams, the program would be much better off. - Tom Bottiglieri [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 23-01-2015, 15:47
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,795
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: Switch between two cameras?

You can do that on the Dashboard.
The same way you switch tabs would be pretty easy.
Just put the camera view in a tab and have a second tab for the other camera.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
Reply With Quote
  #2   Spotlight this post!  
Unread 23-01-2015, 15:50
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,751
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: Switch between two cameras?

And post questions if you have problems figuring out how to get the cameras to switch properly.

Greg McKaskle
Reply With Quote
  #3   Spotlight this post!  
Unread 25-01-2015, 20:59
roialex's Avatar
roialex roialex is offline
Registered User
FRC #5444 (Vobotik)
Team Role: Mentor
 
Join Date: Dec 2014
Rookie Year: 2015
Location: Trois-Rivières
Posts: 4
roialex is an unknown quantity at this point
Re: Switch between two cameras?

Quote:
Originally Posted by Mark McLeod View Post
You can do that on the Dashboard.
The same way you switch tabs would be pretty easy.
Just put the camera view in a tab and have a second tab for the other camera.
By doing this this way will it charge the bandwidth twice are when you're going to switch tabs it's going to poweroff the camera you're not using
Reply With Quote
  #4   Spotlight this post!  
Unread 25-01-2015, 21:10
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,751
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: Switch between two cameras?

Experiment with it. I am pretty sure that you will want to use the tab value to change the value going into the Read MJPEG for Dashboard.

Greg McKaskle
Reply With Quote
  #5   Spotlight this post!  
Unread 29-01-2015, 18:24
orangeandblack5 orangeandblack5 is offline
Hates LabView - Uses It Anyway
AKA: Ian Stewart
FRC #5498 (Wired Devils)
Team Role: Programmer
 
Join Date: Jan 2015
Rookie Year: 2015
Location: Grosse Ile, MI
Posts: 15
orangeandblack5 will become famous soon enough
Re: Switch between two cameras?

Okay.

First off, thank you all for your help and input so far. I've tried my best going off of what you've all said, but I've made very little progress.

That being said, I will be extremely specific in exactly what I want to do, and if it can be done please let me know (help on exactly HOW to do that would be even more appreciated).

What I would prefer to do is make it so that if you press a button on the joystick (button 2 in my case) it swaps the camera view spot that's already on the dashboard to the other camera's view. I'm trying to do this using a global variable (when button 2 is pressed it equals 1, otherwise it equals 0).

I'm extremely grateful for any further help.

Thank you all so much!
Reply With Quote
  #6   Spotlight this post!  
Unread 30-01-2015, 07:56
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,751
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: Switch between two cameras?

What type of cameras, USB or IP, or mixed?

Are you doing any processing of images on the roboRIO, or simply forwarding them to the DB?

Greg McKaskle
Reply With Quote
  #7   Spotlight this post!  
Unread 03-02-2015, 18:22
orangeandblack5 orangeandblack5 is offline
Hates LabView - Uses It Anyway
AKA: Ian Stewart
FRC #5498 (Wired Devils)
Team Role: Programmer
 
Join Date: Jan 2015
Rookie Year: 2015
Location: Grosse Ile, MI
Posts: 15
orangeandblack5 will become famous soon enough
Re: Switch between two cameras?

Two USB cameras, and I believe that I'm just forwarding the images (whatever the default robot code LabView gives you does).
Reply With Quote
  #8   Spotlight this post!  
Unread 04-02-2015, 06:57
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,751
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: Switch between two cameras?

The default LV code has a loop that will start running its empty vision processing code when enabled on the robotMain front panel or when the global is set to true.

Anyway. The WPILib forwarding code wasn't really prepared for this, so it will take a modification or two.

The Vision Processing VI calls a subVI whose icon has IP & Dash on it. The actual name of the VI is Background loop, and it does several things for different cameras and assumes that the camera address doesn't change.

For USB cameras, it calls a VI labeled Send 2 PC that does the read/compress/send to bridge the USB camera over ethernet. The camera refnum used in that loop is the one that we want to switch back and forth. It is the nested loop that is reading the camera, flattening to a string and calling the Send Image String VI. The inner loop will normally continue as long as the network connection is valid.

The modification would be to Open both cameras and store their refnums in a global variable. Then inside of Send Image to PC, when the camera switches, you'd want to modify the refund and exit the inner loop. The outer loop will stop and start the new camera and reuse the networking connection.

These aren't hard edits, but they need to be done right or they will be hard to debug. If someone makes these edits, perhaps they can share their results with the community?

Edit: It looks like someone has done this in a peer thread. I haven't tested it.

Greg McKaskle

Last edited by Greg McKaskle : 04-02-2015 at 06:59. Reason: Update
Reply With Quote
  #9   Spotlight this post!  
Unread 04-02-2015, 16:14
orangeandblack5 orangeandblack5 is offline
Hates LabView - Uses It Anyway
AKA: Ian Stewart
FRC #5498 (Wired Devils)
Team Role: Programmer
 
Join Date: Jan 2015
Rookie Year: 2015
Location: Grosse Ile, MI
Posts: 15
orangeandblack5 will become famous soon enough
Re: Switch between two cameras?

Just saw that today. I'll check up on that, and if it doesn't work I'll try it myself.
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 08:55.

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