kobuki(turtlebot)+rplidar 串口調試--ROS

參考博客
單個USB設備讀取路徑及權限設置
查看USB端口的狀態命令:

ls -l /dev |grep ttyUSB

生成rplidar.rules 文件:

sudo gedit /etc/udev/rules.d/rplidar.rules

然後編輯文件:

# set the udev rule , make the device_port be fixed by rplidar  
#  
KERNEL=="ttyUSB*", ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="ea60", MODE:="0777", SYMLINK+="rplidar"  

然後拔插雷達的USB口,重新執行查看命令看到

hri@hri-Lenovo-Gaming:~$ ls -l  /dev |grep ttyUSB
lrwxrwxrwx  1 root root           7 1120 17:07 rplidar -> ttyUSB0
lrwxrwxrwx  1 root root           7 1120 17:07 kobuki -> ttyUSB1
crwxrwxrwx  1 root dialout 188,   0 1120 17:07 ttyUSB0
crw-rw-rw-  1 root dialout 188,   1 1120 17:07 ttyUSB1

使用hub 鏈接多個USB設備

sudo gedit /etc/udev/rules.d/slam_hub.rules

然後編輯:

 SUBSYSTEMS=="usb"      
    DRIVERS=="cp210x"  
    ATTRS{bInterfaceClass}=="ff"  
    ATTRS{bInterfaceSubClass}=="00"  
    ATTRS{bInterfaceProtocol}=="00"  
    ATTRS{bNumEndpoints}=="02"  
    ATTRS{supports_autosuspend}=="1"  
    ATTRS{bAlternateSetting}==" 0"  
    ATTRS{bInterfaceNumber}=="00"  
    ATTRS{interface}=="CP2102 USB to UART Bridge Controller"  
KERNEL=="ttyUSB*", KERNELS=="3-2.3", MODE:="0777",SYMLINK+="slamtec_base_"  
KERNEL=="ttyUSB*", KERNELS=="3-2.4", MODE:="0777",SYMLINK+="slamtec_laser_" 

最後查看

hri@hri-Lenovo-Gaming:~$ ls -l  /dev |grep ttyUSB
lrwxrwxrwx  1 root root           7 1120 17:07 kobuki -> ttyUSB1
lrwxrwxrwx  1 root root           7 1120 17:07 rplidar -> ttyUSB0
lrwxrwxrwx  1 root root           7 1120 17:07 slamtec_base_ -> ttyUSB1
lrwxrwxrwx  1 root root           7 1120 17:07 slamtec_laser_ -> ttyUSB0
crwxrwxrwx  1 root dialout 188,   0 1120 17:07 ttyUSB0
crw-rw-rw-  1 root dialout 188,   1 1120 17:07 ttyUSB1
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章