Log in

View Full Version : USB Camera name randomly changing


FancyGerald
17-02-2015, 20:06
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?

legts
18-02-2015, 09:11
Are the cameras assigned names in OI?

Crossle86
10-03-2015, 13:43
This issue is a problem for our team as well.

legts
14-03-2015, 12:01
Any updates on the issue? Have you got it working yet?

Crossle86
14-03-2015, 12:26
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.

fovea1959
15-03-2015, 16:37
would doing a directory listing on /dev and look for the cam* devices be useful?

Crossle86
16-03-2015, 16:54
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.

legts
21-03-2015, 11:35
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

Arhowk
21-03-2015, 20:56
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.