2 Webcams Simultaneously - via RoboRio USB

Anyone get this working in view of the USB bandwidth issue?

We had an RPi working fine with two cameras in practice and pits, but the FMS doesn’t like something about the setup - sometimes works and sometimes doesn’t on field. Looking to eliminate the RPi.

https://wpilib.screenstepslive.com/s/currentCS/m/vision/l/708159-using-multiple-cameras

RoboRIO USB often has its own issues… I think the safer approach would be to get rPi working consistently for you. Have you set static IPs on both the rPi (10.TE.AM.11) and Rio (10.TE.AM.2), with 255.0.0.0 netmask and 10.TE.AM.1 gateway? Are you using the FRCVision image or something custom?

Static IP for Pi. Not on others since they should default to those addresses. I also read somewhere that setting DS to static might help.

Regular raspian but have tried the FRC image.
Same libraries installed and up to date. Also have Pixy with custom code reporting to networktables. We think NT is at least part of the issue. Tough to know since it’s tough to replicate an event. Will set up a router and flash openwrt to try and duplicate FMS, but it’s all a huge hassle and lots of variables. Worked at home and well under data limit.

Two cams via Rio would be easier.

DS doesn’t need to be static, but it doesn’t hurt. The Rio “should” default to 10.TE.AM.2, but if for some reason it doesn’t, the only way the rPi will be able to find the Rio (to connect NT) is via mDNS. Is your software using the team number (set/startClientTeam) or some other method (mDNS name, IP) to configure the NT client?

Were you able to ping the rPi on the field?

What programming language are you using? 2 webcams on the Rio is relatively easy to set up, but yeah, bandwidth limits will depend on the camera models you’re using.

Coded for 10.TE.AM.2. Robot code for lidar was only other use of NT, and also had issues when RPi was plugged in. Unplugging RPi resolved lidar issues. Not sure about ping. It worked for a few practice matches, and then sporadically after they updated FMS.

Java for robot, Python for Pixy on Pi.

I don’t know why unplugging the rPi resolved the lidar issues, unless they were power-related–where are the rPi and lidar getting their power from?

The FMS update didn’t make any network changes, so that’s unrelated.

Java code for two cameras plugged into the Rio is 2 lines of code. If you want to switch them, it’s 5 lines of code (not including the actual switching).

CameraServer.getInstance().startAutomaticCapture(0);
CameraServer.getInstance().startAutomaticCapture(1);

We put the rPi on its own USB battery pack due to power issues when hard wired. Only link between lidar and pi/pixy was networktables. Maybe something about the pixy’s put to NT, but that shouldn’t be a lot of data (8 numerical values, updating as it’s detected.)

In any event I’ll try the two cameras directly to Rio. They do h.264, so hopefully I can make it work. It doesn’t sound like many have had success unless they switch between streams.

Our programmers got it working with two simultaneously in Java.

They had to tune the throughput in shuffleboard and it worked really well. The trick that made them both stream every time for full matches was to click on “restart robot code” on the driver station after connecting to the field.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.