Turtlebot needs /dev/kobuki
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
snapd |
Triaged
|
Low
|
Samuele Pedroni |
Bug Description
When you install ROS and the Turtlebot specific packages it install a udev rule to create /dev/kobuki which is an alias to whichever USB device it is mapped to when attached (usually /dev/ttyUSB0). We need an interface to install and execute the udev rule or creating the alias would work as well.
udev rules file installed for kobuki does the following:
# On precise, for some reason, USER and GROUP are getting ignored.
# So setting mode = 0666 for now.
SUBSYSTEM=="tty", ATTRS{idVendor}
# Bluetooth module (currently not supported and may have problems)
# SUBSYSTEM=="tty", ATTRS{address}
Changed in snappy: | |
status: | Incomplete → Confirmed |
affects: | snappy → snapd |
Changed in snapd: | |
assignee: | nobody → Samuele Pedroni (pedronis) |
Thank you for filing a bug.
The fact that this is a symlink to /dev/ttyUSB0 suggests this should be part of the serial-port interface in some way. The serial-port interface can create symlink udev rules from product and vendor ids specified by the gadget snap slot. Eg, if the gadget snap for the ROS device had this:
name: my-gadget
slots:
kobuki-device:
interface: serial-port
path: /dev/kobuki
usb-vendor: 0x0403
usb-product: 0x6001
Then the following rule would be created (assuming serialUdevSymli nkPattern has adjusted to handle this): =="0x0403" , ATTRS{idProduct }=="0x6001" , SYMLINK+="kobuki"
SUBSYSTEM=="tty", SUBSYSTEMS=="usb", ATTRS{idVendor}
and plugging snaps simply:
name: my-snap
plugs:
kobuki:
interface: serial-port
then you manually connect with: kobuki- device
$ sudo my-snap:kobuki my-gadget:
which allows my-snap access to the device with usb-vendor 0x0403 and usb-product 0x6001 (snapd does this via device cgroup) and it can be accessed via /dev/kobuki.
@Michael, is the udev rule that I posted above sufficient for your needs? Based on /lib/udev/ rules.d/ 50-udev- default. rules it looks like serial devices get GROUP:="dialout" already. I think all that remains is ATTRS{serial} =="kobuki* " and MODE:="0666"; local testing shows that it may get 0660 by default. This won't affect daemons on snappy since those run as root, but it will mean that regular users need to use sudo unless they are added to the dialout group (and I think this is the correct approach btw-- snappy can make group membership handling for the default user easier in the future).