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

Hokuyo laser configuration

asked 2013-10-16 21:25:05 -0500

FuerteNewbie gravatar image

updated 2013-11-18 17:03:42 -0500

tfoote gravatar image

Hi guys,

I am currently using URG-04LX hokuyo laser and there is one problem that every time I power on this laser I need to reconfigure it all over again. Whenever I "ls -l /dev/ttyACM0", the feedback will always be crw-rw---- 1 root dialout 166, 0 Oct 17 15:10 /dev/ttyACM0

I was thinking could I possibly save the configuration(sudo chmod a+rw /dev/ttyACM0) or is there any launch code that would possibly do this job?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

answered 2013-10-16 23:25:05 -0500

dornhege gravatar image

Here is the more fancy udev solution that we use (needs the hokuyo_node package) and /etc/ros/run.sh:

SUBSYSTEMS=="usb", KERNEL=="ttyACM[0-9]*", ATTRS{manufacturer}=="Hokuyo Data Flex for USB", ATTRS{product}=="URG-Series USB Driver", MODE="0666", GROUP="dialout", PROGRAM=="/etc/ros/run.sh hokuyo_node getID %N q", SYMLINK+="sensors/hokuyo_%c"

Besides access rights this uses the getID util in hokuyo_node to provide device symlinks as /dev/sensors/hokuyo_SERIAL to enable identifying specific sensors neverminds which ttyACM they land at.

/etc/ros/run.sh enables ROS

#!/bin/sh
. /etc/ros/setup.sh 
rosrun $@

/etc/ros/setup.sh is a symlink to the setup.sh in /opt/ros/DISTRO/setup.sh

edit flag offensive delete link more

Comments

What is the different between your solution and the solution provided by @Tones ?

FuerteNewbie gravatar image FuerteNewbie  ( 2013-10-16 23:40:30 -0500 )edit

This one also provides device ids based on the serial number. Also it sets access rights for any user (other), not only dialout, but you can configure that.

dornhege gravatar image dornhege  ( 2013-10-17 00:44:56 -0500 )edit
1

answered 2013-10-16 22:12:48 -0500

Tones gravatar image

I would recommend adding your username to the group dialout:

sudo adduser $USER dialout
edit flag offensive delete link more

Comments

How does this make a difference? What is suppose to happen after I enter this command?

FuerteNewbie gravatar image FuerteNewbie  ( 2013-10-16 22:24:36 -0500 )edit

That is what you were asking for. It gives your user permanent access rights to this device so you don't have to "chmod" any more.

dornhege gravatar image dornhege  ( 2013-10-16 23:20:43 -0500 )edit

The idea behind the command is to add your user to the group, which has read/write access for `/dev/ttyACM0` by default instead of setting read/write access for all users every time again.

Tones gravatar image Tones  ( 2013-10-16 23:52:40 -0500 )edit

I can confirm that this has been THE way to solve access right issues for many sensors over here. It should be the preferred (simplest) solution for any /dev/tty* access issues.

autonomy gravatar image autonomy  ( 2013-10-22 04:11:24 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2013-10-16 21:25:05 -0500

Seen: 556 times

Last updated: Oct 16 '13