I am working on ROS under Ubuntu 14.04 on an Odroid XU3 (ARM dev board).
I connect two USB devices to my dev board which are recognized as ttyACM0 and ttyACM1 according to the time when they are connected.
Since thoses devices (Arduino & PixHawk) have different PID / VID, I would like to bind them to a certain "custom name" tty like ttyController0 & ttyPosition0 for example.
According to this subject, we can simlink the device depending on PID & VID to ttyUSB0.
How should I do to simlink to a deterministic name? Would 4 rules in /etc/udev/rules.d/99-custom.rules
with a simlink work ?
ACTION=="add", ATTRS{idVendor}=="0123", ATTRS{idProduct}=="0001", RUN+="/bin/ln -s /dev/ttyACM0 /dev/ttyController"
ACTION=="remove", ATTRS{idVendor}=="0123", ATTRS{idProduct}=="0001", RUN+="/bin/rm /dev/ttyController"
ACTION=="add", ATTRS{idVendor}=="3210", ATTRS{idProduct}=="0002", RUN+="/bin/ln -s /dev/ttyACM0 /dev/ttyPosition"
ACTION=="remove", ATTRS{idVendor}=="3210", ATTRS{idProduct}=="0002", RUN+="/bin/rm /dev/ttyPosition"
Or can I use Udev with custom PID & VID ?