Ask Your Question
0

udev rules for multiple hokuyo LiDARS doesn't work: urg_node

asked 2017-09-14 18:42:53 -0600

SpacemanSPIFF gravatar image

Hey,

I am using multiple hokuyo lidars with nvidia TX2. I am using Ubuntu 16.04 Linux for Tegra with Kinetic ROS distribution. I am trying to write a udev rule to create a symlink with the id. this is what I have right now

SUBSYSTEMS=="usb", KERNEL=="ttyACM[0-9]*", ACTION=="add", ATTRS{idVendor}=="15d1", ATTRS{idProduct}=="0000", MODE="0666", PROGRAM="/opt/ros/kinetic/lib/urg_node/getID /dev/%k q", SYMLINK+="sensors/hokuyo_%c"

which is same as what is mentioned in the driver page. But unfortunately, the rule is'nt creating a symlink but the permissions for the file is applied. I am not sure what is happening. Running udevadm test -a add $(udevadm info -q path -n /dev/ttyACM1) prints out the error. The relevant part of the output is

PROGRAM '/opt/ros/kinetic/lib/urg_node/getID /dev/ttyACM1 q' /etc/udev/rules.d/99-mapbaby.rules:5
starting '/opt/ros/kinetic/lib/urg_node/getID /dev/ttyACM1 q'
'/opt/ros/kinetic/lib/urg_node/getID /dev/ttyACM1 q'(err) '/opt/ros/kinetic/lib/urg_node/getID: error while loading shared libraries: liburg_c_wrapper.so: cannot open shared object file: No such file or directory'
Process '/opt/ros/kinetic/lib/urg_node/getID /dev/ttyACM1 q' failed with exit code 127.
handling device node '/dev/ttyACM1', devnum=c166:1, mode=0660, uid=0, gid=20
preserve permissions /dev/ttyACM1, 020660, uid=0, gid=20
preserve already existing symlink '/dev/char/166:1' to '../ttyACM1'
found 'c166:1' claiming '/run/udev/links/\x2fserial\x2fby-id\x2fusb-Hokuyo_Data_Flex_for_USB_URG-Series_USB_Driver-if00'
found 'c166:0' claiming '/run/udev/links/\x2fserial\x2fby-id\x2fusb-Hokuyo_Data_Flex_for_USB_URG-Series_USB_Driver-if00'
creating link '/dev/serial/by-id/usb-Hokuyo_Data_Flex_for_USB_URG-Series_USB_Driver-if00' to '/dev/ttyACM1'
preserve already existing symlink '/dev/serial/by-id/usb-Hokuyo_Data_Flex_for_USB_URG-Series_USB_Driver-if00' to '../../ttyACM1'
found 'c166:1' claiming '/run/udev/links/\x2fserial\x2fby-path\x2fplatform-3530000.xhci-usb-0:3.4.1:1.0'
creating link '/dev/serial/by-path/platform-3530000.xhci-usb-0:3.4.1:1.0' to '/dev/ttyACM1'
preserve already existing symlink '/dev/serial/by-path/platform-3530000.xhci-usb-0:3.4.1:1.0' to '../../ttyACM1'

I'm not sure why the liburg_c_wrapper.so is failing. The program functions fine when executed from the terminal.

Any help is greatly appreciated.

Thanks

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
2

answered 2017-09-15 12:49:03 -0600

SpacemanSPIFF gravatar image

I used

KERNEL=="ttyACM[0-9]*", ACTION=="add", ATTRS{idVendor}=="15d1", MODE="0666", GROUP="dialout", PROGRAM="/bin/sh -c '$(find /opt/ros -name env.sh | sort -r | head -1) rosrun urg_node getID %N q'", SYMLINK+="sensors/hokuyo_%c"

udev rule from

https://answers.ros.org/question/1727...

to solve the problem.

Thanks

edit flag offensive delete link more

Comments

thanks for posting along with the reference - helped me compare udev rules to determine why mine wasn't working as I expected

cat_in_box gravatar image cat_in_box  ( 2019-08-01 12:47:46 -0600 )edit
1

answered 2020-01-10 06:49:10 -0600

Octopic gravatar image

The problem is that udev run as root and don't have the /opt/ros/dist/lib in his shared object path. I did :


pi@raspberrypi:~ $ /opt/ros/melodic/lib/urg_node/getID /dev/ttyACM0 q
H0508558
pi@raspberrypi:~ $ su
Mot de passe :
root@raspberrypi:/home/pi# /opt/ros/melodic/lib/urg_node/getID /dev/ttyACM0 q
/opt/ros/melodic/lib/urg_node/getID: error while loading shared libraries: liburg_c_wrapper.so: cannot open shared object file: No such file or directory
root@raspberrypi:/home/pi# cd /opt/ros/melodic/lib/
root@raspberrypi:/opt/ros/melodic/lib# ldconfig /opt/ros/melodic/lib/
root@raspberrypi:/opt/ros/melodic/lib# /opt/ros/melodic/lib/urg_node/getID /dev/ttyACM0 q
H0508558`
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2017-09-14 18:42:53 -0600

Seen: 1,145 times

Last updated: Sep 15 '17