Switching between two cameras

We currently have one camera working on the robot, and it streams to the dashboard totally fine. However, we want to add another camera.

What I want to know is, where in the dashboard code do we decide which USB port it reads from? We want to be able to switch between each camera during the game (we have one for shooting and one for driving, since we shoot out the side).

I don’t know how you initialize your cameras in code, but if you use the camera name (“cam0”, “cam1” etc.) you can find the names of the cameras that are connected to the rio through the rio webdashboard thing (open a silverlight-capable browser to “roborio-TEAM-frc.local” as per https://wpilib.screenstepslive.com/s/4485/m/24166/l/262266-roborio-webdashboard )
I haven’t tested what port each name corresponds to, so I can’t help you there. On our team we just cycle throught our cameras until we find the one we want.
Also of note: you can connect to more than two cameras by using a usb hub.

The DB talks to the roboRIO and it is the roboRIO that needs to know the USB name. The DB doesn’t really know where the images are from.

I think what you want to do is to have the DB write to a selector such as a network table variable. On the robot, use the selector to decide which camera you read from and send to the DB.

The VI that implements this is a few layers down and is in a VI called Send 2 PC.

There are specifics in other posts on CD. I can go into more detail here, but you can probably find it there.

Greg McKaskle