2 cameras for comp 2019



This is my first years as programmer for team 3090, and I’m using Labview. I’ve used HTML5 and c++ before, so I’m not a total noob. I’ve gotten my way around so far, but I’m stuck right now.

People has asked this before, but nothing has worked. I’m trying to use 2 cameras on our robot.(more specifically, the drivers think it will be helpful) With the push of a button, our robot switches direction, making forwards backwards and vice-versa. We have a practice robot, so I can work on it a troubleshoot. On the dashboard, only 1 camera shows up, even when 2 are plugged in. I defaults to the top-most USB port on the roborio.

Ok, question time.

With the push of a button(on the controller) can the dashboard switch from showing one camera to another? I’m not talking about having both be shown at the same time, one on the left on one on the right, as I’ve said, that won’t work because only 1 shows up.

I’ve found a solution to this problem, but that was in 2015, and a VI is missing when I try to open it, and there are broken wires.

Thanks for any help! I will be looking forward to trying any solutions!

(like I said, we have a practice robot, so I can try code! It has helped a lot.:grin:)



the FRC Driver station lets you view through 2 cameras at once if that is what you are asking. the right side of the dashboard that shows gyro, if you click the camera tab on the top, you should be able to see.

1 Like


A whole different alternative, but what if you used a 360 degree camera where you could view all 360 degrees at once? You would only be using one camera. Doesn’t hurt to try new things

1 Like


Sorry about the late reply.

I know it can but somehow both aren’t showing up. It defaults to the top usb port on the RoboRio. We are using 2 Microsoft Lifecam HD-3000 cameras btw.

Nice idea, but I’m not sure how willing our instructor would be about that. Besides, wouldn’t the camera view be stretched?

Thanks for the replies but my question wasn’t answered. I’m wondering if a button could switch between 2 cameras. There was a post with a whole 2015 project for download in it, but there were several broken wires and a missing VI.

I’ll be looking forward for more help!

Team 3090’s programmer.



This has happened to me while i was trying to figure out the code for the cameras. For some reason, our program would accept a certain line of camera server code and had to write a new one in (i can’t remember which). When i ran the code, it showed as nothing was wrong but you won’t have playback from cameras. Do you think that this may be what’s happening?



I have playback from both, but not at once. Here is what happens.

  1. I plug both cameras into the roborio, and turn it on.
  2. I connect wirelessly to our DriverStation laptop, a Dell with a newer i5 and windows 10.
  3. I select the only camera option
  4. I see one camera’s view, but it is ALWAYS the one plugged in on top
  5. I unplug said camera, leaving the other one plugged in
  6. I switch to “no camera” and back to the same camera option as I had before
  7. I can now see the other camera’s view
  8. I plug the other camera back in
  9. I switch to “no camera” and back again, only to see the view of the first camera

sorry if that was hard to understand!

Any way to switch between the two?



I think this is the post that you are looking for

If you have already created new code as this post suggests and given them two different string names than I would reach out to the person on this post. He seems to have more idea how to program labview than I do.

The issue is that both cameras are being read as the same camera, so you need to include the code to differentiate.

Good luck.



The easiest solution is to use a different camera model for the second camera.
You can write code to switch between cameras, but right now your robot code as is cannot tell them apart.

If you do follow that post link above, move the two camera definitions to Begin.vi, rather than have the hem in the Vision Processing.vi



Thanks for the response!

  1. I’m pretty sure we have an axis ethernet camera on hand, but we tried it a couple of years ago and display lag was present.(Our USB cameras have little to no lag)

  2. Code to switch between the 2 cameras is EXACTLY what I’m looking for. Any help would be great.(BTW I can only try any code given between 4:00 and 6:00. that is when out team meets)

I’m looking forward to the responses. Thanks for the help!



This doesn’t really answer the question, but in 2017 we had a camera on a servo. You could try that :eyes: Also, would having two cameras cause bandwidth issues, even if you’re only streaming one at a time? It’s a genuine question as I myself do not know the answer. I know the limit was lowered from like 7mbs to 4mbs, so bandwidth is definitely in low supply. We have one camera we’ve been trying to compress to keep it at around 1 so there’s plenty of bandwidth to go around.



That has been thought of, but having compression at something like 80-95% at 320x160 at 5-10 fps might work. All I need is a to switch between the two, with the problems mentioned in previous posts.



Just a random question, if you know c++ why don’t you use c++ instead of labview?



We have an old Axis M1013 model camera. Could we still use it? The two USB camera ideas seems to be too hard for our abilities at this point. We use LabView and already have one USB on the front of the robot and just want to be able to use a second for the rear. We only need one on at a time.



The only c++ I’ve EVER done was unity. but that was when I was trying it out. I did VERY basic things. And that was like over half a year ago. I’m WAY better with HTML5 (html, css, and js).



I had the same issue. The issue when away when I switched to two different cameras. I used an old Logitech camera I had on my desktop for years and it worked. I ended up buying an ELP 180degree Fisheye Lens 1080p Wide, so now I am using the Microsoft and the fisheye.



Have you initialized both cameras in your robot code? In the dashboard there should be a drop down to select the camera and it should say “USB Camera 0” and “USB Camera 1”.
edit: I realize now that you said you use LabVIEW, so I have no idea what to do for the robot code, but the drop down selection should still be the same.



Hi – I hope I’m not too late. Looks like what you want to do is exactly what we are doing. With a push of a button, our robot switches drive direction, turns the limelight 180 on a servo mount, and we switch from one lifecam feed to another. This can be done with the latest FRCVision RasPi image, if you have a raspberry pi.

Edit: so this is not dependent on what language you use. You can go straight through the pi interface, and point it to a value that you place in the network table.



We are currently using 2 cameras and I can confirm you do not have to change anything in the code in labview.

Here’s a few tips/questions:
-Make sure you reboot your roboRio every time you plug/unplug a camera. This means if you plugged in one of the two cameras after it was powered on, you may run into some issues

-If you can see both cameras in the drop down list but one of them does not appear: What are your current camera settings? There is a limit in bandwidth therefore it won’t show the camera feed if your settings are too demanding.

-If you can only see one in the list: If rebooting the roborio did not help, you may want to try another camera. To help trouble shoot this, what happens if the only camera plugged in is the one that is not showing up when two are plugged in? Does it show? if it does not then you are having an issue with that one camera, if it does then you are having issues getting two cameras to work at the same time.

What does your Vision Processing vi and Robot main.vi look like?
Is Vision Processing enabled in Global Data?

If none of this worked, try adding a second camera to the vision processing vi like this:



We also have two cameras on the bot this year, although we used a very different setup… We connected both cameras through a USB hub to a Jetson TX1, and used ROS C++ to set up both camera streams.

Additionally, we managed to have a big camera stream for the front of the robot, and a smaller one in the corner for the back camera on the SmartDashboard. With the press of a button on the joystick, the two camera streams are switched seamlessly. This is actually done by modding the source code for the SmartDashboard to have camera streams set their URLs to a NetworkTables entry; the robot code just changes the value of the entry to switch or shut down cameras.



Sorry for the 15h late reply, but I’ve done some code, and now have both cameras appearing in the dashboard. The vision-processing.vi has no changes, because I restored it after I messed it up. I personally have a raspberry pi 3, but I’m not sure where space could be made to put it on the robot. Also, I’ve adjusted the cameras so I can run both at the same time while using only 0.5 mb of bandwidth.

I would like to switch the cameras with software, if possible.

Thanks for the help and suggestions!