We have 2 USB cameras connected to the Rio. While they do show up in the standard dashboard as USB Camera 0 and USB Camera 1 as a result of me putting in the CameraServer commands (which I will put below) I have also have in the network tables a lot of USB Camera XXXXXXXX values that I can’t seem to clear. The effect is that we have numerous cameras that really are not connected anymore but are still selectable. Some of these entries appears to be aliases for the real cameras that are connected.
I have 2 requirements. We need the cameras to consistantly be picked as USB 0 and USB 1 and NEVER swap because the cameras will be looking in two different directions. Bad things will happen if the camera we think is USB 0 becomes 1 etc.
I am fine with using the USB camera’s serial number (which may be where these entries are coming from) if they are consistent and we can programicaly identify which one is which.
But see below what the Variables tab shows. Even after rebooting the rio and PCs running the driver station these entries return. Why are they sticking?
Nevermind, unless someone knows how to use the camera usb serial number to force each camera to allign with a usb port or not. I solved the mystery cameras, as I had a pc in the other room that I had forgotten that was still running a nt table server. It was likely refeeding the tables back and as a result would not let the data to be forgotten.
but I am still interested in making one camera always be on one usb 0 assignment etc.
So, in my case when I ssh to the roborio I can navigate and find
Therefore, if I can supply this absolute path of these cameras, as suggested in the other post, I should be able to statically assure that the correct camera is associated with the correct function.
That’s correct. Even easier, this year the alternate “absolute” paths are given on the camera stream/settings webpage (roborio-TEAM-frc.local:1181 for the first camera, :1182 for the second, etc). There are two alternate paths provided for each camera. The by-id names are based on the camera make/model. The by-path names are based on USB port numbering.
That would have been why they persisted. Why they were there in the first place was probably that you were calling StartAutomaticCapture() in a loop rather than once during initialization.
Yes, GetVideo() with the same name passed as to StartAutomaticCapture() will get the CvSink for that camera. Note the GetVideo() call must be made after the StartAutomaticCapture() call.