USB Camera name randomly changing

My team has plans to use two different USB cameras both plug into the same robo-rio. When we started to the use cameras we were working with only one, and that camera was give the name “cam0”. we had written code to use “cam0”, then we started to have issues because the name of the camera had changed to “cam1”. so we wrote code to handle the seemingly random name changes for the camera. now that we have started to toy with two cameras the bot has now given the new camera the name of “cam2”. but not only has it given it the name of “cam2” it only names it that way if its plugged into the port closes to the edge. why aren’t the names consistent and if there is how could I change the names of the cameras?

Are the cameras assigned names in OI?

This issue is a problem for our team as well.

Any updates on the issue? Have you got it working yet?

Sorry I havent updated this been wall to building. We opted for a properties file on rio which identifies which rio and thereby which camera names are available. Works fine and the properties file can be used for other configuration data if the need arises.

would doing a directory listing on /dev and look for the cam* devices be useful?

That sounds good but a look at /dev shows no cam* devices even though we know cam1 exists as a usb device on the rio usb port.

Have you gotten the camera names from the roboRIO? Go to roboRIO-xxxx.local while connected directly to your roboRIO where xxxx is your team number. The cameras each get their own names assigned to them by the RIO. Plug in both the cameras and it should show the names of the cameras. Use those names in Robot.java to run the cameras

I had this issue with a team; the only thing that worked was reflashing the cRIO to change the camera back to cam0. I agree though its really annoying and should be configurable.