IEEERobotics/bot

Create uDev rules for multiple webcams.

AhmedSamara opened this issue · 2 comments

I'm trying to create udev rules so that when we plug in 2 cameras, we can guarantee that they will always be connected to the correct interfaces.

I collected the udev info for all of the cameras that we have.

(collected using udevadm info -a /dev/videoX)

I wrote these dev rules and saved them in /etc/udev/rules.d/81-camerarules.

KERNEL=="video*", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="0024", ATTRS{serial}=="081C01D0", SYMLINK+="a270"

But this isn't working. No interface or symbolik link is being created.

update:

A symbolik link can be created using ln -s target_path link_path.

udev rules now work.

Actually using them on openCV is not as straightforward as I thought:

http://stackoverflow.com/questions/35821763/create-opencv-videocapture-from-interface-name-instead-of-camera-numbers

fixed on branch camera_rules 7556d1e

The relevant file needs to go to /etc/udev/rules.d/81-camera.rules.

I'm not sure if the setup script will automatically copy it there but someone may have to do this manually.