ros-industrial / robotiq

Robotiq packages (http://wiki.ros.org/robotiq)
BSD 2-Clause "Simplified" License
229 stars 378 forks source link

robotiq_ft_sensor: read symlink of sensor file descriptor #158

Open furushchev opened 5 years ago

furushchev commented 5 years ago

The current node crushes if given serial_id points out symlink. For example, if /dev/ttyUSB0 is symlinked to /dev/robotiq_ft_sensor by udev, the error shows up as followings:

$ rosrun robotiqt_sensor rq_sensor _serial_id:=rarm_robotiq_ft_sensor
[ INFO] [1562236271.820355094] [/robotiq_ft_sensor:ros.robotiq_ft_sensor]: Trying to connect to a sensor at /dev/rarm_robotiq_ft_sensor
*** buffer overflow detected ***: ~/catkin_ws/devel/lib/robotiq_ft_sensor/rq_sensor terminated
... a lot of core dumps ...

This PR fixes the error by reading symlinks before passing it to the part of sensor reading.