|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||||
|
|||||
|
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. |
|
#2
|
|||
|
|||
|
Re: Switch between two cameras?
And post questions if you have problems figuring out how to get the cameras to switch properly.
Greg McKaskle |
|
#3
|
||||
|
||||
|
Re: Switch between two cameras?
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
|
|
#4
|
|||
|
|||
|
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 |
|
#5
|
|||
|
|||
|
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! |
|
#6
|
|||
|
|||
|
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 |
|
#7
|
|||
|
|||
|
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).
|
|
#8
|
|||
|
|||
|
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 |
|
#9
|
|||
|
|||
|
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.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|