ros kinetic安装rosserial-arduino以及串口配置
主要参考:https://blog.csdn.net/wanzew/article/details/80030768
https://blog.csdn.net/qq_24254419/article/details/62241770
https://blog.csdn.net/xiaoxiali/article/details/17096591
1.安装arduinosudo apt-get install arduino
2.rosserial-arduino安装
sudo apt-get install ros-kinetic-rosserial-arduino
sudo apt-get install ros-kinetic-rosserial
yl@yl-Lenovo-XiaoXin-CHAO5000:~$ sudo apt-get install ros-kinetic-rosserial-arduino
[sudo] yl 的密码:
正在读取软件包列表... 完成
正在分析软件包的依赖关系树
正在读取状态信息... 完成
下列【新】软件包将被安装:
......
yl@yl-Lenovo-XiaoXin-CHAO5000:~$ sudo apt-get install ros-kinetic-rosserial
正在读取软件包列表... 完成
正在分析软件包的依赖关系树
正在读取状态信息... 完成
......
3.更新软件包sudo apt-get upgrade
4.把 ros_lib 安装到Arduino的开发环境中
cd sketchbook
cd libraries
rm -rf ros_lib
rosrun rosserial_arduino make_libraries.py .
rosrun rosserial_arduino make_libraries.py .(注意最后有一点,别漏了)
yl@yl-Lenovo-XiaoXin-CHAO5000:~$ sudo apt-get upgrade
正在读取软件包列表... 完成
正在分析软件包的依赖关系树
正在读取状态信息... 完成
正在计算更新... 完成
......
yl@yl-Lenovo-XiaoXin-CHAO5000:~$ cd sketchbook
yl@yl-Lenovo-XiaoXin-CHAO5000:~/sketchbook$ cd libraries
yl@yl-Lenovo-XiaoXin-CHAO5000:~/sketchbook/libraries$ rm -rf ros_lib
yl@yl-Lenovo-XiaoXin-CHAO5000:~/sketchbook/libraries$ rosrun rosserial_arduino make_libraries.py .
Exporting to .
Exporting actionlib
......
5.arduino IDE串口的配置
如果串口是灰色的(无法进行选择)
解决方法:
a.插上arduino到电脑USB,在终端命令行输入dmesg | tail
[ 3049.497245] usb 1-3: New USB device strings: Mfr=1, Product=2, SerialNumber=220
[ 3049.497251] usb 1-3: Product: Arduino Uno
[ 3049.497256] usb 1-3: Manufacturer: Arduino Srl
[ 3049.497260] usb 1-3: SerialNumber: 75735303731351317042
[ 3049.498924] cdc_acm 1-3:1.0: ttyACM0: USB ACM device
[ 4345.277294] usb 1-3: USB disconnect, device number 10
[ 4345.663390] usb 1-3: new full-speed USB device number 11 using xhci_hcd
[ 4345.791924] usb 1-3: Device not responding to setup address.
[ 4345.999381] usb 1-3: Device not responding to setup address.
[ 4346.207431] usb 1-3: device not accepting address 11, error -71
我的是ttyACM0(有的是ttyUSB0)
b. 再输入ls -l /dev/ttyACM0(或ttyUSB0)
c.输入su
如果显示
su:认证失败
输入sudo passwd
根据提示完成密码重置
再次输入su
输入重置的密码即可
d.输入ls -ld /run/lock(或 ls -ld /var/lock)
e.输入chmod +rwx /run/lock (或chmod +rwx /var/lock)
f.断开arduino,重启电脑,打开arduino IDE就可以看到serial port里出现/dev/ttyACM0这个选项,勾选即可。
文章评论