-
Notifications
You must be signed in to change notification settings - Fork 0
/
10-cameras.rules
39 lines (33 loc) · 2.22 KB
/
10-cameras.rules
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# UDev rules for the Video Pi
# This file should be placed in /etc/udev/rules.d
#
# This file allows our cameras to be assigned a particular port each time.
# Instead of /dev/video0 and /dev/video2, or /dev/video0 and /dev/video1, we can have /dev/realsense and /dev/scienceMicroscope
#
# The general gist of this file is that it reads data about the device (SUBSYSTEM and ATTRS), and,
# based on the below rules, adds an alias for that device (SYMLINK). Each physical device may be
# registered multiple times with the OS, so we use multiple checks (like USB port and video4linux).
#
# Resources:
# - To see info for a device, run `udevadm info -a -n /dev/deviceName`
# - For guidance on writing these kinds of files, see
# https://bing-rover.gitbook.io/docs/v/software/onboard-computers/video/udev-rules
# Realsense RGB: /dev/realsense_rgb
SUBSYSTEMS=="usb", ATTRS{interface}=="Intel(R) RealSense(TM) Depth Camera 435i RGB", ENV{IS_RS_RGB}="t",
SUBSYSTEMS=="video4linux", ATTRS{index}=="0", ENV{IS_RS_RGB}=="t", SYMLINK+="realsense_rgb"
# Realsense Depth: /dev/realsense_depth
SUBSYSTEMS=="usb", ATTRS{interface}=="Intel(R) RealSense(TM) Depth Camera 435i Depth", ENV{IS_RS_DEPTH}="t"
SUBSYSTEMS=="video4linux", ATTRS{index}=="2", ENV{IS_RS_DEPTH}=="t", SYMLINK+="realsense_depth"
# The rear camera: /dev/rear_camera
SUBSYSTEMS=="usb", KERNELS=="1-1.4", ENV{IS_REAR}="t"
SUBSYSTEMS=="video4linux", ATTR{index}=="0", ENV{IS_REAR}=="t", SYMLINK+="rear_camera"
# Subsystem cameras:
# The subsystem should come with a USB 3.0 Hub with 3x USB 3.0 ports. The following code maps each
# port (from top to bottom) as "subsystem1", "subsystem2", or "subsystem3". Specifically, the
# following rules match by *port*, not device, which means they'll work for any device
SUBSYSTEMS=="usb", KERNELS=="1-1.1.4", ENV{IS_SCIENCE_CAROUSEL}="t"
SUBSYSTEMS=="video4linux", ATTR{index}=="0", ENV{IS_SCIENCE_CAROUSEL}=="t", SYMLINK+="subsystem1"
SUBSYSTEMS=="usb", KERNELS=="1-1.1.2", ENV{IS_SCIENCE_VACUUM}="t"
SUBSYSTEMS=="video4linux", ATTR{index}=="0", ENV{IS_SCIENCE_VACUUM}=="t", SYMLINK+="subsystem2"
SUBSYSTEMS=="usb", KERNELS=="1-1.1.3", ENV{IS_SCIENCE_MICROSCOPE}="t"
SUBSYSTEMS=="video4linux", ATTR{index}=="0", ENV{IS_SCIENCE_MICROSCOPE}=="t", SYMLINK+="subsystem3"