udev rules for multiple hokuyo LiDARS doesn't work: urg_node
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