Linux Udev Rules

From Tekkotsu Wiki

Jump to: navigation, search

Linux-based robots such as the Calliope require udev rules to assure that hardware devices are configured properly and assigned consistent device paths on which Tekkotsu can rely. For example, on a robot with a netbook and an external camera, the netbook's webcam should always be assigned to /dev/video0 and the external camera to /dev/video1, not vice versa. At boot time, either assignment is possible, but with a udev rule we can force the correct assignment to occur.

Udev rules need to be installed on the robot itself. If you are running Tekkotsu on a workstation and simulating a robot using Mirage, you do not need the udev rules. However, if you are attaching real hardware such as a webcam or Kinect device to the workstation itself, you will want to install the udev rules.

Install Udev Rules for Create and Calliope Robots

Note: these rules require serial USB devices, such as the connections to the Create and the Dynamixel servo controllers, to have been assigned specific serial numbers so Linux can tell them apart. See the article on FTDI USB Serial device programming for instructions on how to program the serial numbers for FTDI devices such as the iRobot serial-to-USB cable. The file below also works for serial cables that use the Prolific Technology PL2303 chip. If you're using a different kind of serial cable you will need to ascertain the device vendor id and product id (use "lsusb -v") and then modify the udev rules to recognize that device.

Use the instructions below to install the udev rules:

sudo -s
cd /etc/udev/rules.d
wget -N http://Chiara-Robot.org/download/udev/rules.d/10-calliope.rules

mkdir -p /etc/udev/scripts
cd /etc/udev/scripts
wget -N http://Chiara-Robot.org/download/udev/scripts/set_ftdi_low_latency.sh

Learn More About Udev Rules

Udev rules files are human-readable, so you can browse them to see how your robot's devices are being configured.

The udevadm utility can be used to examine device configurations. Read the udevadm man page for instructions.

A good tutorial on udev rules is available at http://www.reactivated.net/writing_udev_rules.html. Note: where this tutorial refers to udevinfo, use udevadm instead.