ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

If you want to avoid the requirement of root privileges when accessing a USB device, you should grant appropriate permissions to your user.

For example, lets say that your USB device is located in: /dev/ttyUSB0 (I am assuming that you use Ubuntu)

If you execute "ls -la", you should get something like:

myuser@mycomputer:~$ ls -l /dev/ttyUSB0
crw-rw---- 1 root dialout 4, 64 Jul  8 08:49 /dev/ttyUSB0

This means that the root user and the dialout group will have read-write permission and the rest of the users will not have access. Then what you should do is to add "myuser" to the dialout group:

sudo adduser myuser dialout

This will give myuser enough privileges to read and write to the /dev/ttyUSB0 device (remember to restart your session after adding the user to the goup for the privileges to have effect)

From this point on you will not need to sudo any more to access your USB device.

This is just an example, your case might be different. But I hope it helps.