We are using Visual Studio and I am unable to view any USB Web Camera images in Shuffleboard. I read through some items that said I should plug the USB Camera into the RoboRio and then access the RoboRio Web Interface to see if it is recognized. I did this and it does not show anything camera related in the Web Interface. I tried this on 2 different RoboRio’s with the same result. We are using a Logitech C270 USB Web Cam. Any help would be greatly appreciated. Thanks!
I think you need to start the camera server in your program, i.e. add something like this to your robotInit code:
var server = CameraServer.getInstance();
var camera = server.startAutomaticCapture();
Then you’ll be able to see the camera image at http://10.TE.AM.2:1181
I had used that guide and wrote the code into visual studio. I then pulled the camera into shuffleboard but it just shows all black. This is when I saw that I should be able to see it in the roborio web interface and noticed that nothing shows in there.
When you try to open http://10.TE.AM.2:1181, (or use whatever IP your roborio has, then port 1181 for the camera), do you see a black image from the camera, or an error? If you see the camera, maybe it’s defaulting to an unsupported image format, or exposure is way down.
You can try things like this to change the settings:
camera.setVideoMode(PixelFormat.kYUYV, 320, 240, 15);
camera.setBrightness(50);
...
On our testbot and laptop with the 2019 visual studio and 2019 firmware I was able to get it to work. On our main bot with the 2020 firmware and VS 2020 I just get the attached screen where it’s just spinning but never loads. I’m wondering if it is a setting on the computer somewhere because yesterday with our testbot loaded with the 2020 firmware and using VS 2020 we had the same results.
That looks like it’s not connecting to the camera, or the camera is otherwise unrecognized, as there’s no video stream, settings, or modes. Are there any console messages about connecting to the camera?
It is saying that it is unable to connect to the camera. Today I upgraded all of the software on my laptop to the 2020 version. I flashed the roboRio and the radio on the testbot and ran the code from VS 2020. I was able to read the camera. I then flashed the roboRio and Radio on the main robot with my laptop and ran the same code on it and the camera didn’t work. I tried both USB ports as well. In the logs it is showing that it can’t connect to the camera. Besides having more motor controllers on the main robot, they are setup pretty identical.
It sounds like the issue is specific to that one Rio then. It’s possible the USB ports on that Rio are broken?
Thanks for all of the help guys! I was able to get it working with our backup RoboRio with all of your help and isolated the issue to the main RoboRio. NI has submitted a ticket to get it replaced for us as it must have bad USB ports.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.