Which Camera is Which?

We are using two Webcams, one in the front for OpenCV and one in the back for AprilTags, with a single VisionPortal object, and two attached VisionProcessor objects.

In our configuration file, we have kept the names that were assigned to the two cameras by default: Webcam 1 and Webcam 2. After hooking everything up the first time, we used trial and error to determine which camera was Webcam 1, and which was Webcam 2. So far, there has not been any episode where these assignments got switched.

But, I’m wondering: what determines which camera is Webcam 1, and which is Webcam 2? Does it depend on which USB port each camera is plugged in to? Or a serial number that can be read from the camera?

If there were some risk of this assignment reversing in the future, I would suggest to our team adding some camera management logic to be controlled with a gamepad during initialization.

It’s completely controlled by the robot configuration - in the robot config, the serial number of the Webcam is associated with the name of the camera. So assuming your serial number doesn’t randomly change (not likely) or you don’t change the name of the cameras, the association will not change.

For more context, check out this post:

-Danny

Thanks, great information!